@tight-embedded/react 6.0.2 → 6.1.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/dist/index.css +331 -315
- package/dist/index.css.gz +0 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.js.map.gz +0 -0
- package/package.json +9 -7
- package/dist/235.css +0 -446
- package/dist/235.css.gz +0 -0
- package/dist/41.css +0 -245
- package/dist/41.css.gz +0 -0
- package/dist/fonts/G centra-book.otf +0 -0
- package/dist/fonts/G centra-book.otf.gz +0 -0
- package/dist/fonts/G centra-medium.otf +0 -0
- package/dist/fonts/G centra-medium.otf.gz +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/fonts/gcentra-book.woff +0 -0
- package/dist/fonts/gcentra-book.woff.gz +0 -0
- package/dist/fonts/gcentra-book.woff2 +0 -0
- package/dist/fonts/gcentra-medium.woff +0 -0
- package/dist/fonts/gcentra-medium.woff.gz +0 -0
- package/dist/fonts/gcentra-medium.woff2 +0 -0
- package/dist/gcentra.css +0 -25
- package/dist/gcentra.css.gz +0 -0
- package/dist/inter.css +0 -36
- package/dist/inter.css.gz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{create as e}from"zustand";import{devtools as t,persist as n}from"zustand/middleware";import"zustand/react/shallow";import{cloneDeep as r,entries as a,mapValues as o,isEqual as i,differenceBy as l,isEmpty as s,debounce as c}from"lodash-es";import{v4 as d}from"uuid";import*as u from"zod";import{z as h}from"zod";import*as p from"react";import{useRef as g,useMemo as m,createContext as v,useContext as C,Component as b,useState as f,useCallback as y,useEffect as x,createElement as k,forwardRef as T,useImperativeHandle as w,useReducer as E,useLayoutEffect as A}from"react";import{jsx as I,Fragment as S,jsxs as N}from"react/jsx-runtime";import{QueryClient as P,useIsRestoring as R,useQuery as M,keepPreviousData as D,useMutation as L}from"@tanstack/react-query";import O from"yocto-queue";import F from"big.js";import{ResponsiveContainer as B,BarChart as U,Legend as V,CartesianGrid as W,XAxis as H,YAxis as q,Tooltip as j,Bar as z,ReferenceLine as K,Line as Y}from"recharts";import{flexRender as _,createColumnHelper as Z,useReactTable as G,getCoreRowModel as Q,getExpandedRowModel as X}from"@tanstack/react-table";import{useFloatingNodeId as J,useFloating as $,offset as ee,flip as te,shift as ne,size as re,autoUpdate as ae,useClick as oe,useDismiss as ie,useRole as le,useInteractions as se,useFloatingParentNodeId as ce,FloatingTree as de,FloatingNode as ue,useMergeRefs as he,FloatingOverlay as pe,FloatingPortal as ge,FloatingFocusManager as me,useTransitionStatus as ve}from"@floating-ui/react";import{ContextAwareConfirmation as Ce,confirmable as be}from"react-confirm";import{createFormHookContexts as fe,useStore as ye,createFormHook as xe}from"@tanstack/react-form";import{NumericFormat as ke}from"react-number-format";import Te from"fuse.js";import{openDB as we}from"idb";import{PersistQueryClientProvider as Ee}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ae}from"@microsoft/fetch-event-source";function Ie(e,t){return`${e.trim()}:${t.trim()}`}const Se=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_ATTACH_TO_GLSOURCE:!1,FEATUREFLAG_FREQUENCY_SELECTOR:!1,FEATUREFLAG_SUGGESTED_CATEGORIES:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,Ie("featureFlags","updateFlags"))});function Ne(){return ze(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}function Pe(){return ze(e=>e.FEATUREFLAG_SUGGESTED_CATEGORIES)}const Re="drawerNavigation",Me=e=>({drawerHistory:[],closingDrawerCount:0,openDrawer:(t,n={})=>e(e=>{const{replaceHistory:a,routeProps:o}=n,i={[t]:{routeProps:o}};if(a||0===e.drawerHistory.length)return{drawerHistory:[i],closingDrawerCount:0};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t,closingDrawerCount:0}}},void 0,Ie(Re,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:0}},void 0,Ie(Re,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ie(Re,"closeAllDrawers")),requestCloseDrawer:()=>e(e=>0===e.drawerHistory.length?{}:{closingDrawerCount:1},void 0,Ie(Re,"requestCloseDrawer")),requestCloseAllDrawers:()=>e(e=>({closingDrawerCount:e.drawerHistory.length}),void 0,Ie(Re,"requestCloseAllDrawers")),confirmCloseDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:Math.max(0,e.closingDrawerCount-1)}},void 0,Ie(Re,"confirmCloseDrawer")),confirmCloseAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ie(Re,"confirmCloseAllDrawers"))}),De=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Ie("externalOptions","setOptions"))});function Le(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const e={...n};if(delete e.children,t.push(e),n.children&&n.children.length>0){const e=Le(n.children);t.push(...e)}}return t}function Oe(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:d()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}const Fe="search",Be=Oe({key:Fe,name:"Search"}),Ue="transactionsDashFilters";function Ve(e){if(0===e.length)return e;const t=function(e,t){if(0===e.length)return-1;let n=e.length-1;for(;n>-1;){if(t(e[n]))return n;n--}return-1}(e,e=>e.modelKey===Fe);return-1===t?e:e.filter((e,n)=>n===t||e.modelKey!==Fe)}const We=e=>({transactionsDashFilters:[],userTransactionDashFiltersActive:!1,addTransactionsDashFilters:t=>e(e=>{const n=Ve([...e.transactionsDashFilters,...t]);return{...e,transactionsDashFilters:n,userTransactionDashFiltersActive:!0}},void 0,Ie(Ue,"addFilter")),removeTransactionsDashFilter:t=>e(e=>{const n=(r=e.transactionsDashFilters,(a=t)>-1&&a<=r.length-1?[...r.slice(0,a),...r.slice(a+1)]:[...r]);var r,a;return{...e,transactionsDashFilters:n}},void 0,Ie(Ue,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:Ve(t)}),void 0,Ie(Ue,"setFilters"))}),He={label:"Connected Accounts",value:"connected"},qe="banksAndIntegrationsState",je=e=>({banksAndIntegrationsSelectedTab:He,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Ie(qe,"setBanksAndIntegrationsSelectedTab")),toggleExpandedIntegration:(t,n)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||n&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,Ie(qe,"toggleExpandedIntegration"))}),ze=e()(t(n((...e)=>({...Se(...e),...Me(...e),...De(...e),...We(...e),...je(...e)}),{name:"tight-featureflag-storage",partialize:e=>{const t=Object.entries(e).filter(([e])=>e.startsWith("FEATUREFLAG"));return Object.fromEntries(t)}}),{name:"globalStore",store:"globalStore",enabled:!1})),Ke={SELECT:"select",EXPAND:"expand"},Ye={...Ke,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},_e=[Ye.COMMENTS,Ye.DATE,Ye.DESCRIPTION,Ye.AMOUNT,Ye.CATEGORY,Ye.CLASS_SEGMENT,Ye.REVIEW_STATUS],Ze=u.object({pageSize:u.optional(u.int32().positive()),columns:u.optional(u.array(u.enum(_e)))}),Ge=u.optional(u.string().trim()),Qe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Xe=u.optional(u.array(u.string().trim())),Je=u.object({integrations:u.optional(u.array(u.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"]))),useOnPlaidLink:u.optional(u.boolean()),hideManualBanks:u.optional(u.boolean())}),$e={transactionsDashboard:e=>{const t=Ze.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=Ge.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Xe.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>Qe.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=Je.safeParse(e);return t.success?t.data:void 0}},et=(e,t)=>{if(void 0!==$e[e])return(0,$e[e])(t)};function tt(e){const t=g(!1),n=ze(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of a(e)){const e=et(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const o=ze(e=>e.externalOptions);return{options:m(()=>r(o),[o]),setOptions:n}}function nt(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function rt(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function at(e){return String.fromCharCode(e+(e>25?39:97))}function ot(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=at(t%52)+n;return at(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var it=/\s*!(important)?/i;function lt(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var st=e=>{const t=/* @__PURE__ */new Map;return(...n)=>{const r=JSON.stringify(n);if(t.has(r))return t.get(r);const a=e(...n);return t.set(r,a),a}},ct=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function dt(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(ct.has(n))return;const r=e[n],a=t[n];nt(r)&&nt(a)?e[n]=dt(r,a):e[n]=a}),e):e,{})}var ut=e=>null!=e;function ht(e,t,n={}){const{stop:r,getKey:a}=n;return function e(n,o=[]){if("object"==typeof(i=n)&&null!==i){const i={};for(const[l,s]of Object.entries(n)){const c=a?.(l,s)??l,d=[...o,c];if(r?.(n,d))return t(n,o);const u=e(s,d);ut(u)&&(i[c]=u)}return i}var i;return t(n,o)}(e)}function pt(e,t,n=!0){const{utility:r,conditions:a}=t,{hasShorthand:o,resolveShorthand:i}=r;return ht(e,e=>{return Array.isArray(e)?(t=e,n=a.breakpoints.keys,t.reduce((e,t,r)=>{const a=n[r];return null!=t&&(e[a]=t),e},{})):e;var t,n},{stop:e=>Array.isArray(e),getKey:n?e=>o?i(e):e:void 0})}var gt={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},mt=/([A-Z])/g,vt=/^ms-/,Ct=st(e=>e.startsWith("--")?e:e.replace(mt,"-$1").replace(vt,"-ms-").toLowerCase()),bt=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),ft=`(?:${"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("|")})`,yt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${ft}$`),xt={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):nt(e)?ht(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&bt.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&yt.test(e)},kt=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,rt(t))};const Tt=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,_supportHover,_notDisabled,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(",")),wt=/^@|&|&$/;function Et(e){return Tt.has(e)||wt.test(e)}const At=/^_/,It=/&|@/,St=/* @__PURE__ */new Map;"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,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,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,WebkitTextFillColor:wktf-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(e=>{const[t,n]=e.split(":");St.set(t,n)});const Nt={conditions:{shift:function(e){return e.sort((e,t)=>{const n=Et(e),r=Et(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>Tt.has(e)?e.replace(At,""):It.test(e)?`[${lt(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${St.get(e)||Ct(e)}_${lt(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Pt=function(e){const{utility:t,hash:n,conditions:r=gt}=e,a=e=>[t.prefix,e].filter(Boolean).join("-");return st(({base:o,...i}={})=>{const l=pt(Object.assign(i,o),e),s=/* @__PURE__ */new Set;return ht(l,(e,o)=>{if(null==e)return;const i="string"==typeof(u=e)&&it.test(u),[l,...c]=r.shift(o),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(it,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,o)=>{let i;if(n){const n=[...r.finalize(e),o];i=a(t.toHash(n,ot))}else i=[...r.finalize(e),a(o)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(Nt),Rt=(...e)=>Pt(Mt(...e));Rt.raw=(...e)=>Mt(...e);const{mergeCss:Mt}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>nt(e)&&Object.keys(rt(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>pt(t,e))}return{mergeCss:st(function(...e){return dt(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(Nt);function Dt(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Lt=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Ot(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:a}=Lt(e),o=e=>({...r,...rt(e)});function i(e={}){const r=o(e);let i={...t};for(const[t,a]of Object.entries(r))n[t]?.[a]&&(i=Mt(i,n[t][a]));const l=function(e,t){let n={};return e.forEach(e=>{Object.entries(e).every(([e,n])=>"css"===e||(Array.isArray(n)?n:[n]).some(n=>t[e]===n))&&(n=Mt(n,e.css))}),n}(a,r);return Mt(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(st(function(e){return Rt(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const o=Lt(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(n));return Ot({base:Mt(t,o.base),variants:Object.fromEntries(i.map(e=>[e,Mt(n[e],o.variants[e])])),defaultVariants:dt(r,o.defaultVariants),compoundVariants:[...a,...o.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),a=e=>{const t={};for(let r=0;r<e.length;r++){const a=e[r];n[a]&&(Object.defineProperty(t,a,n[a]),delete n[a])}return t};return t.map(e=>a(Array.isArray(e)?e:r.filter(e))).concat(a(r))}(e,l)},getVariantProps:o})}var Ft,Bt=((Ft=Bt||{}).component="component",Ft["dashboard-placeholder-table"]="dashboard-placeholder-table",Ft["dashboard-header"]="dashboard-header",Ft["dashboard-table"]="dashboard-table",Ft["dashboard-table-body"]="dashboard-table-body",Ft["dashboard-table-cell"]="dashboard-table-cell",Ft["dashboard-table-column-header"]="dashboard-table-column-header",Ft["dashboard-table-header"]="dashboard-table-header",Ft.label="label",Ft.popup="popup",Ft["popup-sort-row"]="popup-sort-row",Ft["progress-bar"]="progress-bar",Ft["progress-bar-fill"]="progress-bar-fill",Ft.summation="summation",Ft["table-parent-row"]="table-parent-row",Ft["table-row"]="table-row",Ft["table-sub-row"]="table-sub-row",Ft.tile="tile",Ft["tile-bar-label"]="tile-bar-label",Ft["tile-bar-label-outer"]="tile-bar-label-outer",Ft["tile-body"]="tile-body",Ft["tile-filter-button"]="tile-filter-button",Ft["tile-filter-list"]="tile-filter-list",Ft["tile-filter-row"]="tile-filter-row",Ft["tile-header"]="tile-header",Ft["tile-title"]="tile-title",Ft.title="title",Ft["business-owner-dashboard"]="business-owner-dashboard",Ft["business-owner-dashboard-header"]="business-owner-dashboard-header",Ft["business-owner-table"]="business-owner-table",Ft["transaction-type-label"]="transaction-type-label",Ft["transaction-date-cell-container"]="transaction-date-cell-container",Ft["selector-row"]="selector-row",Ft["popup-list"]="popup-list",Ft.badge="badge",Ft["badge-chip"]="badge-chip",Ft["date-cell"]="date-cell",Ft["expander-cell"]="expander-cell",Ft["vertical-divider"]="vertical-divider",Ft["horizontal-divider"]="horizontal-divider",Ft["table-cell-divider"]="table-cell-divider",Ft["checkbox-input"]="checkbox-input",Ft["bulk-select"]="bulk-select",Ft["button-base"]="button-base",Ft["button-discrete-small"]="button-discrete-small",Ft["button-primary"]="button-primary",Ft["button-secondary"]="button-secondary",Ft["button-tertiary"]="button-tertiary",Ft["button-danger"]="button-danger",Ft["button-warning"]="button-warning",Ft["button-action"]="button-action",Ft["button-table-header"]="button-table-header",Ft["button-inline"]="button-inline",Ft["pagination-button"]="pagination-button",Ft.text="text",Ft["cell-button"]="cell-button",Ft["selector-button"]="selector-button",Ft["review-status-selector-button"]="review-status-selector-button",Ft["review-status-dropdown-arrow"]="review-status-dropdown-arrow",Ft["financial-summary-layout"]="financial-summary-layout",Ft["financial-summary-chatbox"]="financial-summary-chatbox",Ft["financial-summary-chatbox-header"]="financial-summary-chatbox-header",Ft["month-picker"]="month-picker",Ft["month-picker-left-button"]="month-picker-left-button",Ft["month-picker-right-button"]="month-picker-right-button",Ft["month-picker-label"]="month-picker-label",Ft["filter-bar"]="filter-bar",Ft["filter-search-bar"]="filter-search-bar",Ft["filter-pill"]="filter-pill",Ft["discrete-form-input"]="discrete-form-input",Ft["editable-form-input"]="editable-form-input",Ft["category-text"]="category-text",Ft["amount-input-container"]="amount-input-container",Ft["amount-input"]="amount-input",Ft["modal-popup"]="modal-popup",Ft["drawer-header"]="drawer-header",Ft["drawer-header-border"]="drawer-header-border",Ft["form-body"]="form-body",Ft.body="body",Ft.heading="heading",Ft["sub-label"]="sub-label",Ft["strong-label"]="strong-label",Ft["strong-sub-label"]="strong-sub-label",Ft["metric-xl"]="metric-xl",Ft["metric-md"]="metric-md",Ft["large-icon"]="large-icon",Ft["medium-icon"]="medium-icon",Ft["small-icon"]="small-icon",Ft["tiny-icon"]="tiny-icon",Ft["x-large-icon"]="x-large-icon",Ft["xx-large-icon"]="xx-large-icon",Ft.icon="icon",Ft["neutral-badge"]="neutral-badge",Ft["highlight-badge"]="highlight-badge",Ft["success-badge"]="success-badge",Ft["warning-badge"]="warning-badge",Ft["critical-badge"]="critical-badge",Ft["button-group"]="button-group",Ft["alert-dialog"]="alert-dialog",Ft["alert-header"]="alert-header",Ft["emphasis-label"]="emphasis-label",Ft["profit-loss-graph"]="profit-loss-graph",Ft.banner="banner",Ft["banner-high"]="banner-high",Ft["banner-medium"]="banner-medium",Ft["banner-low"]="banner-low",Ft["banner-urgent"]="banner-urgent",Ft["banner-default"]="banner-default",Ft["banner-button"]="banner-button",Ft["banner-button-text"]="banner-button-text",Ft["banner-button-icon"]="banner-button-icon",Ft["banner-icon"]="banner-icon",Ft["banner-title"]="banner-title",Ft["empty-dashboard-layout"]="empty-dashboard-layout",Ft["zero-state-layout"]="zero-state-layout",Ft["emphasis-sub-label"]="emphasis-sub-label",Ft);const Ut="Tight-",Vt=e=>`${Ut}${e}`;function Wt(e){return e in Bt}function Ht(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Ut&&r in Bt}function qt(e){return!Wt(e)&&!Ht(e)}const jt=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Vt(e)),t.forEach(e=>{void 0!==e&&(qt(e)?r.push(e):Wt(e)&&n.push(Vt(e)))}),{className:Dt(...n,...r)}},zt=jt(Bt["business-owner-dashboard-header"],Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"10px",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function Kt({children:e}){return I("div",{...zt,children:e})}function Yt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Ht(t)&&e.push(t),e),[])],[])}function _t(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(qt(t)&&e.push(t),e),[])],[])}function Zt(e){const t=Array.isArray(e)?e:[e];return{className:Dt(...Yt(t),..._t(t))}}const Gt=Ot({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{xl:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{xl:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{xl:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontSize:"lg",fontWeight:"sm",lineHeight:"18px",xl:{fontWeight:"label.strong",fontSize:"label.strong",lineHeight:"16px"},fontFamily:"label",color:"typography.label.strong",letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:{xl:"heading",base:"lg"},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"}}}}),Qt=jt(Bt.heading,Gt({heading:"default"}));function Xt({children:e,stylists:t=[]}){const n=Zt([Qt,...t]);return I("div",{...n,children:e})}function Jt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function $t(e,t,n){return new Date(e,t,n)}function en(e){const[t,n,r]=e.split("-");return $t(Number(t),Number(n),Number(r))}function tn(){return Jt($t(/* @__PURE__ */(new Date).getFullYear()+1,0,0))}function nn(e,t){return Jt($t(t,e,1))}function rn(){const e=/* @__PURE__ */new Date;return Jt($t(e.getFullYear(),e.getMonth()+1,0))}const an={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},on=e=>{switch(e){case an.THIS_YEAR:return Jt($t(/* @__PURE__ */(new Date).getFullYear(),0,1));case an.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return nn(e.getMonth(),e.getFullYear())}();case an.LAST_YEAR:return Jt($t(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case an.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Jt($t(e.getFullYear(),e.getMonth()-1,1))}();case an.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return Jt($t(e.getFullYear(),e.getMonth()-11,1))}();default:return""}},ln=e=>{switch(e){case an.THIS_YEAR:return tn();case an.THIS_MONTH:return rn();case an.LAST_YEAR:return Jt($t(/* @__PURE__ */(new Date).getFullYear(),0,0));case an.PAST_YEAR:return rn();case an.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Jt($t(e.getFullYear(),e.getMonth(),0))}();default:return""}};const sn=e=>{return t=e,Object.values(an).includes(t)?{beginDate:on(e),endDate:ln(e)}:function(e){if("object"!=typeof e)return!1;const t=e;return"string"==typeof t.beginDate&&"string"==typeof t.endDate}(e)?e:{beginDate:Jt((n=e).beginDate),endDate:Jt(n.endDate)};var t,n},cn=["SUN","MON","TUE","WED","THU","FRI","SAT"],dn=["January","February","March","April","May","June","July","August","September","October","November","December"];function un({yearsBack:e=10,startYear:t}){const n=t??/* @__PURE__ */(new Date).getFullYear(),r=[n];for(let a=n-1;a>=n-e;a--)r.push(a);return r}function hn(e,t){return e.toDateString()===t.toDateString()}function pn(e){return hn(e,/* @__PURE__ */new Date)}function gn(e,t){const n=$t(e.getFullYear(),e.getMonth(),e.getDate()),r=$t(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function mn(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function vn(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=$t(n,e-1,t);return!(r.getFullYear()!==n||r.getMonth()!==e-1||r.getDate()!==t)}function Cn(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return vn(o,i,l)?$t(l,o-1,i):null}function bn(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})/);if(!t)return null;const[,n,r,a]=t,o=parseInt(n,10),i=parseInt(r,10),l=parseInt(a,10);return vn(i,l,o)?$t(o,i-1,l):null}function fn(e){if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getDate()).padStart(2,"0");return`${t}-${String(e.getMonth()+1).padStart(2,"0")}-${n}`}function yn(e,t){return gn(e,t)?t:e}function xn(e,t){return gn(t,e)?t:e}const kn=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"},r=e.toLocaleString("default",n);let a=r;if(t.abbreviateYear){const e=r.length-2;a=r.slice(0,e)+"'"+r.slice(e)}return a},Tn=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return pn(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):kn(t,{abbreviateMonth:!0,abbreviateYear:!1})},wn=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function En(e,t){return $t(e.getFullYear(),e.getMonth(),e.getDate()+t)}function An(e,t,n){return[...e,{accessToken:t,environment:n}]}function In(e,t){return[...e,t]}const Sn=e=>null==e,Nn=e=>!Sn(e);function Pn(e){return""===e.trim()}function Rn(e){return Sn(e)||Pn(e)}function Mn(e){return!Rn(e)}const Dn=v({activeToken:void 0,accountantToken:void 0});function Ln(){const{activeToken:e}=C(Dn);return e}const On=()=>{throw new Error("No access token provided")},Fn=72e5,Bn=new P({defaultOptions:{queries:{gcTime:Fn,staleTime:3e4,refetchInterval:6e4}}}),Un=v("SANDBOX");function Vn(){return C(Un)}function Wn({queryKey:e,queryFn:t,...n}){const r=Ln(),a=Vn(),o=Mn(r),i=An(e,r??"",a),l=R(),s=M({...n,queryKey:i,queryFn:o?t:On,placeholderData:n.keepPreviousDataPlaceholder?D:void 0,...o?{}:{retry:!1,staleTime:1/0}},Bn);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class Hn{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:n,payloadVersion:r}){const a=/* @__PURE__ */(new Date).toISOString(),o=JSON.stringify({apiKey:e,payloadVersion:r,notifier:n,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":r,"Bugsnag-Sent-At":a},referrerPolicy:"no-referrer",body:o})}}const qn=Symbol("Circular"),jn=Symbol("AccessError");function zn(e,t,n){return Kn({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function Kn({key:e,value:t,replacer:n,seen:r,depthLimit:a=1/0,depth:o,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(r.includes(s)&&(s=qn),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Yn(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(o>a||i+1>l)return"[...]";if(r.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=Yn(()=>s[i]);e.push(Kn({key:i,value:t,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=Yn(()=>s[c]);e[c]=Kn({key:c,value:d,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function Yn(e){try{return e()}catch{return jn}}const _n=Object.prototype.toString,Zn=Object.getPrototypeOf;function Gn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Qn=/^\s*at .*(\S+:\d+|\(native\))/m,Xn=/^(eval@)?(\[native code])?$/;function Jn(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const n=t[2]?parseInt(t[2],10):void 0,r=t[3]?parseInt(t[3],10):void 0;return[t[1],n,r]}function $n(e,t){const n=er(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&Gn(n.metadata)&&(r={...r,[n.name]:n.metadata});const a=[tr(n)];return a.push(...ar(n).map(e=>tr(e,{backtrace:!1}))),{exceptions:a,metadata:r}}function er(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===_n.call(t))return!0;t=Zn(t)}return!1}(e))return e;let n=function(e){if(!Gn(e))return null;const t=t=>{const n=e[t];if("string"==typeof n&&e[t.length])return n},n=t("name")||t("errorClass"),r=t("message")||t("errorMessage");if(!n||!r)return null;const a=new Error(r);return a.name=n,a}(e);if(n)return n;switch(typeof n){case"string":case"number":case"boolean":return new Error(String(e));default:return n=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),n.name="InvalidError",n}}function tr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:nr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function nr(e,{backtrace:t}){const n=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return n?function(e){return(e.match(Qn)?e.split("\n").filter(e=>!!e.match(Qn)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),a=Jn(n?n[1]:r.pop()||"(no location)"),o=r.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(a[0])>-1?void 0:a[0],lineNumber:a[1],columnNumber:a[2],method:o}}):(t=e,t.split("\n").filter(e=>!e.match(Xn)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=Jn(e.replace(t,""));return{file:a[0],lineNumber:a[1],columnNumber:a[2],method:r}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let n=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";n=n.replace(/\?.*$/,"").replace(/#.*$/,"");let r=t.method||"(unknown function)";return r=/^global code$/i.test(r)?"global code":r,e.concat([{file:n,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:r}])},[]);var t}(n):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<rr;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const rr=20;function ar(e){const t=e;if(t.cause){const e=er(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(ar(e))}return[]}function or(...e){console.log}function ir(...e){console.error}const lr={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let sr=Date.now();const cr=()=>{sr=Date.now()},dr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-sr,!0}),{reset:cr})},ur=[["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\)$/]],hr=[["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/]],pr=(gr=function(e){const t=""!==(n=e)&&ur.reduce((e,[t,r])=>{if(e)return e;const a=r.exec(n);return!!a&&[t,a]},!1);var n;if(!t)return{};const[r,a]=t,o=function(e){for(const[t,n,r]of hr)if(r.exec(e))return{osName:t,osVersion:n};return null}(e),i="iOS"===o?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:r,browserVersion:a[1],osName:o?.osName,osVersion:o?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...gr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var gr;class mr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new O}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class vr extends b{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:n,metadata:r}=$n(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let n="";for(let r=0,a=t.length;r<a;r++)t[r].length&&(n+=`${n.length?"\n":""}${t[r]}`);return n}(t.componentStack));const{onError:a,client:o}=this.props;o.notifyEvent({exceptions:n,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...r,react:t},onError:a},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return I(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return I(S,{children:this.props.children})}}const Cr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>I(vr,{client:e,onError:t,FallbackComponent:n,children:r})})},br=new class{breadcrumbs=[];config;delivery=new Hn(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return ir(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const n of this.config.plugins||[])this.plugins.push({name:n.name||"unknown",plugin:n.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:n,metadata:r}=$n(e,"notify");let a,o,i=r;return"function"==typeof t?a=t:(o=t.severity,t.metadata&&(i={...r,...t.metadata})),this.notifyEvent({exceptions:n,metadata:i,severity:o,onError:a},e)}leaveBreadcrumb(e,t,n){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:n||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:r=25}=this.config;this.breadcrumbs.length>r&&this.breadcrumbs.splice(0,this.breadcrumbs.length-r)}async notifyEvent({exceptions:e,unhandled:t,severity:n,severityReason:r,metadata:a,onError:o},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:n||"warning",severityReason:r,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:a||{}},c=[...this.errorCallbacks];o&&c.push(o);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=zn(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={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:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){ir()}}getUser(){return this.config?.user||{}}setUser(e,t,n){this.config&&(this.config.user={id:e,email:t,name:n})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let fr="",yr="";const xr="prod",kr=br.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"6.0.2",appType:"browser",releaseStage:xr,plugins:[dr,pr,lr,(()=>{const e=new mr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),Cr]}),Tr=(e,t)=>{try{br.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?wr({error:n,severity:"error"}):wr({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},wr=async e=>{try{await br.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:fr,environment:yr}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await wr({error:t,severity:"error"}):await wr({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},Er=kr.getPlugin("react"),Ar=Er?.BugsnagErrorBoundary,Ir=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,Sr=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},Nr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},Pr={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function Rr(e){const t=(({accessToken:e,extraHeaders:t})=>{const n={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...n}:n})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?Pr:{}}});return{url:(n=e.endpointManager.getUrl(e.path),r=e.pathParams,void 0!==r&&Object.entries(r).forEach(([e,t])=>{n=n.replace(`{${e}}`,t)}),n),headers:t};var n,r}async function Mr({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:a,url:o}){const i=Sr({extraHeaders:t,authorization:e});Tr("HTTP POST Request",{url:o,accessToken:e});try{const e=await fetch(o,{method:r,headers:i,credentials:"include",body:JSON.stringify(a)});return Tr("HTTP POST Response",{url:o,status:e.status,statusText:e.statusText}),Nr(e)}catch(l){return Promise.reject(l)}}async function Dr(e){const{url:t,headers:n}=Rr(e);return Mr({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function Lr(e){return Dr(e)}async function Or(e){return Dr(e)}const Fr=(e,t)=>({getUrl:t=>((e,t)=>{let n=t;for(;n.length>0&&"/"===n.charAt(0);)n=n.slice(1);return`${e}/${n}`})(e,t),baseUrl:e,apiVersion:t}),Br={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},Ur={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Vr={...Ur,LOCAL:"http://localhost:8082"};function Wr(e){return Fr(`${t=e,Br[t]}/v5`,"v5");var t}const Hr=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],qr=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,a=t[2].environment,o={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...sn(n.filter),...n.grouping&&{grouping:n.grouping}},accessToken:r,endpointManager:Wr(a)};return await Or(o)};function jr({filter:e,grouping:t,select:n}){return Wn({queryKey:Hr({filter:e,grouping:t}),queryFn:qr,select:n})}const zr="noDataHeight";function Kr(e){const t=bn(e??"");return null!==t?kn(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}function Yr(e){const t=Kr(e.period?.beginDate),n=e.netIncome??0,{profit:r,remainingIncome:a,loss:o,remainingExpenses:i}=function(e,t,n){const r=e>0?e:0,a=e<0?e:0;return{profit:r,remainingIncome:void 0!==t?F(t).minus(r).toNumber():0,loss:a,remainingExpenses:void 0!==n?F(n).plus(a).toNumber():0}}(n,e.income?.total,e.expenses?.total);return{month:{month:t,income:a,expenses:-i,profit:r,loss:o,netIncome:n,hasNoData:/* @__PURE__ */function(e,t,n){return 0===e&&0===t&&0===n}(n,a,i)},netIncome:n}}function _r(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(Sn(n))return t;for(const i of n){const{month:e,netIncome:n}=Yr(i);t.total=F(n).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:r,domainMax:a}=n.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[r,a],t.hasAnyData=t.months.some(e=>!e.hasNoData);const o=function(e,t){const n=t-e;return n>0?.03*n:3}(r,a);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:o}:e),t}const Zr=jt(Bt["tile-header"],Rt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Gr({title:e}){return I("div",{...Zr,children:I(Xt,{children:e})})}const Qr=jt(Bt["tile-body"],Rt({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}",borderBottomRadius:"lg",borderTop:"hidden"}));function Xr({children:e}){return I("div",{...Qr,children:e})}const Jr=Ot({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative",borderRadius:"lg"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function $r({children:e,type:t,isSample:n=!1}){const r=jt(Bt.tile,Jr({type:t,isSample:n}));return I("div",{...r,children:e})}const ea=Rt({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),ta=Rt.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),na=Rt({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),ra=jt(Bt.text,Rt({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea);function aa({children:e}){return I("div",{...ra,children:e})}const oa=jt(Bt["metric-xl"],Gt({metric:"xl"}));function ia(e){return I("div",{...oa,children:e.children})}const la=jt(Bt.summation,Rt({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function sa({title:e,label:t}){return N("div",{...la,children:[I(ia,{children:e}),I(aa,{children:t})]})}const ca=jt(null,Rt({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function da({children:e}){return I("div",{...ca,children:e})}const ua=(e,t=0)=>{const n=Math.abs(e);let r;if(t<=0)r=Math.round(n);else{const e=n.toFixed(t);r=parseFloat(e)}return Math.sign(e)*r},ha=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),pa=1e9;function ga(e,{cents:t="default",condense:n=!1,dollarSign:r=!1,signage:a="default"}={}){const o="string"==typeof e?parseFloat(e):e;if(Number.isNaN(o))return"";let i;const l=Math.abs(o);let s;if(n&&l>99999){s=Math.sign(o)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),n=Math.round(l/t),r=n*t;let a,c=n/1e3;l<pa&&c>=1e3&&(c/=1e3),r>=pa?a="B":r>=1e6?a="M":(c=Math.round(c),a="K"),i=`${ha(c,0,1)}${a}`}else{let e;const n=2,r=0;let a,l;"floor"===t?(a=r,l=r,c=o,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(a=r,l=r,e=ua(o,a)):"always"===t?(a=n,l=n,e=ua(o,a)):"default"===t&&Math.abs(o)>=1e3?(a=r,l=r,e=ua(o,a)):(a=n,e=ua(o,a),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=ha(d,l,a)}var c,d;let u=i;const h=r?"$":"";return void 0===a||"off"===a?u=i:"parens"===a?u=`${h}${s?`(${i})`:i}`:"always"===a?u=`${s?"-":"+"}${h}${i}`:"default"===a&&(u=`${s?"-":""}${h}${i}`),u}function ma(e){return ga(e,{condense:!0,dollarSign:!0})}function va(e){return ga(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const Ca=Ot({variants:{wrap:{ellipsis:ta,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function ba({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(Rn(n))return null;const a=Zt([jt(Bt["strong-label"],Gt({label:"strongLabel"}),Ca({wrap:e,textAlign:t})),...r]);return I("div",{title:"ellipsis"===e?n:void 0,...a,children:n})}const fa=Ot({base:{fontWeight:"label.sub",fontSize:"md",fontFamily:"label",lineHeight:"16px",letterSpacing:"0.66px",fontStyle:"normal",xl:{lineHeight:"14px",fontSize:"label.sub"}},variants:{intent:{normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:ta,wrap:{whiteSpace:"normal",overflowWrap:"break-word"},wrapThrice:{ellipsisTextRaw:ta,whiteSpace:"normal",textAlign:"left",display:"-webkit-box","-webkit-line-clamp":3,"-webkit-box-orient":"vertical"}}}});function ya({intent:e,wrap:t="ellipsis",children:n,accent:r}){const a=void 0===e&&void 0===r?"normal":e,o=jt(Bt["sub-label"],fa({intent:a,wrap:t,accent:r}),ea);return Rn(n)?null:I("div",{...o,children:n})}const xa=jt(null,Rt({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"}));function ka({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===zr)return null;let n=t[0].value??0;return"expenses"===t[0].dataKey?n+=t[0].payload.loss:"income"===t[0].dataKey&&(n+=t[0].payload.profit),N("div",{...xa,children:[I(ba,{children:t[0].name??""}),I(ya,{children:ma(Number(n))})]})}const Ta={"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.blue200":{value:"#EDFAFC",variable:"var(--Tight-colors-blue200)"},"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.green200":{value:"#DBF9EA",variable:"var(--Tight-colors-green200)"},"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.yellow200":{value:"#FFF3C3",variable:"var(--Tight-colors-yellow200)"},"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.red200":{value:"#FFCBCB",variable:"var(--Tight-colors-red200)"},"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:"12px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"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:"1px",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)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"animations.slideIn.right":{value:"300ms ease-out both slide-in-right",variable:"var(--Tight-animations-slideIn-right)"},"animations.slideIn.up":{value:"300ms ease-out both slide-in-up",variable:"var(--Tight-animations-slideIn-up)"},"animations.slideOut.right":{value:"300ms ease-in both slide-out-right",variable:"var(--Tight-animations-slideOut-right)"},"animations.slideOut.down":{value:"300ms ease-in both slide-out-down",variable:"var(--Tight-animations-slideOut-down)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(0, 0, 0, 0.05), 0px 4px 12px 0px rgba(0, 0, 0, 0.15) ",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.opaque":{value:"var(--Tight-colors-blue200)",variable:"var(--Tight-colors-brand-action-opaque)"},"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.opaque":{value:"var(--Tight-colors-green200)",variable:"var(--Tight-colors-brand-success-opaque)"},"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.opaque":{value:"var(--Tight-colors-yellow200)",variable:"var(--Tight-colors-brand-warning-opaque)"},"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.opaque":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-brand-danger-opaque)"},"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.surface.intent.danger.weak":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger-weak)"},"colors.surface.intent.danger.opaque":{value:"var(--Tight-colors-brand-danger-opaque)",variable:"var(--Tight-colors-surface-intent-danger-opaque)"},"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-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",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.accent.action":{value:"var(--Tight-colors-brand-action-strongest)",variable:"var(--Tight-colors-typography-accent-action)"},"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-weak)",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.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"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-green200)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.positive.strong":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive-strong)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.money.negative.strong":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative-strong)"},"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.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"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-2xl)",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.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",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-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",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.opaque":{value:"var(--Tight-colors-colorPalette-action-opaque)",variable:"var(--Tight-colors-colorPalette-action-opaque)"},"colors.colorPalette.opaque":{value:"var(--Tight-colors-colorPalette-opaque)",variable:"var(--Tight-colors-colorPalette-opaque)"},"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.opaque":{value:"var(--Tight-colors-colorPalette-success-opaque)",variable:"var(--Tight-colors-colorPalette-success-opaque)"},"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.opaque":{value:"var(--Tight-colors-colorPalette-warning-opaque)",variable:"var(--Tight-colors-colorPalette-warning-opaque)"},"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.opaque":{value:"var(--Tight-colors-colorPalette-danger-opaque)",variable:"var(--Tight-colors-colorPalette-danger-opaque)"},"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.intent.danger.weak":{value:"var(--Tight-colors-colorPalette-intent-danger-weak)",variable:"var(--Tight-colors-colorPalette-intent-danger-weak)"},"colors.colorPalette.intent.danger.opaque":{value:"var(--Tight-colors-colorPalette-intent-danger-opaque)",variable:"var(--Tight-colors-colorPalette-intent-danger-opaque)"},"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.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"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.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"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.positive.strong":{value:"var(--Tight-colors-colorPalette-positive-strong)",variable:"var(--Tight-colors-colorPalette-positive-strong)"},"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)"},"colors.colorPalette.negative.strong":{value:"var(--Tight-colors-colorPalette-negative-strong)",variable:"var(--Tight-colors-colorPalette-negative-strong)"}};function wa(e,t){return Ta[e]?.value||t}wa.var=function(e,t){return Ta[e]?.variable||t};const Ea=jt(null,Rt({borderRadius:"50%",flexShrink:0})),Aa=jt(null,Rt({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),Ia=wa.var("colors.surface.foreground.disabled");function Sa({color:e=Ia,diameter:t=17,label:n}){return N("div",{...Aa,"data-testid":"bullet-row",children:[I("div",{...Ea,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&I(ya,{children:n})]})}const Na=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function Pa({payload:e}){return void 0===e?null:I("div",{...Na,children:e.map((e,t)=>"none"!==e.type&&I(Sa,{color:e.color,label:e.value,diameter:17},t))})}const Ra={right:20,left:20},Ma=["income","profit","expenses","loss"],Da=e=>Ma.findIndex(t=>t===e.dataKey),La={paddingBottom:"20px",marginLeft:"-20px"},Oa={stackId:"stack",isAnimationActive:!1},Fa=jt(Bt["profit-loss-graph"],Rt({"& .recharts-surface":{outline:"none"}})),Ba=wa.var("colors.money"),Ua=wa.var("colors.border.layout"),Va=wa.var("colors.border.layout.strong"),Wa={fill:wa.var("colors.typography.base"),fontSize:wa.var("fontSizes.metric.sm")},Ha={profit:wa.var("colors.money.positive.strong"),income:wa.var("colors.money.positive.weak"),loss:wa.var("colors.money.negative.strong"),expenses:wa.var("colors.money.negative.weak")},qa=[0,100],ja=["auto","auto"];function za({data:e}){const[t,n]=f(!0);if(void 0===e)return null;const r=e.hasAnyData?ja:qa;return I(B,{width:"100%",height:"100%",...Fa,children:N(U,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:Ra,children:[I(V,{verticalAlign:"top",itemSorter:Da,wrapperStyle:La,content:({payload:e})=>I(Pa,{payload:e})}),I(W,{strokeDasharray:"0",vertical:!1,stroke:Ua}),I(H,{dataKey:"month",interval:0,tickLine:!1,stroke:Ua,tick:Wa}),I(q,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:Ua,tick:Wa,tickFormatter:e=>ma(e)}),I(j,{content:({active:e,payload:t})=>I(ka,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),I(z,{name:"Profit",dataKey:"profit",fill:Ha.profit,...Oa}),I(z,{name:"Income",dataKey:"income",fill:Ha.income,...Oa}),I(z,{name:"Loss",dataKey:"loss",fill:Ha.loss,...Oa}),I(z,{name:"Expenses",dataKey:"expenses",fill:Ha.expenses,...Oa}),I(z,{dataKey:zr,fill:Ua,legendType:"none",...Oa}),I(K,{y:0,stroke:Va}),I(Y,{dataKey:"netIncome",fill:Ba,stroke:Ba,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const Ka=Rt({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"});function Ya({styles:e}){const t=Dt(Ka,e);return I("div",{className:t,"data-testid":"shimmer-block"})}const _a=Rt({width:"40%",minHeight:65});function Za({children:e}){return N(S,{children:[I(Ya,{styles:_a}),I(da,{children:e})]})}const Ga=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),Qa=Rt({width:"80px",height:"17px",marginBottom:"10px"}),Xa=Rt({width:"100%",height:"100%"});function Ja(){return N(S,{children:[N("div",{...Ga,children:[I(Ya,{styles:Qa}),I(Ya,{styles:Qa}),I(Ya,{styles:Qa}),I(Ya,{styles:Qa})]}),I(Ya,{styles:Xa})]})}const $a=Ot({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"},xl:{fontSize:"10em"}}}});function eo({size:e}){const t=$a({size:e});return I("div",{className:t,children:"Sample"})}const to=20200,no=5043,ro=Object.freeze({income:to,expenses:no,netIncome:15157,absoluteSum:Math.abs(to)+Math.abs(no)}),ao=Object.freeze({total:no,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),oo=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),io=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function lo({filter:e=an.PAST_YEAR,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return jr({filter:e,grouping:t,select:_r})}({filter:e,grouping:"MONTHLY"}),a=t?function(){const e=[],t=/* @__PURE__ */new Date;let n=0,r=0,a=0;for(let o=11;o>=0;o--){const i=new Date(t.getFullYear(),t.getMonth()-o,1),l=kn(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=io[11-o],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),n+=c,r=Math.max(r,s.income),a=Math.max(a,s.expenses)}return{total:n,domain:[-a,r],months:e,hasAnyData:!0}}():n;return N($r,{type:"chart",children:[I(Gr,{title:"Profit + Loss"}),I(Xr,{children:r?I(Za,{children:I(Ja,{})}):N(S,{children:[I(sa,{title:ma(a?.total??0),label:"Profit"}),I(da,{children:I(za,{data:a})})]})}),t&&I(eo,{size:"xl"})]})}const so=jt(null,Rt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function co({children:e}){return I("div",{...so,children:e})}const uo="conversations-section",ho="transactions-section",po={MESSAGE_REVIEW:uo,TRANSACTION_REVIEW:ho,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},go={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},mo={resolutionStatus:{in:["OPEN"]}},vo=[],Co=[];function bo(e){return Fr(`${t=e,Ur[t]}`,"v6");var t}const fo={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},yo=e=>["tasks",e??{}],xo={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},ko=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:bo(t[2].environment)},a=await Lr(r);return"SUCCESS"===a.result&&void 0!==a.data?{data:a.data}:{data:void 0}};function To(e,t){return Wn({...e,queryKey:t?yo(t):["tasks",{}],queryFn:ko})}const wo=(e,t)=>{const n=Sn(r=e)||Sn(r.data)?[]:[...r.data].sort((e,t)=>xo[e.priority]-xo[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n},Eo=v({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0,clientId:void 0,useStripeInvoicePaymentProcessing:void 0,hasPayroll:void 0,hasShopify:void 0,hasSquare:void 0,unitIntegrationBankName:null}),Ao=Ot({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"}}}});function Io(e,t,n){const r=({size:t=24,fill:r="transparent",stylists:a})=>{const{apiPartnerName:o}=C(Eo),i=o&&n?.partnerIcons?.[o]||e,l=Zt([jt(null,Ao()),...a]);return I(i,{...l,style:{minHeight:t,minWidth:t},width:t,height:t,fill:r})};return r.displayName=t,r}const So=Io(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10,transform:"scale(-1, 1) translate(-13, 0)"})),"ArrowLeft"),No=Io(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10})),"ArrowRight"),Po=Rt({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),Ro=Rt({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),Mo=Rt({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});Rt({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}}),Rt({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}});const Do=v({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Lo({Component:e,stylists:t}){return I(e,{stylists:[jt(Bt["small-icon"],Bt.icon),...t??[]],size:12})}const Oo=jt(Bt["pagination-button"],Rt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{xl:"35px",base:"44px"},gap:0})),Fo=jt(null,Rt({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{xl:"4px",base:"12px"},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:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}}),Ro),Bo=jt(null,Rt({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center",width:{xl:"100%",base:"44px"}})),Uo=jt(null,Rt({height:{xl:"12px",base:"20px"},width:{xl:"12px",base:"20px"}}));function Vo(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=C(Do);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return N("div",{...Oo,children:[I("div",{...Bo,children:I("button",{...Fo,onClick:r,disabled:!t,children:I(Lo,{Component:So,stylists:[Uo]})})}),I("div",{...Bo,children:I("button",{...Fo,onClick:n,disabled:!e,children:I(Lo,{Component:No,stylists:[Uo]})})})]})}const Wo=Rt({width:"100%",height:"50px"});function Ho(){return I(Ya,{styles:Wo})}const qo=jt(Bt["dashboard-placeholder-table"],Rt({display:"flex",flexDirection:"column",gap:"4px"})),jo=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),zo=Rt({width:"100px",height:"20px"});function Ko({numColumns:e=6}){return N("div",{...qo,children:[I("div",{...jo,children:Array.from({length:e},(e,t)=>I(Ya,{styles:zo},t))}),I(Ho,{}),I(Ho,{}),I(Ho,{}),I(Ho,{}),I(Ho,{}),I(Ho,{})]})}function Yo(e,t){const n=Ln(),r=Vn();return y(a=>{const o=Mn(n),i=o?{}:{retry:!1,staleTime:1/0};return Bn.prefetchQuery({queryKey:An(e(a),n??"",r),queryFn:o?t:On,...i})},[e,t,n,r])}const _o=Object.freeze({}),Zo=Object.freeze({cursor:"FINAL_PAGE"});function Go({queryKey:e,queryFn:t,...n}){const[r,a]=f(_o),o=g(e);i(o.current,e)||(o.current=e,a(_o));const l=n.select,s=Nn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=In(e,r),d=Wn({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=m(()=>{return e=d.query.data?.cursor,t=a,{getFirstPage:()=>t(_o),getLastPage:()=>t(Zo),hasNextPage:Nn(e?.after),hasPreviousPage:Nn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=Yo(y(t=>In(e,t),[e]),t),p=Yo(y(t=>In(e,t),[e]),t);return x(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{wr({error:e,severity:"error"})}),e.before&&p({cursor:e.before}).catch(e=>{wr({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,p]),{...d,paginationControls:u}}async function Qo({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:a,cache:o}){const i=Sr({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let n=e;const r=null==(a=t)?"":Object.entries(a).map(([e,t])=>{let n;return n=Array.isArray(t)?t.map(t=>Ir(e,t)).join("&"):Ir(e,t),n}).join("&");var a;return""!==r&&(n+=`?${r}`),n})({url:a,params:r});Tr("HTTP GET Request",{url:a,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:o});return Tr("HTTP GET Response",{url:a,status:e.status,statusText:e.statusText}),Nr(e)}catch(s){return Promise.reject(s)}}async function Xo(e){const{url:t,headers:n}=Rr(e);return Qo({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function Jo(e){return Xo({...e,endpointManager:bo(e.environment)})}async function $o(e){return Xo({...e,endpointManager:Wr(e.environment)})}function ei({delay:e,callback:t}){const n=m(()=>function({delay:e,callback:t}){let n;const r=()=>{n&&(clearTimeout(n),n=void 0)};return{startCallback:a=>{r(),n=setTimeout(()=>{t(a)},e)},cancelCallback:()=>r()}}({delay:e,callback:t}),[e,t]);return x(()=>()=>{n.cancelCallback()},[n]),{startCallback:y(e=>{n.startCallback(e)},[n]),cancelCallback:y(()=>{n.cancelCallback()},[n])}}function ti({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=ei({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const ni={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"},ri={ASC:"ASC",DESC:"DESC"},ai=e=>["conversations",e??{}],oi=e=>["conversations","conversation",e],ii=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:bo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function li(e){return Go({queryKey:e?ai(e):["conversations",{}],queryFn:ii})}const si=async e=>{const t=e.queryKey,{id:n}=t[2],r={path:"/v6/conversations/{id}",pathParams:{id:n},accessToken:t[3].accessToken,environment:t[3].environment},a=await Jo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null};function ci(e){const t=Nn(e);return Wn({queryKey:oi({id:e??""}),queryFn:si,enabled:t})}const di=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:bo(n)};return await Lr(r)};function ui(){return ti({prefetchFn:Yo(oi,si)})}function hi(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function pi({header:e}){const t=hi(e.column);return I("div",{...jt(Bt["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:_(e.column.columnDef.header,e.getContext())})}const gi=jt(Bt["dashboard-table-header"],Rt({display:"flex",flexDirection:"row",alignItems:"center"}));function mi({headerGroups:e}){return I("div",{children:e.map(e=>k("div",{...gi,key:e.id},e.headers.map(e=>I(pi,{header:e},e.id))))})}const vi=jt(Bt["dashboard-table-body"],Rt({display:"flex",flexDirection:"column"}));function Ci({children:e}){return I("div",{...vi,children:e})}function bi({cell:e,onCellClick:t}){const n=hi(e.column),r=jt(Bt["dashboard-table-cell"],Rt({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),a=jt(null,Rt({display:"flex",flexDirection:"row",height:"100%"}));return I("div",{...a,style:n,onClick:()=>{t&&t(e)},children:I("div",{style:n,...r,children:_(e.column.columnDef.cell,e.getContext())})})}const fi=jt(Bt["table-sub-row"],Rt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function yi({rowData:e,onCellClick:t}){const n=e.getVisibleCells();return I("div",{...fi,children:n.map(e=>I(bi,{cell:e,onCellClick:t,isChild:!0},e.id))})}const xi=Rt({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content",_hover:{backgroundColor:"brand.action.opaque"}}),ki=Rt({background:"surface.background"}),Ti=jt(Bt["table-row"],Rt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{base:"85px",xl:"60px"},minWidth:"fit-content"}));function wi({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:a}){const o=e.getIsExpanded(),i=jt(Bt["table-parent-row"],xi,e.index%2==0?ki:void 0),l=e.getVisibleCells();return N("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[I("div",{...Ti,children:l.map(e=>I(bi,{cell:e,onCellClick:r},e.id))}),o&&I("div",{children:e.subRows.map(e=>I(yi,{rowData:e,onCellClick:r,shouldDisplayDivider:a},e.id))})]})}const Ei=(e,t={})=>{ze.getState().openDrawer(e,t)},Ai=()=>{ze.getState().requestCloseDrawer()};function Ii({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=An(e,n,r);return Bn.fetchQuery({queryKey:a,queryFn:t})}function Si({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=An(e,n,r);return Bn.prefetchQuery({queryKey:a,queryFn:t})}const Ni=[{name:"One-Time Expense",value:"ONE_TIME"},{name:"Weekly Recurring Expense",value:"WEEKLY"},{name:"Monthly Recurring Expense",value:"MONTHLY"},{name:"Yearly Recurring Expense",value:"YEARLY"}],Pi={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},Ri={ASC:"ASC",DESC:"DESC"},Mi=e=>["banks/transactions",e??{}],Di=e=>["banks/transactions",e.id],Li=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:bo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Oi(e){return Go({queryKey:Mi(e),queryFn:Li})}const Fi=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await Jo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Bi({id:e}){return Wn({queryKey:Di({id:e}),queryFn:Fi})}function Ui(){return ti({prefetchFn:Yo(Di,Fi)})}const Vi={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function Wi(e,t){return!Rn(e)&&e.startsWith(t)}function Hi({id:e,prefix:t}){return void 0!==e?`${Vi[t]}_${e}`:""}function qi(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const ji=e=>["conversations/messages",e];function zi(e){if(Sn(e)||0===e.length)return null;const t=[[e[0]]];for(let n=1;n<e.length;n++){const r=e[n],a=t[t.length-1],o=a[0].author.userId;r.author.userId===o?a.push(r):t.push([r])}return t}const Ki=async e=>{const t=e.queryKey,{id:n}=t[1],r={path:"/v6/conversations/{id}/messages",pathParams:{id:n},accessToken:t[2].accessToken,environment:t[2].environment},a=await Jo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null},Yi=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:bo(n),accessToken:t};return await Lr(r)};function _i(){return ti({prefetchFn:Yo(ji,Ki)})}const Zi=e=>["summaries",e??{}],Gi=e=>["summaries",e.id],Qi=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:bo(t[2].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const Xi=async e=>{const t=e.queryKey,n={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await Jo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Ji({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=ui(),{startPrefetch:a,cancelPrefetch:o}=_i(),{startPrefetch:i,cancelPrefetch:l}=Ui(),{startPrefetch:s,cancelPrefetch:c}=ti({prefetchFn:Yo(Gi,Xi)}),d=y(()=>{Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Vi.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Vi.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),a({id:e.original.id}),n({id:e.original.id})},[e.original.attachedEntityId,e.original.id,a,n,i,s]),u=y(()=>{Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Vi.BANK_TRANSACTION)?l():Nn(e.original.attachedEntityId)&&Wi(e.original.attachedEntityId,Vi.FINANCIAL_SUMMARY)&&c(),o(),r()},[l,c,r,o,e.original.attachedEntityId]);return I(wi,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?Ei("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):Nn(t)?Wi(t,Vi.BANK_TRANSACTION)?Ei("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Wi(t,Vi.FINANCIAL_SUMMARY)&&(r=e,a=t,Ei("FinancialSummary",{routeProps:{conversationId:r,summaryId:a}})):function(e){Ei("Conversation",{routeProps:{conversationId:e}})}(e);var r,a})(e.original.id,e.original.attachedEntityId,t)})}const $i=Io(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),el=Rt({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:.6}}),tl=Rt({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discrete",_supportHover:{_notDisabled:{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"}}),nl=Rt({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),rl=Rt({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),al=Rt.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discrete",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),ol=Ot({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%",height:"100%"}}}}),il={default:nl,small:rl},ll=e=>{const t=il[e];return jt(Bt["button-base"],t,el,Po)},sl=["default","small"],cl={default:{className:""},small:{className:""}};for(const eN of sl)cl[eN]=ll(eN);const dl=T(function({children:e,stylists:t=[],type:n="button",onClick:r,disabled:a,size:o="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=Zt([cl[o],jt(null,ol({width:i})),...t]);return I("button",{ref:u,...h,type:n,onClick:r,disabled:a,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),ul=jt(Bt["button-primary"],tl),hl=T(function({children:e,active:t,stylists:n=[],width:r,...a},o){return I(dl,{ref:o,stylists:[ul,...n],active:t,width:r,...a,children:e})}),pl=()=>{Ei("Conversation",{routeProps:{conversationId:null}})};function gl(){return I("div",{className:Rt({width:{xl:"auto",base:"44px"},height:{xl:"auto",base:"44px"}}),children:I(hl,{onClick:pl,width:"fill-parent",children:I(Lo,{Component:$i})})})}const ml=Ot({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"16px",border:{base:"none",xl:"{borderWidths.lg} solid {colors.border.layout}"},borderRadius:{base:"zero",xl:"lg"}}}}});function vl({children:e,dashboard:t}){const n=jt(Bt["dashboard-table"],ml({dashboard:t}));return I("div",{...n,children:e})}const Cl=v(null),bl="mobile",fl=Ot({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"},flexEnd:{alignItems:"flex-end"}}},defaultVariants:{alignVariant:"flexStart"}});function yl({children:e,alignVariant:t="flexStart"}){const n=jt(null,fl({alignVariant:t}));return I("div",{...n,children:e})}const xl=Ot({base:{fontWeight:"label",fontSize:"lg",fontFamily:"label",lineHeight:"18px",letterSpacing:"0.84px",maxWidth:"100%",xl:{lineHeight:"16px",fontSize:"label"}},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:ta,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function kl({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left",extraClassNames:a=[]}){const o=jt(Bt.label,Rt(xl.raw({intent:t,wrap:n,alignment:r}),a));return Rn(e)?null:I("div",{title:"ellipsis"===n?e:void 0,...o,children:e})}const Tl={"sm-sm":jt(Bt.text,Rt({fontSize:{xl:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"sm-med":jt(Bt.text,Rt({fontSize:{xl:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"sm-lg":jt(Bt.text,Rt({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"med-sm":jt(Bt.text,Rt({fontSize:{xl:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"med-med":jt(Bt.text,Rt({fontSize:{xl:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea),"med-lg":jt(Bt.text,Rt({fontSize:{xl:"md",base:"lg"},fontWeight:{base:"md",xl:"lg"},color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),ea)};function wl({children:e,size:t,weight:n,stylists:r=[]}){const a=Zt([Tl[`${t}-${n}`],...r]);return I("div",{title:e,...a,children:e})}const El=jt(Bt["emphasis-label"],Rt({lineHeight:"16px"}));function Al({children:e}){return I(wl,{size:"med",weight:"lg",stylists:[El],children:e})}function Il({text:e,isRead:t}){return I(t?kl:Al,{children:e})}function Sl({date:e,isRead:t=!1}){const n=Tn(e);return I(Il,{text:n,isRead:t})}const Nl=jt(Bt["strong-sub-label"],Gt({label:"strongSubLabel"}));function Pl({children:e,stylists:t=[]}){return Rn(e)?null:I(wl,{size:"sm",weight:"med",stylists:[Nl,...t],children:e})}const Rl=v(null),Ml=Rt({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),Dl=Rt({display:"flex",alignItems:"center",gap:"9px",cursor:"pointer",borderRadius:"zero",width:"100%",padding:{sm:"10px",base:"16px"},border:"none",backgroundColor:"surface.foreground",minWidth:{base:"100%"},boxShadow:{sm:"none"},minHeight:{sm:"35px"},height:{sm:"fit-content"},flexShrink:{sm:0},textAlign:{sm:"start"},"&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}),Ll=jt(Bt["selector-row"],Dl);function Ol(e,t,n){const[r,a]=f(e);return[t??r,n??a]}function Fl({children:e}){return null===ce()?I(de,{children:e}):e}function Bl({children:e,modal:t=!1,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:n=0,modal:r,open:a,onOpenChange:o,enableClickMiddleware:i=!0}={}){const[l,s]=f(),[c,d]=f(),[u,h]=Ol(e,a,o),p=J(),g=$({placement:t,open:u,nodeId:p,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||h(e)},whileElementsMounted:ae,middleware:[ee(n),te({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),ne({padding:8}),re({apply({availableHeight:e,elements:t}){let n=e;if(e<314){const t=37*Math.floor(e/37)-18.5;n=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${n}px`,overflowY:"auto"})},padding:8})]}),v=g.context,C=oe(v,{enabled:i}),b=ie(v,{bubbles:{escapeKey:!0}}),x=le(v),k=se([C,b,x]),T=y(()=>h(!1),[h]);return m(()=>({open:u,setOpen:h,close:T,...k,...g,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,T,k,g,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,enableClickMiddleware:s}),d=ce(),u=l&&null===d,h=c.nodeId;return I(Fl,{children:I(ue,{id:h,children:I(Rl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function Ul(){const e=C(Rl);if(Sn(e))throw new Error("Popup components must be wrapped in <PopupManager />");return e}function Vl({children:e}){const t=Ul(),n=t.refs.setReference,r=t.open?"open":"closed",a={...t.getReferenceProps(),ref:n,"data-state":r};return I(S,{children:e(a)})}const Wl=Io(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),p.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Hl({Component:e,stylists:t}){return I(e,{stylists:[jt(Bt["tiny-icon"],Bt.icon),...t??[]],size:9})}const ql=Io(e=>p.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),jl=jt(null,Rt({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{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(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Po),zl=jt(null,Rt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Kl=jt(null,Rt({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"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),Yl=jt(null,Rt({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function _l({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const a=n||"open"===r?.["data-state"];return N("div",{...jl,"data-active":a,children:[N("button",{...zl,...r,children:[I(Pl,{children:t}),!a&&I("div",{...Yl,children:I(Hl,{Component:ql})})]}),a&&I("button",{...Kl,onClick:e,children:I(Hl,{Component:Wl})})]})}const Zl=Ot({base:{borderColor:"border.layout",background:"surface.foreground",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"}}}});function Gl({initialFocus:e=!0,style:t,ref:n,type:r,forceMount:a,...o}){const{context:i,blockInteraction:l,...s}=Ul(),c=he([s.refs.setFloating,n]),d=jt(Bt.popup,Zl({type:r}));return a||i.open?N(S,{children:[l&&I(pe,{lockScroll:!0}),I(ge,{children:I(me,{context:i,modal:s.modal,initialFocus:e?void 0:-1,children:I("div",{ref:c,...d,style:{...s.floatingStyles,...t},...s.getFloatingProps(o),"aria-labelledby":s.labelId,"aria-describedby":s.descriptionId,children:o.children})})})]}):null}const Ql=jt(Bt["popup-sort-row"],Rt({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function Xl({onClick:e,children:t,active:n}){return I("button",{onClick:e,...Ql,children:I(ya,{accent:n?"active":"action",children:t})})}const Jl=jt(null,Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),$l=jt(null,Rt({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function es({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:a}){const o=Ul(),i=e=>{r(e),o.close()},l=a?.orderBy===e&&"ASC"===a?.direction,s=a?.orderBy===e&&"DESC"===a?.direction;return N("div",{...Jl,children:[I(Pl,{stylists:[$l],children:"Sort by:"}),I(Xl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),I(Xl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const ts=Rt.raw(al,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function ns({extraClassNames:e,children:t,active:n,disabled:r,onClick:a,popupTriggerProps:o,ariaLabel:i,ariaExpanded:l}){const[s,c]=f(!1),d=jt(Bt["button-discrete-small"],Rt(ts,e),Po),u=n??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(o?.["data-state"]);return I("button",{type:"button",...d,onClick:e=>{void 0===u&&c(!s),a&&a(e)},"data-active":u??s,disabled:r,...o,"aria-label":i,"aria-expanded":l,children:t})}const rs={minWidth:"140px"};function as({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const a=C(Cl);if(!a)return null;const{sortInstance:o,setSortInstance:i}=a,l=o?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(_l,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),I(Gl,{style:rs,children:I(es,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:o})})]}):I(ns,{disabled:!0,children:I(Pl,{children:e})})}const os=Ot({base:{display:"flex",width:"100%"},variants:{align:{left:{justifyContent:"flex-start"},center:{justifyContent:"center"},right:{justifyContent:"flex-end"}},padding:{none:{},default:{},large:{}}},compoundVariants:[{align:"left",padding:"none",css:{paddingLeft:"0"}},{align:"left",padding:"default",css:{paddingLeft:"19px"}},{align:"left",padding:"large",css:{paddingLeft:"33px"}},{align:"right",padding:"none",css:{paddingRight:"0"}},{align:"right",padding:"default",css:{paddingRight:"19px"}},{align:"right",padding:"large",css:{paddingRight:"33px"}}],defaultVariants:{align:"left",padding:"default"}});function is({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r,align:a="left",padding:o="default"}){return I("div",{className:os({align:a,padding:o}),children:I(as,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const ls="Oldest to Newest",ss="Newest to Oldest";function cs({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=C(Eo);let a="";return e===r?a="Me":"OWNER"===n?a="Bookkeeper":"ACCOUNTANT"===n&&(a="User"),I(Il,{text:a,isRead:t})}const ds=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.94389 13.9144L13.4056 8.12309C14.1306 7.18143 14.4519 5.9904 14.299 4.81186C14.1461 3.63332 13.5313 2.56376 12.59 1.83834C12.1329 1.45727 11.602 1.17479 11.0306 1.00865C10.4592 0.842499 9.85956 0.796265 9.26942 0.872849C8.67928 0.949432 8.11133 1.14718 7.60124 1.45368C7.09115 1.76017 6.64993 2.16881 6.30526 2.65392L1.26787 9.15798C-0.0274639 10.7069 0.993722 12.5848 2.14513 13.4895C2.76204 13.9899 3.55149 14.2266 4.34198 14.1484C5.13247 14.0701 5.86015 13.6831 6.36694 13.0714L11.3769 6.56732C11.531 6.3676 11.6442 6.13944 11.7101 5.89592C11.7759 5.6524 11.7931 5.39829 11.7606 5.14812C11.7282 4.89795 11.6467 4.65664 11.5209 4.43799C11.395 4.21934 11.2274 4.02764 11.0274 3.87386C10.6233 3.56441 10.1132 3.42748 9.60854 3.49297C9.10385 3.55846 8.6456 3.82107 8.33392 4.22339L4.10525 9.70627",strokeMiterlimit:10})),"Attachment"),us=jt(Bt.text,Rt({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),ea);function hs({children:e,stylists:t=[]}){const n=Zt([us,...t]);return I("div",{...n,children:e})}const ps=Ot({base:{display:"flex",gap:8,border:"none",borderBottom:"1px solid",borderBottomColor:"border.layout.weak",borderRadius:0,padding:0,width:"100%",height:"100%",cursor:"pointer",alignItems:"stretch"},variants:{isRead:{true:{backgroundColor:"transparent"},false:{backgroundColor:"surface.background"}}}}),gs=Dt(Rt({display:"flex",flex:1,flexDirection:"column",alignItems:"start",justifyContent:"center",gap:"8px",maxWidth:"100%",paddingTop:"16px",paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"}),ea),ms=Rt({display:"flex",flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between",width:"100%"}),vs=Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end"}),Cs=Rt({display:"flex",alignItems:"center",gap:8}),bs=Rt({display:"flex",alignItems:"center",gap:"4px"}),fs=Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:4}),ys=Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4}),xs=Rt({backgroundColor:"typography.base",borderRadius:9999,maxHeight:8,minHeight:8,maxWidth:8,minWidth:8});function ks({sender:e,subject:t,date:n,message:r,isRead:a,handleFormOpen:o}){return I("button",{className:ps({isRead:a}),onTouchEnd:o,children:N("div",{className:gs,children:[N("div",{className:fs,children:[!a&&I("div",{className:xs}),I(Il,{text:t,isRead:a})]}),N("div",{className:ms,children:[I("div",{className:ys,children:I(cs,{authorUserId:e,isRead:a})}),N("div",{className:Cs,children:[I("div",{className:vs,children:I(Sl,{date:n,isRead:a})}),a?I(Lo,{Component:No}):I(hs,{children:I(Lo,{Component:No})})]})]}),Rn(r)?N("div",{className:bs,children:[I(Lo,{Component:ds}),I(kl,{children:"Shared a file"})]}):I(kl,{children:r})]})})}const Ts=Rt({display:"flex",alignItems:"center",flexDirection:"row",gap:"4px"}),ws=Rt({backgroundColor:"typography.base",borderRadius:9999,maxHeight:8,minHeight:8,maxWidth:8,minWidth:8});function Es({text:e,isRead:t}){return t?I(kl,{children:e}):N("div",{className:Ts,children:[!t&&I("div",{className:ws}),I(Al,{children:e})]})}const As=Z(),Is=jt(null,Rt({paddingLeft:"25px"})),Ss=[As.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>I(yl,{children:I(cs,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>I(Pl,{stylists:[Is],children:"From"}),size:160,maxSize:160}),As.accessor("subject",{id:"subject",cell:({row:e})=>N(yl,{children:[I(Es,{text:e.original.subject,isRead:"READ"===e.original.readStatus}),I(kl,{children:e.original.latestMessage.text})]}),header:()=>I(Pl,{stylists:[Is],children:"Subject"}),size:200}),As.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>I(yl,{children:I(Sl,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>I(is,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:ss,sortAscDisplay:ls}),size:130,maxSize:130}),As.display({id:bl,cell:({row:e})=>I(ks,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function Ns(e){return e?Ss.filter(e=>e.id===bl):Ss.filter(e=>e.id!==bl)}const Ps=[],Rs=Rt({display:"flex",flexDirection:"column",height:"250px",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),Ms=jt(Bt["empty-dashboard-layout"],Rs);function Ds({children:e}){return I("div",{...Ms,"data-testid":"empty-dashboard-layout",children:e})}function Ls({Component:e,stylists:t}){return I(e,{stylists:[jt(Bt["large-icon"],Bt.icon),...t??[]],size:25})}const Os=e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),Fs=Io(Os,"MessageIcon",{partnerIcons:{GMoney:e=>p.createElement("svg",{width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_30391_65390)"},p.createElement("path",{d:"M3.05566 7.95672V28.5523H33.1459V7.65576L3.05566 7.95672Z",fill:"white"}),p.createElement("path",{d:"M14.5828 7.72704C12.792 7.74216 11.0192 8.08627 9.35277 8.74223C8.08109 9.31148 6.93657 10.1301 5.987 11.1497C5.03743 12.1693 4.30211 13.369 3.82461 14.6779C2.65173 17.8092 2.86773 21.096 2.87997 24.3943C2.88501 25.5535 2.33421 27.972 3.78213 28.4263C4.67493 28.7071 19.5292 28.4177 22.1544 28.3745C23.9443 28.345 26.3016 28.0937 27.5241 26.55C28.1833 25.6468 28.6651 24.6268 28.944 23.544C30.1999 19.6678 29.9387 15.4595 28.2132 11.7684C26.6148 8.14751 24.0156 7.71695 20.4213 7.76663C18.504 7.79327 16.5304 7.65576 14.5828 7.72704Z",fill:"#B8E4E5"}),p.createElement("path",{d:"M33.8463 26.4773C33.6922 26.1713 33.7822 26.1295 33.6922 25.8437C33.7404 25.7436 33.8456 25.6687 33.8088 25.5327C33.7894 25.2382 33.6382 24.9466 33.649 24.6543C33.6792 24.1906 33.734 24.2683 33.6936 23.9494C33.8268 23.6247 33.8636 23.2684 33.7995 22.9234C33.546 22.4021 33.8074 21.7944 33.6879 21.2422C33.6123 21.1479 33.5252 21.0593 33.6332 20.9499C33.6937 20.6608 33.7303 20.3672 33.7426 20.0722C33.7289 19.8281 33.834 19.7683 33.8024 19.4875C33.7873 19.1456 33.8023 18.803 33.847 18.4637C33.7777 18.1529 33.7752 17.8309 33.8398 17.5191C33.6864 17.2138 33.7757 17.172 33.6857 16.8862C33.734 16.7854 33.8405 16.7119 33.8031 16.5751C33.7836 16.2799 33.6324 15.9891 33.6432 15.6967C33.6735 15.2331 33.7282 15.3108 33.6879 14.9919C33.6965 14.8839 33.7822 14.796 33.8081 14.6909C33.8463 14.3752 33.8116 14.055 33.7066 13.7549C33.6346 13.3481 33.7361 12.8556 33.7066 12.4359C33.7476 12.2551 33.4676 12.1565 33.6288 11.9959C33.7678 11.6035 33.654 11.1262 33.811 10.7287C33.7642 10.4991 33.8564 10.2579 33.7908 10.0246C33.8398 9.68319 33.8347 9.33622 33.7757 8.99642C33.8208 8.87705 33.84 8.74946 33.8321 8.6221C33.8241 8.49475 33.7892 8.37054 33.7296 8.2577C33.7606 8.06685 33.7274 7.87112 33.6353 7.70114C33.6495 7.60841 33.634 7.51358 33.5911 7.43017C33.5482 7.34677 33.48 7.27907 33.3963 7.23674C33.0363 7.02866 32.5676 7.27994 32.1852 7.27634C32.0378 7.30164 31.8884 7.31297 31.7388 7.31018C31.6899 7.32818 31.6388 7.3433 31.5876 7.3577C31.5106 7.33466 31.4321 7.31306 31.3565 7.2857C31.2055 7.29373 31.0542 7.2906 30.9036 7.27634C30.6692 7.23054 30.4297 7.21626 30.1916 7.23386C29.8645 7.10211 29.5068 7.06542 29.1598 7.12802C28.6342 7.3829 28.02 7.12226 27.462 7.24322C27.367 7.31522 27.277 7.40594 27.1668 7.29866C26.8746 7.23875 26.5779 7.20287 26.2798 7.19138C26.0364 7.20506 25.9695 7.09994 25.6901 7.13306C25.3447 7.14806 24.9985 7.13385 24.6555 7.09058C24.3414 7.15895 24.0165 7.16116 23.7015 7.09706C23.3976 7.24898 23.348 7.1633 23.0628 7.25258C22.9606 7.20434 22.8857 7.0985 22.7482 7.13594C22.4501 7.1561 22.1564 7.30802 21.8604 7.29722C21.6263 7.25143 21.387 7.23714 21.1491 7.25474C20.8202 7.12275 20.4607 7.0868 20.1123 7.15106C19.586 7.40594 18.9725 7.1453 18.4145 7.26626C18.3195 7.33826 18.2295 7.4297 18.1193 7.32098C17.827 7.26175 17.5303 7.22612 17.2323 7.21442C16.9875 7.2281 16.9241 7.1237 16.6419 7.1561C16.2966 7.17194 15.9507 7.15749 15.608 7.1129C15.294 7.18223 14.9689 7.18469 14.654 7.1201C14.3494 7.27274 14.3004 7.18562 14.0146 7.27562C13.9124 7.2281 13.8382 7.12082 13.7 7.15898C13.4072 7.22756 13.1111 7.28139 12.8129 7.32026C12.5787 7.27447 12.3395 7.26018 12.1016 7.27778C11.7727 7.14579 11.4132 7.10984 11.0648 7.1741C10.5377 7.42826 9.92427 7.16834 9.36699 7.2893C9.27195 7.3613 9.18195 7.45202 9.07179 7.34402C8.77921 7.28475 8.48233 7.24911 8.18403 7.23746C7.94067 7.25114 7.87299 7.14602 7.59435 7.17914C7.24937 7.19115 6.90398 7.17405 6.56187 7.12802C6.24777 7.19639 5.92287 7.1986 5.60787 7.1345C5.30403 7.28642 5.25435 7.20002 4.96923 7.29002C4.86699 7.24178 4.79283 7.13522 4.65459 7.17338C4.35651 7.19354 4.06275 7.34474 3.76755 7.33466C3.61868 7.35986 3.46781 7.37143 3.31683 7.36922C3.08715 7.45634 2.82147 7.47074 2.68971 7.70186C2.67738 7.73802 2.67106 7.77597 2.67099 7.81418C2.57378 7.97348 2.50256 8.14726 2.46003 8.32898C2.46856 8.47853 2.46519 8.62852 2.44995 8.77754C2.41971 9.2405 2.36499 9.16346 2.40603 9.4817C2.27228 9.80777 2.23529 10.1655 2.29947 10.512C2.55291 11.0333 2.29155 11.641 2.41107 12.1932C2.48307 12.2875 2.57379 12.3768 2.46579 12.4855C2.40668 12.7751 2.37009 13.0687 2.35635 13.3639C2.37075 13.608 2.26491 13.6649 2.29659 13.9479C2.31235 14.2898 2.29741 14.6324 2.25195 14.9717C2.32021 15.2812 2.32193 15.6018 2.25699 15.912C2.40963 16.2173 2.32107 16.2591 2.41035 16.5449C2.36283 16.6457 2.25627 16.7191 2.29371 16.8559C2.31315 17.1511 2.46363 17.442 2.45283 17.7351C2.42259 18.198 2.36787 18.121 2.40891 18.4392C2.2763 18.7643 2.23982 19.1207 2.30379 19.4659C2.55795 19.9872 2.29587 20.5942 2.41539 21.1464C2.48739 21.2407 2.57811 21.33 2.47011 21.4387C2.40921 21.7291 2.37118 22.0237 2.35635 22.32C2.37075 22.5641 2.26491 22.621 2.29659 22.9039C2.31233 23.2461 2.29739 23.589 2.25195 23.9285C2.32091 24.2392 2.32263 24.561 2.25699 24.8724C2.40963 25.1777 2.32035 25.2195 2.41035 25.5053C2.36283 25.6061 2.25627 25.6795 2.29371 25.8171C2.31315 26.1115 2.46363 26.4031 2.45283 26.6955C2.42115 27.1627 2.36787 27.0886 2.40891 27.4003C2.37939 27.5602 2.23755 27.6977 2.28219 27.8777C2.28219 28.2931 2.31603 28.9023 2.85819 28.9289C3.42693 28.9921 4.00021 29.0039 4.57107 28.9642C4.66539 28.8922 4.75467 28.8015 4.86339 28.9095C5.04483 29.0239 5.27883 28.9397 5.48619 28.9815C6.36387 29.1651 6.73611 29.0074 7.35027 29.1255C7.66104 29.0571 7.98281 29.0556 8.29419 29.1211C8.59731 28.9692 8.64339 29.0563 8.92707 28.9671C9.02787 29.0153 9.10131 29.1219 9.23883 29.0844C9.53331 29.065 9.82491 28.9138 10.1172 28.9246C10.5816 28.9548 10.5024 29.0095 10.8221 28.9685C11.1468 29.1016 11.503 29.1384 11.8481 29.0743C12.3694 28.8209 12.9771 29.0823 13.5293 28.9627C13.6236 28.8907 13.7122 28.8007 13.8216 28.9087C14.1108 28.9686 14.4043 29.005 14.6993 29.0175C14.9427 29.0038 15.0032 29.1096 15.284 29.0772C15.6259 29.0622 15.9685 29.0771 16.3078 29.1219C16.6189 29.0542 16.9407 29.0527 17.2524 29.1175C17.5548 28.9656 17.6024 29.0527 17.8853 28.9635C17.9861 29.011 18.0596 29.1183 18.1964 29.0808C18.4908 29.0614 18.7824 28.9102 19.0748 28.921C19.5392 28.9512 19.46 29.0059 19.7796 28.9649C20.1044 29.098 20.4606 29.1348 20.8056 29.0707C21.3269 28.8173 21.9346 29.0787 22.4868 28.9591C22.5812 28.8871 22.6697 28.7971 22.7792 28.9051C23.0683 28.965 23.3618 29.0014 23.6568 29.0139C23.9009 29.0002 23.9607 29.106 24.2415 29.0736C24.5834 29.0593 24.9259 29.0742 25.2653 29.1183C25.5763 29.0499 25.8983 29.0484 26.21 29.1139C26.5152 28.9606 26.557 29.0499 26.8428 28.9599C26.9436 29.0074 27.0171 29.1147 27.1539 29.0772C27.4484 29.0578 27.74 28.9066 28.0323 28.9174C28.4974 28.9476 28.4196 29.0023 28.7372 28.9613C28.8444 28.9707 28.933 29.0556 29.0381 29.0823C29.3538 29.1201 29.6739 29.0854 29.9741 28.9807C30.3809 28.9123 30.8727 29.0095 31.2932 28.9807C31.4746 29.0218 31.5725 28.741 31.7331 28.903C32.0225 28.9629 32.3162 28.9993 32.6115 29.0117C32.9556 29.0016 33.2962 29.1341 33.5705 28.8101C33.9831 28.4991 33.708 27.8381 33.8513 27.4162C33.7827 27.1072 33.781 26.787 33.8463 26.4773ZM4.47027 8.22962C4.58435 8.16963 4.70865 8.13153 4.83675 8.1173C5.11414 8.18199 5.40145 8.19226 5.68275 8.14754C5.92862 8.23813 6.19124 8.27424 6.45243 8.25338C6.79659 8.2325 7.12707 8.3693 7.47195 8.22746C8.18115 8.24474 8.86515 8.2937 9.57723 8.30522C10.1 8.3729 10.591 8.21594 11.1087 8.27138C11.6784 8.29022 12.2488 8.27772 12.8172 8.23394C13.0426 8.13962 13.2708 8.30594 13.5185 8.20946C13.6321 8.14901 13.7563 8.11088 13.8843 8.09714C14.1617 8.16183 14.449 8.1721 14.7303 8.12738C14.9761 8.21797 15.2388 8.25409 15.5 8.23322C15.8441 8.21234 16.1746 8.34914 16.5195 8.2073C17.2287 8.22458 17.9134 8.27354 18.624 8.28578C19.1468 8.35274 19.6385 8.19578 20.1555 8.25122C20.7255 8.27007 21.2961 8.25758 21.8648 8.21378C22.0901 8.11946 22.3198 8.28578 22.5668 8.1893C22.6806 8.12944 22.8047 8.09135 22.9325 8.07698C23.2097 8.14168 23.4967 8.15195 23.7778 8.10722C24.024 8.19741 24.2867 8.23375 24.5482 8.21378C24.8924 8.19218 25.2221 8.32898 25.567 8.18714C26.2769 8.20442 26.9616 8.25338 27.6723 8.2649C28.1957 8.33258 28.6868 8.17562 29.2037 8.23106C29.7737 8.24991 30.3444 8.23742 30.913 8.19362C31.0695 8.14037 31.2298 8.09921 31.3925 8.0705C31.3976 8.0705 31.4026 8.07554 31.4091 8.0777C31.6695 8.0791 31.9295 8.09786 32.1874 8.13386C32.0542 8.24339 31.9107 8.33983 31.759 8.42186C31.6496 8.66234 31.358 8.72066 31.2334 8.97626C31.1864 9.10725 31.1169 9.22906 31.0282 9.33626C30.7674 9.50321 30.5384 9.71533 30.3521 9.96266C30.0961 10.0875 29.8677 10.2623 29.6804 10.4767C29.4291 10.7554 29.0756 10.9087 28.9092 11.2767C28.3469 11.8066 27.7817 12.2969 27.223 12.8326C26.7708 13.1839 26.4994 13.6735 26.0595 14.0299C25.6053 14.453 25.1727 14.8988 24.7635 15.3655C24.654 15.6067 24.3624 15.6651 24.2379 15.9199C24.1903 16.0507 24.1209 16.1724 24.0327 16.2799C23.7717 16.4466 23.5425 16.6585 23.3559 16.9056C23.0998 17.0307 22.8714 17.2057 22.6841 17.4204C22.4328 17.6983 22.0793 17.8524 21.913 18.2196C21.3514 18.7503 20.7855 19.2406 20.2268 19.7763C19.5068 20.4307 18.1258 21.9492 18.1121 21.9535C17.8978 21.8555 17.6991 21.7265 17.5224 21.5705C17.3519 21.312 17.1369 21.0858 16.8874 20.9023C16.7583 20.6486 16.5804 20.4227 16.364 20.2378C16.0824 19.9901 15.9212 19.6387 15.554 19.4767C15.0161 18.9223 14.5186 18.3636 13.975 17.8121C13.615 17.365 13.1247 17.0993 12.7625 16.6651C12.3332 16.2161 11.8817 15.7889 11.4096 15.385C11.167 15.2784 11.1051 14.9883 10.848 14.8666C10.7175 14.8208 10.5958 14.7531 10.488 14.6664C10.3169 14.408 10.1017 14.1816 9.85227 13.9975C9.7234 13.7438 9.54549 13.5182 9.32883 13.3337C9.04803 13.086 8.88603 12.7347 8.51955 12.5727C7.98171 12.0183 7.48347 11.4595 6.94059 10.908C6.58059 10.4609 6.08955 10.1952 5.72739 9.76106C5.29807 9.31203 4.84655 8.88478 4.37451 8.4809C4.2244 8.4054 4.08001 8.319 3.94251 8.22242C4.1163 8.25905 4.29555 8.2615 4.47027 8.22962ZM5.43435 27.4083C5.43435 27.4083 4.99587 27.9022 4.96347 27.9511C4.45947 27.9216 3.39603 28.0008 3.40899 27.9555C3.36507 27.5451 3.45651 27.0763 3.37155 26.6933C3.27723 26.4701 3.44355 26.244 3.34851 25.9992C3.28966 25.887 3.25184 25.765 3.23691 25.6392C3.30304 25.365 3.31405 25.0804 3.26931 24.8019C3.36062 24.5589 3.39749 24.2989 3.37731 24.0401C3.35643 23.6995 3.49467 23.3727 3.35283 23.0321C3.37227 22.3301 3.42483 21.6526 3.43563 20.9484C3.50763 20.4307 3.34851 19.944 3.40539 19.4321C3.4258 18.8679 3.41451 18.303 3.37155 17.7401C3.27723 17.5169 3.44355 17.2908 3.34851 17.046C3.28966 16.9338 3.25184 16.8118 3.23691 16.686C3.30378 16.409 3.31479 16.1214 3.26931 15.84C3.36068 15.5968 3.39755 15.3365 3.37731 15.0775C3.35643 14.7377 3.49467 14.4101 3.35283 14.0695C3.37227 13.3675 3.42483 12.69 3.43563 11.9859C3.50763 11.4682 3.34851 10.9815 3.40539 10.4695C3.39891 9.90866 3.35571 8.74154 3.37875 8.78762C3.50177 8.89706 3.61701 9.01495 3.72363 9.14042C3.87676 9.35034 4.05174 9.54343 4.24563 9.71642C4.41402 10.0609 4.66571 10.3578 4.97787 10.5804C5.57043 10.8058 5.85771 11.4559 6.37683 11.7965C6.50355 11.8145 6.63603 11.8239 6.64467 11.983C6.77211 12.2667 7.08315 12.4704 7.25811 12.7375C7.44459 12.9039 7.45971 13.0637 7.67571 13.2307C7.91691 13.5346 8.25675 13.7131 8.44827 14.0515C8.7386 14.246 8.99112 14.4917 9.19347 14.7766C9.50451 14.8853 9.53835 15.012 9.79899 15.1546C9.84435 15.2691 9.82995 15.4008 9.96099 15.4779C10.2065 15.6939 10.5413 15.8076 10.7631 16.0409C10.8999 16.213 11.0151 16.3217 11.131 16.4931C11.316 16.5823 11.3585 16.7652 11.4377 16.9337C11.6228 17.1202 11.8172 17.3088 12.018 17.4816C12.2091 17.5421 12.3797 17.6545 12.5105 17.8063C12.7085 18.0648 13.0584 18.3607 13.2845 18.5983C13.3695 18.7294 13.5351 18.6826 13.6352 18.7567C13.6748 18.8577 13.7278 18.9529 13.7928 19.0397C13.6985 19.1153 13.6071 19.1974 13.4948 19.2874C13.3964 19.4327 13.285 19.5689 13.1621 19.6942C13.0171 19.8465 12.8637 19.9907 12.7028 20.1262C12.612 20.3271 12.4198 20.3911 12.242 20.4862C11.6516 21.019 11.6199 21.3639 11.2901 21.6749C11.0093 21.8995 10.6767 22.2826 10.4103 22.5317C10.2663 22.6239 10.3052 22.7974 10.2202 22.9083C9.69963 23.1113 9.36123 23.6679 8.85219 23.9163C8.51948 24.2852 8.15336 24.6227 7.75851 24.9243C7.52389 25.2328 7.24316 25.5033 6.92619 25.7263C6.79665 25.9606 6.64293 26.1807 6.46755 26.383C6.34011 26.4319 6.20115 26.4211 6.10755 26.5579C5.86059 26.8186 5.70363 27.1721 5.43435 27.4083ZM28.028 28.0023C27.8062 28.0959 27.5794 27.9303 27.3339 28.0253C27.2218 28.0843 27.0997 28.1219 26.9739 28.1362C26.6997 28.0713 26.4155 28.0606 26.1372 28.1045C25.8942 28.0135 25.6342 27.9766 25.3755 27.9965C25.0349 28.0174 24.708 27.8791 24.3675 28.0203C23.6662 28.0008 22.988 27.9483 22.2845 27.9375C21.7668 27.8691 21.2801 28.0246 20.7675 27.9684C20.203 27.9484 19.6379 27.9597 19.0748 28.0023C18.8523 28.0959 18.6269 27.9303 18.3807 28.0253C18.2686 28.0843 18.1465 28.1219 18.0207 28.1362C17.7463 28.0714 17.4618 28.0606 17.1833 28.1045C16.9403 28.0134 16.6803 27.9766 16.4216 27.9965C16.081 28.0174 15.7541 27.8791 15.4136 28.0203C14.7116 28.0008 14.034 27.9483 13.3299 27.9375C12.8129 27.8691 12.3262 28.0246 11.8136 27.9684C11.2494 27.9484 10.6845 27.9597 10.1216 28.0023C9.89907 28.0959 9.67227 27.9303 9.42747 28.0253C9.31542 28.0843 9.19333 28.1219 9.06747 28.1362C8.79306 28.0714 8.50864 28.0606 8.23011 28.1045C7.98709 28.0134 7.72711 27.9766 7.46835 27.9965C7.34255 28.0219 7.21212 28.0106 7.09251 27.9641C6.84123 27.8863 6.59571 28.0361 6.34587 28.0181C6.27387 28.0181 6.20187 28.0123 6.12987 28.0102C6.28395 27.8122 6.54243 27.7222 6.68067 27.4817C6.74309 27.3412 6.82688 27.2113 6.92907 27.0965C7.22011 26.9117 7.47971 26.6815 7.69803 26.4147C7.98085 26.2729 8.23554 26.0809 8.44971 25.848C9.37563 24.9898 10.2634 24.0905 11.2116 23.2359C12.1563 22.3029 13.0487 21.3186 13.885 20.2875C13.885 20.2875 14.1269 19.8072 14.2608 19.5768C14.3816 19.701 14.484 19.8419 14.5647 19.9951C14.9075 20.2843 15.221 20.6065 15.5007 20.9571C15.7907 21.1519 16.0432 21.3975 16.2459 21.6821C16.5562 21.7901 16.5908 21.9175 16.8507 22.0601C16.8968 22.1746 16.8816 22.3071 17.0134 22.3834C17.2251 22.5072 17.7334 22.9867 18.1092 23.0314C18.4635 23.0544 18.7803 22.6908 19.0071 22.4453C19.2432 22.3653 19.4489 22.2145 19.596 22.0133C19.9056 21.829 19.9373 21.4416 20.2152 21.2343C20.5429 20.9641 20.8453 20.6648 21.1188 20.34C21.1383 20.214 21.1491 20.0815 21.3089 20.0751C21.5033 20.0225 21.6243 19.8346 21.7798 19.6999C21.9087 19.9037 22.0764 20.0909 22.2017 20.2896C22.3606 20.5731 22.5702 20.825 22.8202 21.0327C22.9626 21.096 23.0952 21.1794 23.214 21.2803C23.4057 21.571 23.6453 21.8271 23.9225 22.0378C24.0757 22.3171 24.2787 22.566 24.5216 22.7722C25.4201 23.6643 26.3691 24.5074 27.2676 25.4189C28.2425 26.2692 29.2116 27.1728 30.2067 27.9749C29.4805 27.943 28.7531 27.9521 28.028 28.0023ZM32.8318 17.5903C32.7417 17.8338 32.7053 18.0939 32.7252 18.3528C32.7454 18.6934 32.6079 19.0203 32.749 19.3608C32.7296 20.0628 32.677 20.7396 32.6662 21.4438C32.5942 21.9615 32.7526 22.4482 32.6964 22.9601C32.676 23.5245 32.6873 24.0897 32.7303 24.6528C32.8246 24.8753 32.6583 25.1021 32.7533 25.3469C32.8122 25.4591 32.85 25.5811 32.8649 25.7069C32.7996 25.9812 32.7885 26.2657 32.8325 26.5443C32.734 26.9938 32.6812 27.4521 32.6748 27.9123C32.8498 28.0433 32.654 28.0023 32.5596 27.9713C32.1765 27.9842 31.7929 27.9729 31.4112 27.9375C31.3558 27.8583 31.2989 27.7805 31.2507 27.6999C31.1078 27.585 30.9727 27.4609 30.846 27.3283C30.6819 27.1469 30.5472 27.0324 30.4061 26.851C30.2024 26.7581 30.1354 26.563 30.0339 26.3859C29.4845 25.7983 29.154 25.789 28.8099 25.4556C28.5737 25.1813 28.1748 24.8631 27.9128 24.6067C27.8141 24.4699 27.642 24.5124 27.5268 24.4325C27.2986 23.9206 26.7248 23.6074 26.4468 23.1106C26.0611 22.796 25.7065 22.4452 25.3877 22.063C25.0706 21.8422 24.7909 21.5721 24.559 21.2631C24.3261 21.1417 24.1072 20.9954 23.906 20.8267C23.8548 20.7007 23.8649 20.5625 23.7267 20.4747C23.4855 20.25 22.6985 19.6913 22.6164 19.5653C22.5411 19.4489 22.4455 19.3469 22.3342 19.2643C22.6702 18.9283 23.0216 18.6091 23.3883 18.3067C23.5868 18.0179 23.8361 17.7676 24.1241 17.568C24.2364 17.2591 24.3646 17.2267 24.51 16.9683C24.6245 16.9243 24.757 16.9409 24.8355 16.8099C25.0139 16.5362 25.2061 16.2719 25.4115 16.0179C25.623 15.8675 25.8178 15.695 25.9925 15.5031C26.3407 15.3406 26.6423 15.0929 26.8695 14.7831C27.102 14.1934 27.7558 13.9147 28.1036 13.4007C28.1237 13.2739 28.1345 13.1422 28.2944 13.135C28.5824 13.0119 28.7876 12.703 29.0568 12.5316C29.226 12.3466 29.383 12.3365 29.5551 12.1212C29.8632 11.8836 30.0454 11.5452 30.3867 11.3595C30.5854 11.0721 30.8345 10.8231 31.1218 10.6243C31.2341 10.3147 31.3616 10.2823 31.5077 10.0239C31.6222 9.97994 31.7547 9.9965 31.8332 9.86618C32.0114 9.59244 32.2036 9.32808 32.4092 9.07418C32.5075 8.9425 32.6164 8.81898 32.7346 8.70482C32.7584 8.65586 32.7864 8.60762 32.8152 8.56082C32.8288 8.61085 32.8319 8.66315 32.8243 8.71443C32.8168 8.76572 32.7987 8.81489 32.7713 8.8589C32.7138 9.09459 32.7042 9.33944 32.7432 9.5789C32.6725 9.88864 32.675 10.2106 32.7504 10.5192C32.6571 12.2441 32.6516 13.9727 32.7339 15.6982C32.8282 15.9207 32.6619 16.1467 32.7569 16.3923C32.8164 16.5042 32.8543 16.6263 32.8685 16.7523C32.8024 17.0266 32.7899 17.3112 32.8318 17.5903Z",fill:"black"})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_30391_65390"},p.createElement("rect",{width:36,height:36,fill:"white"}))))}}),Bs=()=>{Ei("Conversation",{routeProps:{conversationId:null}})};function Us(){return N(S,{children:[I(Ls,{Component:Fs}),I(ba,{wrap:"wrap",children:"Need help with your financials?"}),I(hl,{onClick:Bs,children:I(ba,{children:"Talk to a bookkeeper"})})]})}const Vs=e=>p.createElement("svg",{width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.17578 11.16L34.0958 3.8304C34.0958 3.8304 32.7926 22.968 30.5318 26.7336C27.5487 24.2014 24.728 21.484 22.0862 18.5976L18.9614 14.4L8.17578 11.16Z",fill:"white"}),p.createElement("path",{d:"M33.6785 4.0896C33.2969 3.708 14.4041 8.4672 13.8209 9.2304C13.2377 9.9936 12.2441 12.1104 14.4617 13.1112C15.8992 13.7347 17.412 14.168 18.9617 14.4C18.9617 14.4 17.8241 23.4144 17.9105 23.328C17.9969 23.2416 22.0865 18.5976 22.0865 18.5976C22.0865 18.5976 23.4257 20.3544 24.0089 20.4408C24.5921 20.5272 33.9125 6.1344 33.9665 5.2272C34.0205 4.32 33.6785 4.0896 33.6785 4.0896Z",fill:"#8BD2D4"}),p.createElement("path",{d:"M34.4628 4.5576C34.5174 4.49518 34.558 4.42168 34.5816 4.34215C34.6052 4.26262 34.6113 4.17893 34.5996 4.0968C34.5816 3.88179 34.479 3.68272 34.3143 3.54338C34.1495 3.40403 33.9362 3.33583 33.7212 3.35376C33.675 3.35746 33.6292 3.36517 33.5844 3.3768H32.9148C32.742 3.4704 32.5836 3.3768 32.4108 3.3768C32.1681 3.41348 31.9277 3.46396 31.6908 3.528C31.5474 3.64752 31.3722 3.72259 31.1868 3.744C30.8501 3.78866 30.5161 3.85115 30.186 3.9312C30.0348 3.9312 29.9988 4.0896 29.8908 4.1328C29.4516 4.0104 28.962 4.284 28.4508 4.2264C28.0561 4.35034 27.6514 4.43948 27.2412 4.4928C26.9541 4.63683 26.6404 4.72016 26.3196 4.7376C26.082 4.9464 25.9812 4.896 25.7436 5.0472C25.6284 5.0472 25.5348 4.9464 25.4052 5.0472C25.146 5.1336 24.9228 5.328 24.6852 5.4072C24.4887 5.45685 24.289 5.49293 24.0876 5.5152C24.0106 5.55429 23.9255 5.57466 23.8392 5.57466C23.7529 5.57466 23.6678 5.55429 23.5908 5.5152C23.418 5.4648 23.1228 5.6448 22.8708 5.7312C22.7426 5.86279 22.5764 5.95091 22.3956 5.9832C22.0645 6.05667 21.7376 6.148 21.4164 6.2568C21.2652 6.2568 21.2364 6.4296 21.1356 6.4728C20.6748 6.3792 20.2068 6.6888 19.7388 6.6528C19.3558 6.80704 18.9576 6.92047 18.5508 6.9912C18.2707 7.14814 17.9624 7.24845 17.6436 7.2864C17.3988 7.524 17.3268 7.452 17.082 7.6248C16.974 7.6248 16.866 7.5312 16.7508 7.6248C16.5476 7.72877 16.3505 7.84415 16.1604 7.9704C15.8545 8.02527 15.5553 8.11214 15.2676 8.2296H14.9436C14.6273 8.29513 14.3297 8.43042 14.0724 8.6256C13.7052 8.82 13.2084 8.8848 12.8196 9.0504C12.6324 9.0504 12.6252 9.3672 12.4236 9.2664C12.1292 9.30822 11.838 9.37078 11.5524 9.4536C11.322 9.5472 11.2284 9.4536 10.9764 9.5904C10.6541 9.71838 10.3218 9.81952 9.9828 9.8928C9.69989 10.0672 9.38342 10.18 9.054 10.224C8.73734 10.4146 8.41045 10.5877 8.0748 10.7424C7.85538 10.7481 7.6376 10.782 7.4268 10.8432C7.34852 11.0765 7.29778 11.3181 7.2756 11.5632C7.2756 11.6064 7.218 11.6496 7.2756 11.7C7.4916 11.7936 7.434 11.8872 7.6068 12.0312C8.15849 12.24 8.73871 12.3639 9.3276 12.3984C9.7956 12.4344 10.2924 12.7152 10.7676 12.744C10.8828 12.6936 10.9908 12.6288 11.07 12.744C11.1492 12.8592 11.466 12.8808 11.6604 12.9744C12.4524 13.3632 12.8772 13.3128 13.4388 13.572C13.7567 13.5877 14.0679 13.6686 14.3532 13.8096C14.5704 13.7771 14.7912 13.7771 15.0084 13.8096C15.0948 13.8816 15.138 14.004 15.282 14.004C15.5783 14.0156 15.8739 14.042 16.1676 14.0832C16.3349 14.14 16.4984 14.2073 16.6572 14.2848C16.8255 14.3033 16.9801 14.3858 17.0892 14.5152C17.3047 14.6191 17.5358 14.6872 17.7732 14.7168C17.9476 14.6775 18.1301 14.6978 18.2916 14.7744C18.5004 14.8896 18.4356 14.8824 18.4356 15.0768C18.4356 15.2712 18.5364 15.2928 18.5436 15.408C18.2916 15.768 18.3996 16.3008 18.1692 16.7472C18.1522 17.1485 18.0919 17.5469 17.9892 17.9352C18.0107 18.2546 17.9691 18.5751 17.8668 18.8784C17.9748 19.2024 17.8668 19.2312 17.9316 19.5264C17.874 19.62 17.7516 19.6776 17.7732 19.8216C17.8102 20.1177 17.8222 20.4163 17.8092 20.7144C17.7372 21.1498 17.6214 21.5767 17.4636 21.9888C17.3686 22.4167 17.3203 22.8537 17.3196 23.292C17.5572 23.364 17.5428 23.5512 17.6148 23.7384C17.6868 23.9256 18.09 23.8392 18.2556 23.6664C18.4212 23.4936 18.3924 23.2992 18.5508 23.3424C18.8964 23.1336 19.3572 22.3704 19.7604 22.0752C20.1636 21.78 20.286 21.3552 20.6532 21.0672C20.7987 20.7893 20.9996 20.5443 21.2436 20.3472C21.3156 20.016 21.4164 20.0304 21.5244 19.7568C21.6252 19.7064 21.7548 19.7136 21.8124 19.584C21.8528 19.5255 21.8867 19.4628 21.9132 19.3968C21.9132 19.3968 22.0356 19.2456 22.05 19.26C22.1485 19.5475 22.3318 19.7985 22.5756 19.98C22.6921 20.1501 22.8618 20.2767 23.058 20.34C23.3964 20.5848 23.67 21.0024 23.994 21.2832C24.0876 21.4416 24.3612 21.2832 24.3612 21.5424C24.3612 21.8016 24.75 21.996 24.9012 22.2624C25.1043 22.5663 25.3464 22.8422 25.6212 23.0832C25.7868 23.1984 25.83 23.3352 25.9524 23.4864C26.2233 23.6592 26.4521 23.8905 26.622 24.1632C26.946 24.2712 26.9172 24.3648 27.1764 24.5016C27.2196 24.6096 27.1764 24.7392 27.3132 24.8112C27.5631 24.9698 27.8035 25.1429 28.0332 25.3296C28.314 25.6536 28.2708 25.6824 28.5012 25.8624C28.5732 25.9488 28.5732 26.0712 28.6308 26.1648C28.8612 26.3808 29.0556 26.6688 29.3508 26.7624C29.7324 27.0072 30.3588 28.0872 30.7908 27.2736C30.9564 27.0936 30.7908 26.8056 30.978 26.64C31.1126 26.3183 31.228 25.9889 31.3236 25.6536C31.3668 25.416 31.4892 25.3728 31.518 25.092C31.5807 24.7512 31.6722 24.4164 31.7916 24.0912C31.7935 23.7717 31.8596 23.4558 31.986 23.1624C31.9464 22.9434 31.9464 22.719 31.986 22.5C32.058 22.4136 32.1732 22.3632 32.166 22.2192C32.2092 21.924 32.1228 21.6072 32.166 21.3192C32.2111 21.1457 32.2664 20.975 32.3316 20.808C32.3475 20.6402 32.4154 20.4816 32.526 20.3544C32.6061 20.1228 32.6474 19.8795 32.6484 19.6344C32.5944 19.456 32.5944 19.2656 32.6484 19.0872C32.7367 18.7602 32.8064 18.4285 32.8572 18.0936C32.9148 17.964 32.7852 17.8632 32.7852 17.748C33.066 17.3952 33.0156 16.8336 33.2532 16.416C33.2855 16.0032 33.3627 15.5952 33.4836 15.1992C33.4632 14.8787 33.5098 14.5575 33.6204 14.256C33.5124 13.932 33.6204 13.896 33.5628 13.6008C33.6276 13.5072 33.7428 13.4496 33.7212 13.3056C33.7212 13.0464 33.6636 12.7728 33.678 12.5136C33.7061 12.3007 33.7543 12.091 33.822 11.8872C33.7788 11.6928 33.9012 11.5704 33.9804 11.4192C34.0413 11.1844 34.0632 10.9411 34.0452 10.6992C33.9751 10.5282 33.9576 10.3402 33.9948 10.1592C34.0575 9.8238 34.0984 9.48469 34.1172 9.144C34.1676 9.0072 34.0236 8.9208 34.0164 8.8056C34.2684 8.4456 34.1676 7.884 34.3692 7.4304C34.3866 7.00303 34.4469 6.5785 34.5492 6.1632C34.5019 5.84419 34.5166 5.51905 34.5924 5.2056C34.4556 4.8888 34.5492 4.8456 34.4628 4.5576ZM16.4268 13.1976C16.182 13.1976 16.0092 13.0104 15.7428 13.032C15.6168 13.0572 15.4872 13.0572 15.3612 13.032C15.1118 12.8964 14.8374 12.8131 14.5548 12.7872C14.3388 12.6368 14.0934 12.5337 13.8348 12.4848C13.0428 12.1824 12.798 12.3192 12.114 12.0168C11.0844 11.7504 10.6236 11.5632 9.522 11.3544C9.522 11.3112 9.1116 11.304 9.1692 11.304C9.2268 11.304 9.45 11.1312 9.522 11.1096C9.9324 11.1456 10.242 10.9008 10.6452 10.8576C11.0719 10.6623 11.5153 10.5057 11.97 10.3896C12.732 10.1778 13.4799 9.91805 14.2092 9.612C14.9076 9.40785 15.5949 9.16752 16.2684 8.892C16.4556 8.7336 16.722 8.82 16.9308 8.6616C17.0316 8.5896 17.118 8.4744 17.2404 8.4384C17.5212 8.41727 17.7951 8.34145 18.0468 8.2152C18.3073 8.22319 18.5668 8.17913 18.81 8.0856C19.134 7.9632 19.4868 7.992 19.7748 7.7616C20.4516 7.5672 21.114 7.416 21.798 7.2288C22.3164 7.1424 22.734 6.8544 23.238 6.768C23.7886 6.63061 24.3317 6.46479 24.8652 6.2712C25.0524 6.12 25.3188 6.2208 25.5276 6.0624C25.7364 5.904 25.722 5.8824 25.8516 5.8608C26.1346 5.85081 26.4131 5.78729 26.6724 5.6736C26.9301 5.70242 27.1909 5.67289 27.4356 5.5872C27.7596 5.4792 28.1124 5.5368 28.4076 5.3136C29.1276 5.1696 29.7684 5.0616 30.4596 4.9176C30.9276 4.8312 31.4028 4.7088 31.8996 4.5936C31.3884 4.9824 30.8196 5.2632 30.3372 5.6664C29.0581 6.4774 27.8206 7.3521 26.6292 8.2872C26.4996 8.496 26.2116 8.496 26.0604 8.7192C25.9884 8.82 25.938 8.9568 25.8228 9.0216C25.5557 9.13127 25.3115 9.29001 25.1028 9.4896C24.841 9.55998 24.5962 9.68242 24.3828 9.8496C24.1092 10.0728 23.7564 10.152 23.5548 10.4688C22.9572 10.872 22.3596 11.2248 21.762 11.6352C21.2868 11.88 20.97 12.2976 20.5092 12.5568C20.0254 12.872 19.5591 13.2133 19.1124 13.5792C19.039 13.6928 18.9546 13.799 18.8604 13.896C18.7583 13.857 18.652 13.8305 18.5436 13.8168C17.8571 13.5445 17.149 13.3302 16.4268 13.176V13.1976ZM22.2372 17.2296C22.1652 17.5608 22.0644 17.5536 21.9492 17.8272C21.8484 17.8776 21.7188 17.8704 21.654 18C21.5851 18.1041 21.5272 18.2151 21.4812 18.3312C21.3161 18.4409 21.1861 18.5959 21.1068 18.7776C21.0783 18.9607 20.9803 19.1257 20.8332 19.2384C20.6892 19.4256 20.4876 19.548 20.4084 19.7712C20.1341 19.9398 19.9045 20.172 19.7388 20.448C19.3068 20.7432 19.1844 21.2904 18.774 21.6144C18.7164 21.6144 18.6516 21.6144 18.6372 21.564C18.6372 21.3552 18.8028 21.0888 18.7236 20.844C18.6444 20.5992 18.8604 20.412 18.8028 20.124C18.7598 20.0014 18.7379 19.8723 18.738 19.7424C18.8409 19.4786 18.8922 19.1975 18.8892 18.9144C19.0326 18.6233 19.1066 18.3029 19.1052 17.9784C19.2227 17.7191 19.2555 17.4294 19.1988 17.1504C19.2996 16.4304 19.4364 15.7608 19.494 15.0336C19.5171 14.8326 19.4975 14.6289 19.4364 14.436C19.509 14.3857 19.5861 14.3423 19.6668 14.3064C20.0196 14.0904 20.0556 14.1336 20.2788 13.9248C20.628 13.8405 20.947 13.661 21.2004 13.4064C21.4884 12.888 22.1508 12.744 22.5396 12.3192C22.5756 12.204 22.6044 12.0816 22.7556 12.1032C23.0338 11.9821 23.3011 11.8376 23.5548 11.6712C23.7492 11.52 23.8716 11.5632 24.0804 11.376C24.3337 11.1315 24.632 10.9383 24.9588 10.8072C25.182 10.5682 25.4515 10.3772 25.7508 10.2456C25.9092 9.9504 26.0028 9.9864 26.19 9.7488C26.2487 9.75673 26.3083 9.75251 26.3653 9.73641C26.4223 9.72031 26.4754 9.69267 26.5212 9.6552C26.6148 9.5616 26.9964 9.18 27.2412 8.9712C27.4351 8.88523 27.6167 8.77386 27.7812 8.64C28.0104 8.60799 28.2229 8.50178 28.386 8.3376C28.574 8.24993 28.7282 8.1033 28.8252 7.92C29.1276 7.6248 29.5956 7.416 29.934 7.1424C30.0708 7.0848 30.042 6.9192 30.1284 6.84C30.438 6.84 30.4668 6.7176 30.7116 6.5808C30.7692 6.624 30.9204 6.5808 30.9708 6.5304C30.8865 6.72585 30.7777 6.90974 30.6468 7.0776C30.5604 7.1568 30.5964 7.3224 30.5388 7.4232C30.1356 7.5888 29.9268 8.0568 29.5668 8.3016C29.2068 8.5464 29.0196 9.0216 28.6452 9.3168C28.5062 9.60719 28.3103 9.86672 28.0692 10.08C27.99 10.4112 27.8892 10.404 27.774 10.6776C27.6732 10.728 27.5436 10.7208 27.486 10.8504C27.3132 11.088 27.2412 11.3976 27.0612 11.6208C26.8693 11.7873 26.6978 11.9758 26.55 12.1824C26.2483 12.3516 25.9992 12.6007 25.83 12.9024C25.686 13.4784 25.11 13.788 24.8292 14.3064C24.8292 14.4288 24.8292 14.5512 24.678 14.5728C24.4188 14.7096 24.2604 15.0192 24.03 15.1992C23.8563 15.3045 23.7105 15.4503 23.6052 15.624C23.3388 15.876 23.2092 16.2072 22.8852 16.4088C22.7318 16.7204 22.5103 16.9935 22.2372 17.208V17.2296ZM33.4404 5.9904C33.4599 6.11745 33.4424 6.24744 33.39 6.3648C33.3432 6.60252 33.3432 6.84709 33.39 7.0848C33.174 8.7912 32.9868 10.5408 32.8428 12.2328C32.9076 12.4704 32.7132 12.672 32.778 12.9528C32.8218 13.075 32.8414 13.2047 32.8356 13.3344C32.7324 13.5956 32.6811 13.8744 32.6844 14.1552C32.5605 14.3769 32.4844 14.6222 32.4612 14.8752C32.4612 15.2136 32.238 15.516 32.3244 15.876C32.1948 16.596 32.022 17.2296 31.8924 17.9208C31.734 18.4176 31.7916 18.9288 31.6404 19.4184C31.4815 19.9653 31.3825 20.5278 31.3452 21.096C31.3956 21.3336 31.1868 21.5208 31.23 21.816C31.2638 21.9402 31.276 22.0693 31.266 22.1976C31.1438 22.4525 31.0729 22.729 31.0572 23.0112C30.9162 23.2285 30.8252 23.4744 30.7908 23.7312C30.7851 23.8593 30.7454 23.9836 30.6756 24.0912C30.5388 24.3216 30.6324 24.5952 30.5604 24.8112C30.4675 25.0996 30.3906 25.3928 30.33 25.6896C30.3212 25.8175 30.2706 25.9389 30.186 26.0352C30.1212 26.0784 30.186 26.136 30.0924 26.0352C29.6663 25.5431 29.2043 25.0835 28.71 24.66C28.4868 24.5664 28.4436 24.2856 28.206 24.1776C28.0822 24.141 27.9671 24.0797 27.8676 23.9976C27.7206 23.7558 27.5273 23.5454 27.2988 23.3784C27.1587 23.0928 26.9511 22.8457 26.694 22.6584C26.5966 22.4465 26.4355 22.2703 26.2332 22.1544C25.8876 21.9456 25.722 21.5424 25.4052 21.3192C24.6852 20.4336 23.8356 19.7136 23.0436 18.9C22.8616 18.7537 22.6994 18.5842 22.5612 18.396C22.7647 18.2354 22.9358 18.0375 23.0652 17.8128C23.2935 17.6759 23.4899 17.4918 23.6412 17.2728C23.8428 16.992 24.1668 16.8192 24.2748 16.4592C24.7428 15.912 25.2252 15.408 25.7148 14.8536C26.1036 14.4864 26.298 14.004 26.6724 13.6296C27.0484 13.1863 27.3993 12.7224 27.7236 12.24C27.7956 12.0024 28.0692 11.9232 28.1556 11.6712C28.1821 11.5437 28.2308 11.4218 28.2996 11.3112C28.5301 11.1377 28.7235 10.9198 28.8684 10.6704C29.0981 10.5354 29.2948 10.3509 29.4444 10.1304C29.5089 10.0159 29.6035 9.92133 29.718 9.8568C29.9412 9.7056 29.9844 9.4176 30.1572 9.2232C31.0247 8.32023 31.8283 7.3579 32.562 6.3432C32.8284 5.9616 33.2244 5.5728 33.5556 5.1696C33.5556 5.436 33.3972 5.7024 33.4404 5.9904Z",fill:"currentColor"}),p.createElement("path",{d:"M16.5496 26.1864C16.6 25.9632 16.7224 25.74 16.6 25.5168C16.5454 25.4481 16.4657 25.4039 16.3785 25.3939C16.2913 25.3839 16.2037 25.4089 16.1349 25.4635C16.1152 25.4792 16.0974 25.4971 16.0816 25.5168C16.0812 25.551 16.0697 25.5842 16.049 25.6114C16.0282 25.6386 15.9993 25.6584 15.9664 25.668C15.8491 25.8047 15.7216 25.9323 15.5848 26.0496C15.5488 26.2728 15.2968 26.352 15.2392 26.5824C15.224 26.7018 15.1848 26.8169 15.124 26.9208C14.9252 27.0842 14.7569 27.2817 14.6272 27.504C14.4229 27.6269 14.2444 27.7883 14.1016 27.9792C13.9144 28.224 13.6192 28.3608 13.5112 28.6992C13.0574 29.1393 12.5765 29.5505 12.0712 29.9304C11.7308 30.2204 11.3751 30.492 11.0056 30.744C10.7032 30.8736 10.444 31.104 10.1344 31.2264C9.97771 31.2437 9.831 31.312 9.71684 31.4208C9.55844 31.5576 9.33524 31.4208 9.15524 31.5936C9.08039 31.6743 8.98224 31.7297 8.87444 31.752C8.63535 31.7225 8.39353 31.7225 8.15444 31.752C7.88084 31.5792 7.52804 31.6296 7.26884 31.4424C6.85107 31.3392 6.46623 31.1319 6.15022 30.8398C5.8342 30.5477 5.59731 30.1804 5.46164 29.772C5.19428 29.3405 5.06144 28.8392 5.08004 28.332L5.37524 28.44C5.55344 28.476 5.73704 28.476 5.91524 28.44C6.05686 28.4989 6.20829 28.5306 6.36164 28.5336C6.58484 28.4256 6.79364 28.44 7.00964 28.3536C7.12484 28.3968 7.21844 28.4832 7.36244 28.4184C7.66525 28.2903 7.95266 28.1285 8.21924 27.936C8.47403 27.8352 8.6976 27.6688 8.86724 27.4536C8.98989 27.3862 9.0961 27.2925 9.17826 27.1792C9.26042 27.066 9.31649 26.9359 9.34244 26.7984C9.53684 26.4096 9.30644 26.0784 9.24164 25.6896C9.14804 25.1784 8.70164 24.5376 8.14724 24.6024C7.77284 24.1848 7.11764 24.3576 6.62084 24.3C6.18076 24.4356 5.75976 24.6267 5.36804 24.8688C5.12324 25.1352 4.87844 25.3872 4.64804 25.6392C4.64804 26.0136 4.48244 26.0208 4.46084 26.316C4.36724 26.3952 4.24484 26.4384 4.22324 26.5824C4.20164 26.7264 4.22324 26.6688 4.22324 26.7048C3.97917 26.533 3.75676 26.3324 3.56084 26.1072C3.33764 25.7688 2.97764 25.5096 2.88404 25.1064C2.71418 24.6816 2.61683 24.2314 2.59604 23.7744C2.53345 23.6188 2.50167 23.4525 2.50244 23.2848C2.46644 23.2272 2.50244 23.1696 2.50244 23.1048C2.50216 23.0602 2.49308 23.0162 2.47572 22.9751C2.45836 22.9341 2.43307 22.8969 2.40129 22.8656C2.36952 22.8344 2.33188 22.8097 2.29055 22.7931C2.24922 22.7764 2.205 22.7681 2.16044 22.7686C2.14186 22.7688 2.12332 22.7705 2.105 22.7736C1.8674 22.8384 1.8026 23.112 1.6874 23.3208V23.7744C1.66651 23.8693 1.66651 23.9675 1.6874 24.0624C1.6514 24.2066 1.6514 24.3574 1.6874 24.5016C1.63546 24.7215 1.64132 24.9512 1.7044 25.1682C1.76749 25.3852 1.88565 25.5822 2.0474 25.74C2.3858 26.172 2.5802 26.8848 3.1634 27C3.2426 27.2592 3.4658 27.396 3.6818 27.5544C3.81117 27.6847 3.95629 27.7984 4.1138 27.8928C4.1174 27.9431 4.1174 27.9937 4.1138 28.044C4.1786 28.2312 4.0706 28.3752 4.0274 28.548C4.04385 28.7921 4.08731 29.0335 4.157 29.268C4.27795 29.4104 4.3664 29.5775 4.4162 29.7576C4.5386 30.1896 4.733 30.744 5.1362 30.9168C5.2442 31.3992 5.777 31.68 6.1082 32.0184C6.6914 32.3424 6.7634 32.2776 7.2818 32.5296C7.61762 32.5607 7.95164 32.6088 8.2826 32.6736C8.5634 32.5656 8.7074 32.58 8.9378 32.4864C9.0458 32.5296 9.1394 32.6232 9.2762 32.5728C9.5786 32.4936 9.8234 32.256 10.1042 32.1912C10.2194 32.1912 10.3058 32.112 10.3778 32.0976C10.52 32.0847 10.6565 32.035 10.7738 31.9536C10.8864 31.9636 10.9998 31.9509 11.1074 31.9163C11.215 31.8816 11.3146 31.8258 11.4002 31.752C11.5897 31.6858 11.7484 31.5527 11.8466 31.3776C12.1346 31.0896 12.5666 30.9024 12.869 30.6C12.9986 30.5352 12.9554 30.3768 13.0274 30.2976C13.4234 30.2328 13.553 29.8872 14.1506 29.5776C14.3855 29.2971 14.6437 29.037 14.9224 28.8C15.0606 28.5235 15.2542 28.2784 15.4912 28.08C15.5632 27.7344 15.6496 27.792 15.7432 27.5112C15.8368 27.4608 15.9664 27.468 16.0096 27.3384C16.1569 27.0488 16.2867 26.7507 16.3984 26.4456C16.4344 26.3376 16.5496 26.2728 16.5496 26.1864ZM5.41124 26.3808C5.46164 26.0568 5.81444 26.0712 6.05924 25.7328C6.48404 25.6392 6.65684 25.272 7.17524 25.3584C7.40691 25.3335 7.64038 25.3847 7.8404 25.5042C8.04043 25.6237 8.19614 25.805 8.28404 26.0208C8.30589 26.1833 8.29209 26.3487 8.2436 26.5053C8.19511 26.662 8.11309 26.8062 8.00324 26.928C7.90244 27.0072 7.78004 27.0432 7.72964 27.1656C7.67924 27.288 7.42004 27.2448 7.26164 27.3672C7.10324 27.4896 7.11044 27.5328 7.00244 27.54C6.88015 27.5328 6.75754 27.5328 6.63524 27.54C6.52531 27.504 6.40677 27.504 6.29684 27.54C6.06056 27.4341 5.80664 27.3731 5.54804 27.36C5.43705 27.2697 5.3017 27.2146 5.15924 27.2016C5.16284 27.1705 5.16284 27.1391 5.15924 27.108C5.1313 26.9726 5.14292 26.8321 5.19271 26.7031C5.24251 26.5742 5.32837 26.4623 5.44004 26.3808H5.41124Z",fill:"currentColor"})),Ws=Io(Os,"Paperplane",{partnerIcons:{GMoney:Vs}});function Hs(){return N(S,{children:[I(Ls,{Component:Ws}),I(ba,{wrap:"wrap",children:"All caught up"}),I(ya,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const qs=jt(null,Rt({display:"flex",flexDirection:"row",gap:"5px"}));function js({children:e}){return I("div",{...qs,children:e})}const zs=Ot({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Ks(e){return I(e?Hs:Us,{})}function Ys({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:a,isMobile:o}){const i=function({conversations:e,isMobile:t}){return G({data:e??Ps,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??Ps.length,columns:Ns(t),getCoreRowModel:Q(),getRowId:e=>e.id})}({conversations:n,isMobile:o}),{query:{data:l},isFilling:s}=li({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!Sn(l?.data?.[0])&&!s;return N("div",{className:zs({isMobile:o}),children:[I("div",{id:uo}),N(Do.Provider,{value:r,children:[N(Kt,{children:[I(Xt,{children:"Conversations"}),N(js,{children:[I(Vo,{}),I(gl,{})]})]}),I(vl,{dashboard:"businessOwnerDashboard",children:a?I(Ko,{numColumns:4}):N(S,{children:[!o&&I(Cl.Provider,{value:{sortInstance:e,setSortInstance:t},children:I(mi,{headerGroups:i.getHeaderGroups()})}),n.length>0?I(Ci,{children:i.getRowModel().rows.map(e=>I(Ji,{rowData:e,isMobile:o},e.id))}):I(Ds,{children:Ks(c)})]})})]})]})}const _s=jt(Bt.body,Gt({body:"default"}));function Zs({children:e,stylists:t=[]}){if(Rn(e))return null;const n=Zt([_s,...t]);return I("div",{...n,children:e})}const Gs=jt(null,Rt({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),Qs=Ot({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),Xs=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function Js(){return I("div",{...Gs,children:Xs.map((e,t)=>I(Ya,{styles:Qs({width:e?.width})},t))})}const $s=Io(e=>p.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment",{partnerIcons:{GMoney:Vs}}),ec=Rt({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}"}),tc=Rt({position:"relative",width:"25px",height:"25px"});function nc({hasUnread:e}){return N("div",{className:tc,children:[I(Ls,{Component:$s}),e&&I("div",{"data-testid":"unread-comment-badge",className:ec,"aria-hidden":"true"})]})}const rc=jt(Bt["financial-summary-chatbox-header"],Rt({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout}",boxSizing:"border-box"}));function ac({hasUnreadMessages:e=!1,showMessageIndicator:t}){return N("div",{...rc,children:[I(ba,{children:"Message Bookkeeper"}),t&&I(nc,{hasUnread:e})]})}const oc=Rt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function ic(){return N("div",{className:oc,children:[I(Ls,{Component:Ws}),I(ba,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),I(ya,{wrap:"wrap",children:"In the meantime, ask about your financial trends."}),I(hl,{onClick:()=>Ei("Conversation"),children:I(ba,{children:"Send a message"})})]})}const lc=Rt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function sc({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=ui(),{startPrefetch:a,cancelPrefetch:o}=_i(),i=y(()=>{a({id:t}),n({id:t})},[t,a,n]),l=y(()=>{o(),r()},[o,r]);return N("div",{className:lc,children:[I(Ls,{Component:Ws}),I(ba,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),I(ya,{wrap:"wrap",children:"Pick up where you left off."}),I(hl,{onClick:()=>Ei("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:I(ba,{children:"Continue conversation"})})]})}const cc=Rt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function dc({summaryId:e}){return N("div",{className:cc,children:[I(Ls,{Component:Ws}),I(ba,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),I(ya,{wrap:"wrap",children:"Your bookkeeper will respond here."}),I(hl,{onClick:()=>Ei("FinancialSummary",{routeProps:{summaryId:e}}),children:I(ba,{children:"Talk to a bookkeeper"})})]})}function uc({summaryId:e,conversationId:t}){const n=Nn(t);return Sn(e)?I(ic,{}):n?I(sc,{conversationId:t,summaryId:e}):I(dc,{summaryId:e})}const hc=Rt({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),pc=jt(Bt["financial-summary-chatbox"],Rt({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"}));function gc({summaryData:e}){const t=Nn(e?.summary),n=Nn(e?.conversation);return N("div",{className:hc,children:[I(ac,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),I("div",{...pc,children:I(uc,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const mc=Rt({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),vc=Ot({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),Cc=jt(null,Rt({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),bc=Rt({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function fc({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},Wn({queryKey:(t={limit:1,filter:{date:{equal:nn(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Zi(t):["summaries",{}],queryFn:Qi,...n});var t,n}(t),a=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${to.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${no.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} 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.`}():n?.summary??"A summary of this month's financials will appear here once more data is available.",o=jt(Bt["financial-summary-layout"],vc({isSample:e}));return N("div",{className:bc,children:[I("div",{"data-testid":"financial-summary-layout",...o,children:!e&&r?I(Js,{}):N("div",{className:mc,children:[I(Zs,{stylists:[Cc],children:a}),e&&I(eo,{size:"lg"})]})}),I(gc,{summaryData:n})]})}const yc={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},xc={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},kc={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:xc.short.credentialsChanged,longMessage:xc.long.relinkCredentials,buttonType:yc.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:xc.short.credentialsChanged,longMessage:xc.long.relinkCredentials,buttonType:yc.RELINK},INVALID_MFA:{shortMessage:xc.short.credentialsChanged,longMessage:xc.long.relinkCredentials,buttonType:yc.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:xc.short.credentialsChanged,longMessage:xc.long.invalidUpdatedUsername,buttonType:yc.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:xc.short.accountLocked,longMessage:xc.long.accountLocked,buttonType:yc.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:xc.short.credentialsChanged,longMessage:xc.long.relinkCredentials,buttonType:yc.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:xc.short.supportChanged,longMessage:xc.long.supportChanged,buttonType:yc.CHAT},USER_SETUP_REQUIRED:{shortMessage:xc.short.updateNeeded,longMessage:xc.long.updateNeeded,buttonType:yc.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:xc.short.supportChanged,longMessage:xc.long.mfaUpdateNeeded,buttonType:yc.OPEN_BANK},NO_ACCOUNTS:{shortMessage:xc.short.noAccountsAvailable,longMessage:xc.long.noAccountsUnlink,buttonType:yc.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:xc.short.noAccountsAvailable,longMessage:xc.long.noAccountsUnlink,buttonType:yc.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:xc.short.connectionError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},ITEM_NOT_FOUND:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},PRODUCT_NOT_READY:{shortMessage:xc.short.serverError,longMessage:xc.long.productNotReady,buttonType:yc.CHAT},USER_PERMISSION_REVOKED:{shortMessage:xc.short.connectionError,longMessage:xc.long.permissionRevoked,buttonType:yc.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:xc.short.temporarilyDown,longMessage:xc.long.bankMaintenance,buttonType:yc.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:xc.short.serverDown,longMessage:xc.long.serverDown,buttonType:yc.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:xc.short.temporarilyDown,longMessage:xc.long.bankMaintenance,buttonType:yc.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:xc.short.supportChanged,longMessage:xc.long.supportChanged,buttonType:yc.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:xc.short.connectionError,longMessage:xc.long.connectionError,buttonType:yc.CHAT},PLANNED_MAINTENANCE:{shortMessage:xc.short.temporarilyDown,longMessage:xc.long.bankConnectionMaintenance,buttonType:yc.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:xc.short.requestError,longMessage:xc.long.connectionError,buttonType:yc.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:xc.short.inputError,longMessage:xc.long.connectionError,buttonType:yc.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:xc.short.volumeDown,longMessage:xc.long.bankMaintenance,buttonType:yc.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:xc.short.serverError,longMessage:xc.long.connectionError,buttonType:yc.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:xc.short.updateNeeded,longMessage:xc.long.partnerCredsChange,buttonType:yc.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:xc.short.credentialsExpiring,longMessage:xc.long.credentialsExpiring,buttonType:yc.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:xc.short.relinkNeeded,longMessage:xc.long.relinkForStatements,buttonType:yc.RELINK}},DEFAULT:{DEFAULT:{shortMessage:xc.short.connectionError,longMessage:xc.long.connectionError,buttonType:yc.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:xc.short.generic,longMessage:xc.long.generic,buttonType:yc.CHAT}}};function Tc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return wr({error:new Error("No bank error provided. Should not get here"),severity:"error"}),kc.DEFAULT.DEFAULT;const n=kc[e];if(!n)return wr({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),kc.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(wr({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),kc.DEFAULT.DEFAULT)}const wc={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",shortDescription:"Link your bank to track every dollar",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function Ec(e,t=!0){const n=Tc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName??"unknown"}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:n?.shortMessage(e.apiInstitutionName??"your bank")||"",description:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!1,apiPartnerName:""})||"",shortDescription:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!0,apiPartnerName:""})||"",type:n?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}const Ac=jt(Bt["month-picker"],Rt({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),Ic=jt(Bt["month-picker-left-button"],Rt({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),Sc=jt(Bt["month-picker-right-button"],Rt({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),Nc=jt(Bt["month-picker-label"],Rt({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function Pc({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const a=$t(e.year,e.month,1),o=kn(a,{abbreviateMonth:!0});return N("div",{...Ac,children:[I(hl,{stylists:[Ic],onClick:()=>{return t(0===(n=e).month?{month:11,year:n.year-1}:{month:n.month-1,year:n.year});var n},disabled:r,children:I(Lo,{Component:So})}),I("div",{...Nc,children:I(ba,{children:o})}),I(hl,{stylists:[Sc],onClick:()=>{return t(11===(n=e).month?{month:0,year:n.year+1}:{month:n.month+1,year:n.year});var n},disabled:n,children:I(Lo,{Component:No})})]})}const Rc=Rt({display:"flex",flexWrap:"wrap",justifyContent:"center",rowGap:"10px",columnGap:"max(10px, calc(50% - 600px))",maxWidth:"1440px",width:"100%"});function Mc({children:e}){return I("div",{className:Rc,children:e})}const Dc=jt(Bt["progress-bar"],Rt({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),Lc=jt(Bt["progress-bar-fill"],Rt({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),Oc=jt(Bt["tile-bar-label"],Rt({paddingLeft:"10px"})),Fc=jt(Bt["tile-bar-label-outer"],Rt({paddingLeft:"10px"}));function Bc({label:e="",percentage:t,color:n,width:r}){const a=void 0===r?"100%":`${r}px`,o=t>=50,i=Zt([Lc,jt(null,n)]);return N("div",{...Dc,style:{width:a},children:[I("div",{...i,style:{width:`${t}%`},children:o&&I("div",{...Oc,children:I(kl,{children:e})})}),!o&&I("div",{...Fc,children:I(kl,{children:e})})]})}const Uc=jt(Bt["metric-md"],Gt({metric:"md"}));function Vc(e){return I("div",{...Uc,children:e.children})}const Wc=jt(null,Rt({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),Hc=jt(null,Rt({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),qc=({label:e,amount:t,total:n,colorCss:r})=>{const a=n>0?function(e,t,n,r=0,a=100){return r+(e-t)*(a-r)/(n-t)}(t,0,n):0;return N("div",{...Wc,children:[I(Bc,{label:e,percentage:a,color:r}),I("div",{...Hc,children:I(Vc,{children:ma(t)})})]})},jc={netIncome:0,income:0,expenses:0,absoluteSum:0},zc=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return jc;const t=e.json?.data?.[0];if(Sn(t))return jc;const n=t.income?.total??0,r=t.expenses?.total??0,a=F(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:a}},Kc=Io(e=>p.createElement("svg",{stroke:"#000000",width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),p.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),p.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}),p.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");function Yc({Component:e,stylists:t}){return I(e,{stylists:[jt(Bt["medium-icon"],Bt.icon),...t??[]],size:15})}const _c={},Zc=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return _c[e]={loading:!1,error:null,scriptEl:t}},Gc="undefined"!=typeof window&&void 0!==window.document;function Qc({src:e,checkForExisting:t=!1,...n}){let r=_c[e];!r&&t&&e&&Gc&&(r=Zc(e));const[a,o]=f(r?r.loading:Boolean(e)),[i,l]=f(r?r.error:null),[s,c]=f(!1);return x(()=>{if(!Gc||!e||s||i)return;let a;r=_c[e],!r&&t&&(r=Zc(e)),r?a=r.scriptEl:(a=document.createElement("script"),a.src=e,Object.keys(n).forEach(e=>{void 0===a[e]?a.setAttribute(e,n[e]):a[e]=n[e]}),r=_c[e]={loading:!0,error:null,scriptEl:a});const d=()=>{r&&(r.loading=!1),o(!1),c(!0)},u=e=>{r&&(r.error=e),l(e)};return a.addEventListener("load",d),a.addEventListener("error",u),document.body.appendChild(a),()=>{a.removeEventListener("load",d),a.removeEventListener("error",u),r&&r.loading&&(a.remove(),delete _c[e])}},[e]),[a,i]}const Xc=e=>["integrations",e??{}],Jc=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:bo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function $c(e,t){return Go({...t,queryKey:Xc(e),queryFn:Jc})}function ed(e){return $c({filter:{apiName:{equal:"PLAID"}}},e)}function td(e){return Fr(`${t=e,Br[t]}/v1`,"v1");var t}async function nd({institutionId:e,accessToken:t,environment:n}){if(!t)throw new Error("Access token is required to get Plaid item institution");const r={path:"/banks2/bankUrl",accessToken:t,endpointManager:td(n)},{url:a,headers:o}=Rr(r);return await Qo({url:a,includeCredentials:!0,extraHeaders:o,params:e?{institutionId:e}:void 0})}const rd=jt(Bt["button-danger"],Rt({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{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"}}));function ad({children:e,stylists:t=[],...n}){return I(dl,{stylists:[rd,...t],...n,children:e})}const od=jt(Bt["button-tertiary"],Rt({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"},_supportHover:{_notDisabled:{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"}}}));function id({children:e,stylists:t=[],...n}){return I(dl,{stylists:[od,...t],...n,children:e})}const ld="cancel",sd="danger",cd="success",dd=Ot({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),ud=Ot({base:{background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",gap:"16px"},variants:{size:{sm:{maxWidth:"360px",minWidth:"0",margin:"32px"},md:{maxWidth:"600px",minWidth:"400px",margin:"32px"},lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},margin:{sm:"32px",base:"0"},height:{sm:"auto",base:"100dvh"}}},padding:{none:{padding:"0"},sm:{padding:"8px"},md:{padding:"16px"},lg:{padding:"24px"}}},defaultVariants:{size:"sm",padding:"md"}}),hd={transform:"none",willChange:"auto"};function pd({show:e,role:t="dialog",children:n,size:r="sm",padding:a="md",outsidePress:o=!1,escapeKey:i=!0,className:l}){const{context:s}=$({open:e,strategy:"fixed"}),c=ie(s,{outsidePress:o,escapeKey:i}),d=le(s,{role:t}),{getFloatingProps:u}=se([c,d]),h=[ud({size:r,padding:a}),l].filter(Boolean).join(" ");return e?I(ge,{children:I(pe,{lockScroll:!0,className:dd(),children:I(me,{context:s,modal:!0,returnFocus:!0,children:I("div",{...u(),className:h,style:hd,children:n})})})}):null}const gd=Rt({display:"flex",justifyContent:"flex-end",gap:"8px"}),md="success",vd="danger",Cd=Ce.createConfirmation(be(function({show:e,proceed:t,title:n,body:r,buttons:a=[{key:"ok",type:"default",label:"OK"}]}){return N(pd,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:Bt["alert-dialog"],children:[I(ba,{wrap:"wrap",stylists:[jt(Bt["alert-header"])],children:n}),r&&"string"==typeof r?I(kl,{wrap:"wrap",children:r}):I(S,{children:r}),I("div",{className:gd,children:a.map(e=>{const n=(e=>{switch(e){case vd:return ad;case md:return id;default:return hl}})(e.type);return I(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:I(ba,{children:e.label})},e.key)})})]})}));function bd(e,t,n,r){const a=1===n?e:t;return r?`${n} ${a}`:a}function fd(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function yd(e,t){return t?e?`${e} ${fd(t)}`:fd(t):e??""}const xd=e=>Ei("Conversation",{routeProps:{conversationId:null,defaultValues:e}}),kd=Rt({display:"flex",flexDirection:"column",gap:"12px"});async function Td(e){await Cd({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:ld,label:"Cancel"},{key:cd,label:"Chat",type:md}]})===cd&&xd({message:{text:`Please help me with my bank issue (code: ${e}). Thanks!`,attachments:[]}})}const wd=e=>["banks/accounts",e??{}],Ed=async e=>{const t=e.queryKey,n={path:"/v6/banks/accounts/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:bo(t[3].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Ad(e){const t=e?.params;return Go({queryKey:t?wd(t):["banks/accounts",{}],queryFn:Ed,enabled:e?.enabled,select:e?.select})}function Id(e,t){return Ii({queryKey:In(["banks/accounts",{}],{}),queryFn:Ed,accessToken:e,environment:t})}const Sd=e=>{const t=e?.status?"DELETED"===e.status?"REMOVED":e.status:"ACTIVE",n="MORTGAGE"!==e?.apiType&&"BROKERAGE"!==e?.apiType&&e?.apiType?e.apiType:"OTHER";return{iconUrl:"",...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:Hi({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:Hi({id:e.plaidItemId||e.oauthAccountId,prefix:"INTEGRATION"}),apiInstitutionId:e.apiInstitutionId??null},mask:e.apiMask??"",beginningBalanceData:{},isSupported:e.isSupported||!1,tranStartDate:e.tranStartDate||null,tranMinStartDate:e.tranMinStartDate||null,latestTransactionDate:e.latestTransactionDate||null}},Nd=jt(Bt["button-secondary"],Rt({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"},_supportHover:{_notDisabled:{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"}}}));function Pd({children:e,stylists:t=[],...n}){return I(dl,{stylists:[Nd,...t],...n,children:e})}function Rd({mutationFn:e,onMutateFn:t,...n}){const r=Ln(),a=Vn(),o=!Rn(r);return L({...n,mutationFn:o?t=>e({data:t,accessToken:r,environment:a}):On,onMutate:o&&Nn(t)?e=>t({data:e,accessToken:r,environment:a}):void 0},Bn)}const Md=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:Wr(n)};return await Or(r)},Dd=async({data:e,accessToken:t,environment:n})=>Md({data:e,accessToken:t,environment:n}),Ld=async({data:e,accessToken:t,environment:n})=>Md({data:e,accessToken:t,environment:n}),Od=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/accounts",bodyParams:{accounts:e.accounts},accessToken:t,endpointManager:Wr(n)};return await Or(r)})({data:{accounts:e},accessToken:t,environment:n});function Fd(e){return Rd({onSuccess:async()=>{Tr("mutation successful, invalidating bank account queries");try{return Bn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}},...e})}function Bd(){return Fd({mutationFn:Ld})}function Ud(){return Rd({onSuccess:async()=>{Tr("mutation successful, invalidating bank account queries");try{return Bn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}},mutationFn:Od})}const Vd=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,Wd=e=>"PLAID"===e,Hd=e=>e>0?"Deposited to":"Withdrawn from",qd=e=>({id:qi(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),jd=Rt({display:"flex",flexDirection:"column",gap:"16px"}),zd=async()=>Cd({title:"Merge Accounts",body:N("div",{className:jd,children:[I(kl,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),I(kl,{wrap:"wrap",children:"This action can't be undone."}),I(kl,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:ld,label:"Cancel"},{key:sd,label:"Continue",type:vd}]}),Kd=()=>Cd({title:"Merge Failed",body:I(kl,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:ld,label:"OK"}]}),{formContext:Yd,fieldContext:_d,useFieldContext:Zd,useFormContext:Gd}=fe(),Qd=Io(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{id:"icon/check"},p.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function Xd({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return N(id,{type:"submit",disabled:n,children:[e&&I(Lo,{Component:Qd}),I(ba,{children:t})]})}const Jd=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),$d=[jt(null,Rt({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],eu=jt(null,Rt({display:"flex",alignItems:"center",gap:"4px"}));function tu({errorMessage:e}){return N("div",{...eu,children:[I(Yc,{Component:Jd,stylists:$d}),I(ya,{intent:"danger",wrap:"wrap",children:e})]})}const nu=Rt({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']":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{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"}}),ru=Rt({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),au=Rt({display:"flex",justifyContent:"space-between",alignItems:"center"});function ou({children:e,inputRef:t,popupTriggerProps:n,label:r,isDefaultValue:a,isTouched:o,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=jt(i||null,nu,l,ru,Ro),[m,v]=f(!0);return N(S,{children:[N("div",{...g,onClick:s,...n,onMouseDown:e=>{v(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{v(!1),c?.()},"data-clicked":m,"data-isdefaultvalue":a,"data-haserror":o&&void 0!==d,"data-disablehover":u,children:[N("div",{className:au,children:[void 0!==r&&I(ya,{children:r}),Nn(p)&&I(ya,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),o&&d&&I(tu,{errorMessage:d})]})}const iu=Rt({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"}});function lu({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:a}){const o=Zd(),i=ye(o.store,e=>e.meta.errors[0]?.message),l=ye(o.store,e=>e.meta.isDefaultValue),s=ye(o.store,e=>e.meta.isTouched);return I(ou,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:Bt["discrete-form-input"],additionalStyles:iu,errorMessage:i,onClick:a,onBlur:o.handleBlur,children:e})}function su(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function cu(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function du(e){"Enter"===e.key&&e.currentTarget.blur()}const uu=jt(Bt["amount-input"],Gt({body:"default"}),Rt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),hu=jt(null,Rt({display:"flex",alignItems:"center",gap:"2px"}));function pu({value:e,onChange:t,inputRef:n,onClick:r,onBlur:a,autofocus:o=!1}){return N("div",{...hu,children:[I(Zs,{children:"$"}),I(ke,{...uu,getInputRef:n,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:r,onBlur:a,onKeyDown:du,autoFocus:o})]})}const gu=Rt({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),mu=Ot({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function vu({kind:e,label:t,children:n,inputRef:r,disabled:a,popupTriggerProps:o,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Zd(),u=ye(d.store,e=>e.meta.errors[0]?.message),h=ye(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=Nn(c)?c-p:void 0,m=a?gu:mu({kind:e});return I(ou,{label:t,inputRef:r,popupTriggerProps:o,className:Bt["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:n})}const Cu=jt(null,Rt({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function bu({options:e,onSelect:t,selectedLabel:n}){const r=Ul();return I("div",{...Cu,children:e.map(e=>I(Xl,{onClick:()=>{return n=Number(e.value),r.close(),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const fu=Io(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2922)"},p.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_9779_2922"},p.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),yu=jt(null,Rt({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",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),Po);function xu({selectedLabel:e,options:t,onSelect:n}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>N("div",{...yu,...t,children:[I(ba,{children:e}),I(Hl,{Component:fu})]})}),I(Gl,{children:I(bu,{options:t,onSelect:n,selectedLabel:e})})]})}const ku=jt(null,Rt({display:"flex",alignItems:"center",gap:"15px"})),Tu=dn.map((e,t)=>({value:t,label:e})),wu=un({}).map(e=>({value:e,label:String(e)}));function Eu({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),a=(e,n)=>{const r=new Date(e,n,1);t(r)};return N("div",{...ku,children:[I(xu,{selectedLabel:dn[r],options:Tu,onSelect:e=>a(n,e)}),I(xu,{selectedLabel:String(n),options:wu,onSelect:e=>a(e,r)})]})}const Au=jt(null,Rt({background:"surface.foreground",padding:"25px",gap:"15px"})),Iu=jt(null,Rt({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),Su=jt(null,Rt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),Po),Nu=jt(null,Rt({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),Pu=jt(null,Rt({padding:"8px",textAlign:"center"})),Ru=jt(null,Rt({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",_supportHover:{_notDisabled:{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"}}),Po),Mu=jt(null,Rt({color:"typography.base"}));function Du({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:a,minDate:o}){const i=t&&hn(e,t),l=pn(e),s=e.getMonth()!==n,c=!!a&&gn(e,a),d=!!o&&gn(o,e);return I("button",{...Ru,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:I(ba,{stylists:s||c||d?[Mu]:[],children:e.getDate().toString()})})}function Lu({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:a,minDate:o}){const i=Ul(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=$t(e,t,1),r=new Date(n);return r.setDate(r.getDate()-n.getDay()),Array.from({length:42},(e,t)=>{const n=new Date(r);return n.setDate(r.getDate()+t),n})}(s,c),u=(h=d)[h.length-1];var h;const p=void 0===a||u&&gn(a,u),g=Sn(o)||d.length>0&&gn(d[0],o),m=e=>{t(e),i.close()},v=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return N("div",{...Au,children:[N("div",{...Iu,children:[I("button",{...Su,onClick:()=>v(-1),disabled:!g,children:I(Lo,{Component:So})}),I(Eu,{currentMonthYear:l,onMonthYearChange:r}),I("button",{...Su,onClick:()=>v(1),disabled:!p,children:I(Lo,{Component:No})})]}),N("div",{...Nu,children:[cn.map(e=>I("div",{...Pu,children:I(ya,{children:e})},e)),d.map(t=>I(Du,{date:t,selectedDate:e,currentMonth:c,onClick:m,maxDate:a,minDate:o},t.toISOString()))]})]})}const Ou=jt(null,Gt({body:"default"}),Rt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),Fu=jt(null,Gt({body:"default"}),Rt({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"}}));function Bu(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const Uu=async({data:e,accessToken:t,environment:n})=>{const{file:r,entity:a,caption:o,entityId:i}=e,l=Wr(n).getUrl(`/files/upload/${a}`),s=Rn(o)?"att_"+i:o,c=new FormData;return c.append("file",r),c.append("caption",s),c.append("entityId",String(i)),(await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`},credentials:"include",body:c})).json()},Vu=async({data:e,accessToken:t,environment:n})=>{const r=Wr(n).getUrl("/files/attachment");return(await fetch(r,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:e.id})})).json()};const Wu=Rt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Hu=({onFileSelect:e,onUploadComplete:t})=>{const n=g(null),{mutateAsync:r,isPending:a}=Rd({mutationFn:Uu,onSuccess:async()=>Bn.invalidateQueries({queryKey:["files/attachments"]})});return N("div",{children:[I("input",{type:"file",multiple:!0,ref:n,onChange:async a=>{const o=Array.from(a.target.files??[]);if(0===o.length)return;const i=o.map(e=>({localId:crypto.randomUUID(),file:e,name:e.name,size:e.size})),l=i.map(({localId:e,name:t,size:n})=>({localId:e,name:t,size:n,id:null,isPending:!0}));e?.(l);try{const e=i.map(async({localId:e,file:t})=>({localId:e,result:await r({file:t,entity:"message",caption:t.name,entityId:null})})),n=(s=l,c=await Promise.allSettled(e),s.map(({localId:e,name:t,size:n})=>{const r=c.find(t=>"fulfilled"===t.status&&t.value.localId===e);if(r&&"fulfilled"===r.status){const a=r.value.result?.attachment?.id??null;return{localId:e,name:t,size:n,id:a,isPending:!1}}return{localId:e,name:t,size:n,id:null,isPending:!1}}));t?.(n)}finally{n.current&&(n.current.value="")}var s,c},style:{display:"none"}}),I(hl,{type:"button",onClick:()=>{n.current?.click()},disabled:a,children:I("span",{className:Wu,children:I(Yc,{Component:ds})})})]})},qu=h.object({localId:h.string(),id:h.number().nullable(),name:h.string(),size:h.number(),isPending:h.boolean()}),ju=h.object({message:h.object({text:h.string(),attachments:h.array(qu)}).refine(e=>e.text.trim().length>0||e.attachments.some(e=>null!==e.id),{message:"Either message text or attachments are required"})}),zu=Rt.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),Ku=Rt.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"}),Yu=Rt(Ku,zu),_u=Rt.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Zu=Rt(_u,zu,Gt.raw({body:"default"})),Gu=Rt({display:"block",width:"100%"}),Qu=Rt({position:"relative"}),Xu=Rt({display:"flex",justifyContent:"flex-end",gap:"15px"}),Ju=Rt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),$u=T(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n,onFileSelect:r,onUploadComplete:a,hideFileUpload:o},i){const l=Zd(),s=g(null),{startCallback:c}=ei({delay:50,callback:e=>n(e)});w(i,()=>s.current);const d=!e&&ju.safeParse(l.form.state.values).success;return I(vu,{kind:"text",inputRef:s,disableHover:!0,onClick:()=>(Bu(t),void c(!0)),children:N("div",{className:Gu,children:[N("div",{className:Qu,children:[N("pre",{className:Yu,children:[l.state.value.text,I("br",{})]}),I("textarea",{ref:s,placeholder:"Message...",value:l.state.value.text,className:Zu,onChange:e=>l.handleChange({...l.state.value,text:e.target.value})})]}),N("div",{className:Xu,children:[!o&&I(Hu,{onFileSelect:r,onUploadComplete:a}),I(hl,{disabled:!d,type:"submit",children:I("span",{className:Ju,children:I(Yc,{Component:Ws})})})]})]})})});function eh(e){return new F(e).div(100).toNumber()}function th(e){return new F(e).times(100).toNumber()}const nh=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,rh=e=>{const t=e?.description;return`${t} | ${va(eh(Number(e?.amount)))} | ${mn(bn(e?.date||""))}`},ah=v(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function oh(e,t){switch(t.type){case"increment":return((e,t)=>{let n;if(null===e.focusedIndex)n=0;else{const r=e.focusedIndex+1;n=!t.repeat&&r>e.maxIndex?0:Math.min(r,e.maxIndex)}return{...e,focusedIndex:n}})(e,t);case"decrement":return((e,t)=>{let n;if(null===e.focusedIndex)n=e.maxIndex;else{const r=e.focusedIndex-1;n=!t.repeat&&r<0?e.maxIndex:Math.max(r,0)}return{...e,focusedIndex:n}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function ih(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function lh(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.top>=n.top&&r.bottom<=n.bottom&&r.left>=n.left&&r.right<=n.right}function sh(e,t,n){if(null===e)return{node:void 0,metadata:void 0};const r=t[e];return{node:r,metadata:n.get(r)}}function ch(e){const[t,n]=f(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:a,isMousing:o,isScrolling:i}=function(e,t){const n=g(null),[r,a]=f(!0),[o,i]=f(!1),l=C(ah),[s,c]=E(oh,{focusedIndex:null,maxIndex:e});x(()=>{const e=n.current,t=()=>{Sn(s.focusedIndex)&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[n,s.focusedIndex,c,l?.popupNodeId]);const d=g(null);return x(()=>{c({type:"max",max:e})},[e]),x(()=>{const e=n.current;if(null!==e){const n=e=>{i(!1);const n=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!n)return;const r=Number(e.target.getAttribute("data-index"));s.focusedIndex===r&&d.current===e.target||(0!==e.movementX||0!==e.movementY)&&n&&(a(!0),d.current=e.target,c({type:"set",focusedIndex:r}),t.setCascadeState(!0,r))},r=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,n="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;a(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):n&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},o=()=>i(!0);return e.addEventListener("mousemove",n),e.addEventListener("keydown",r),e.addEventListener("scroll",o),()=>{e.removeEventListener("mousemove",n),e.removeEventListener("keydown",r),e.removeEventListener("scroll",o)}}},[t,s.focusedIndex]),{listRef:n,focusedState:s,isMousing:r,isScrolling:o}}(t.size-1,e),l=Ul(),s=y((e,t)=>{n(n=>new Map(n).set(e,t??null))},[]),c=y(e=>{n(t=>{const n=new Map(t);return n.delete(e),n})},[]),{sortedNodes:d,sortedMap:u}=function(e,t){const n=m(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(ih)),n},[e,t]),r=m(()=>{const t=/* @__PURE__ */new Map;return n.forEach((n,r)=>{const a=e.get(n)??{};t.set(n,{...a,index:r})}),t},[n,e]);return{sortedNodes:n,sortedMap:r}}(t,r);!function(e,t,n,r,a,o){x(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=sh(r,t,n),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,n){const r=e.placement.includes("left"),a=e?.popupParentNodeId,o=a&&n?.hasCascading&&r?"ArrowLeft":"ArrowRight",i=r?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:n?.hasCascading&&t.key===o,shouldCloseCascade:a&&t.key===i}}(a,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=r,g=l,m=i,v=o,!(!(h=s)||!h.hasCascading||null===p||g&&m&&lh(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),a.close())};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,r,n,a,o])}(r,d,u,a.focusedIndex,l,e);const{startCallback:h,cancelCallback:p}=ei({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&lh(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return v=a.focusedIndex,x(()=>{const e=w.current;if(null===v||b)return;const{node:t,metadata:n}=sh(v,k,T);return A.lastOpenedIndex!==v&&n?.hasCascading&&(A.closeCurrentCascade(),I({focusedIndex:v,node:t,listElement:e})),()=>S()},[v,b=o,w=r,A=e,S=p,k=d,T=u,I=h]),function(e,t,n,r){x(()=>{const{metadata:a}=sh(e,t,n);null===e||a?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(a.focusedIndex,d,u,e),m(()=>({register:s,unregister:c,map:u,focusedIndex:a.focusedIndex,listRef:r,isMousing:o,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,u,a.focusedIndex,r,o,i,l?.nodeId]);var v,b,k,T,w,A,I,S}const dh=v(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function uh({style:e,children:t}){const n=jt(Bt["popup-list"],Ml,e),r=function(){const[e,t]=f(null),[n,r]=f(!1),[a,o]=f(null),i=y((n,a)=>{n&&e!==a?(o(a),t(a)):n||e!==a||(r(!1),t(null))},[e,r]),l=y(()=>{t(null),o(null),r(!1)},[t,o,r]),s=y(()=>{t(null),o(null),r(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:n,setFocus:r,lastOpenedIndex:a,closeCurrentCascade:s}}(),a=ch(r);return I("div",{...n,onScroll:r.onScroll,ref:a.listRef,tabIndex:0,children:I(ah.Provider,{value:a,children:I(dh.Provider,{value:r,children:t})})})}function hh({searchTerm:e,setSearchTerm:t,onClick:n,placeholder:r,SearchInput:a,SearchList:o,DefaultList:i,extraProps:l,listLength:s,forceSearchVisible:c}){const d=c||s>=5,u=Mn(e),h=e=>{n?.(e)};return N(S,{children:[d&&I(a,{searchTerm:e,setSearchTerm:t,placeholder:r}),d&&u?I(o,{...l??{},onClick:h,searchTerm:e}):I(i,{...l??{},onClick:h})]})}const ph=Dt(Gt({body:"default"}),Rt({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}}));function gh({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=g(null);return x(()=>{r.current?.focus({preventScroll:!0});const e=e=>{const t=document.activeElement,n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement;!r.current||document.activeElement===r.current||n||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||r.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),I("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:ph})}function mh({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i,getSearchActiveStyles:l}){const s=Ul(),[c,d]=f(""),u=Mn(c),h=l?.(u);return I(Gl,{children:I(uh,{style:h,children:I(hh,{searchTerm:c,setSearchTerm:d,onClick:t=>{e?.(t),s.close()},placeholder:t,SearchInput:gh,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i})})})}function vh({hasCascading:e=!1}={}){const t=g(null),{register:n,unregister:r,map:a,focusedIndex:o,isMousing:i,listRef:l}=C(ah);A(()=>{const a=t.current;if(a)return n(a,{index:0,hasCascading:e}),()=>{r(a)}},[n,r,e]);const s=m(()=>void 0!==a&&null!==t.current?a.get(t.current)?.index??-1:-1,[a]),c=s===o;A(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=y(()=>{l?.current?.focus()},[l]),u=m(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const Ch=T(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:a},o){return I("button",{...Ll,onClick:e,"data-listitem":!0,"data-index":t,...a,...r,ref:o,children:n})}),bh=T(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:a,itemProps:o,itemRef:i}=vh(),l=he([i,r]);return I(Ch,{...Ll,onClick:e,index:a,...n,itemProps:o,ref:l,children:t})});function fh({promptText:e}){return N(S,{children:[I(Lo,{Component:$i}),I(kl,{children:e})]})}function yh({text:e}){return I("div",{...Ll,children:e?I(ba,{children:e}):I(Ya,{styles:Rt({width:"100%",height:"16px"})})})}const xh=jt(Bt["popup-list"],Ml),kh=()=>N("div",{...xh,children:[I(yh,{}),I(yh,{}),I(yh,{}),I(yh,{}),I(yh,{})]});function Th({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?I(kh,{}):N(S,{children:[r&&I(bh,{onClick:()=>Ei("BankAccountForm"),children:I(fh,{promptText:"Add bank account"})}),e?.map(e=>I(bh,{onClick:()=>t(e),children:I(ba,{wrap:"wrap",children:yd(e?.name,e?.mask)})},e?.id))]})}const wh={keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Eh({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:a=!1}){const o=m(()=>new Te(e??[],wh),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?I(kh,{}):N(S,{children:[a&&I(bh,{onClick:()=>Ei("BanksAndIntegrations"),children:I(fh,{promptText:"Add bank account"})}),0===i.length?I(yh,{text:"No results found"}):i.map(e=>I(bh,{onClick:()=>n(e),children:I(ba,{wrap:"wrap",children:yd(e?.name,e?.mask)})},e?.id))]})}function Ah({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return I(mh,{onClick:e,placeholder:"Search bank accounts...",SearchList:Eh,DefaultList:Th,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const Ih=Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function Sh({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:a,onClick:o}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:r=>I(vu,{label:e,popupTriggerProps:r,disabled:t,children:I("button",{className:Ih,type:"button",disabled:t,children:I(ba,{children:yd(n?.name??"",n?.mask??"")})})})}),I(Ah,{bankAccounts:r,isFilling:a,onClick:o,showAddButton:!0})]})}const Nh=(e,t)=>e?.find(e=>e.glAccountId===t),Ph=e=>{const{query:t}=Ad({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},Rh=e=>{if(Sn(e))return!1;const t=e.filter(e=>Wd(e.apiName)&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||Nn(e.lastSyncedDate))},Mh=()=>{const e=Ad({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function Dh(){return Ad({select:e=>{return{...e,plaidItemAccountsReadyToSync:Rh(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>Wd(e.apiName)))};var t}})}function Lh(e){return e?.filter(e=>Vd(e.apiName)&&"ACTIVE"===e.status)}function Oh(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function Fh(e){return Ad({select:t=>({...t,data:Oh(t?.data,e)})})}const Bh=()=>["expenses/categories"],Uh=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await $o(n);return{...r,data:r.data?(a=r.data,a.map(e=>({...e,id:Hi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?Hi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var a};function Vh(e){return Wn({...e,queryKey:["expenses/categories"],queryFn:Uh})}function Wh(){return Vh({select:e=>({...e,data:e.data?jh(e.data):void 0})})}function Hh(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentCategoryId){const e=t.get(n.parentCategoryId)??[];e.push(n),t.set(n.parentCategoryId,e)}return t}function qh(e){if(0===e.length)return[];const t=Hh(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function jh(e){if(0===e.length)return[];const t=Hh(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function zh(){return ti({prefetchFn:Yo(Bh,Uh)})}const Kh=e=>({id:e.id,name:e.name}),Yh=jt(Bt.text,Gt({label:"strongLabel"}),Rt({maxWidth:"100%"}),ea);function _h({children:e,stylists:t=[]}){const n=Zt([Yh,...t]);return I("div",{...n,children:e})}const Zh={keys:[{name:"name"}],threshold:.1};function Gh(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}function Qh(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(l=r,t.find(e=>e.children?.some(e=>e.id===l.id))),o=!(a||0!==r?.children?.length&&r.children),i=!a&&r.children&&r.children.length>0;var l;a?Gh(a,r,n):o?Gh(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{Gh(e,n,t)})}(r,n)}),n}const Xh=jt(null,Rt({whiteSpace:"normal"})),Jh=[jt(null,Rt({marginLeft:"6px",marginRight:"6px"}))];function $h({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:a}=Vh({select:e=>({...e,data:e.data?qh(e.data):void 0})}),o=n?.data,i=!a&&r&&(void 0===o||0===o.length),l=m(()=>new Te(o??[],Zh),[o]),s=m(()=>o?Qh(l.search(e),o):[],[o,e,l]);return a?I(kh,{}):i?I(yh,{text:"No data"}):0===s.length?I(yh,{text:"No results found"}):I(S,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return N(bh,{onClick:()=>t(Kh(n)),children:[I("img",{src:n.iconUrl,alt:"",width:"15px",height:"15px"}),I(_h,{stylists:[Xh],children:r?n.name:N(S,{children:[e.name,I(Lo,{Component:No,stylists:Jh}),n.name]})})]},`${e.id}_${n.id}`)})})}const ep=T(function({index:e,popupTriggerProps:t,children:n,itemProps:r},a){const o=he([a,t?.ref]);return I(Ch,{index:e,ref:o,itemProps:r,popupTriggerProps:t,children:n})});function tp({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:a}=C(dh),{itemRef:o,index:i,itemProps:l}=vh({hasCascading:!0}),{isScrolling:s}=C(ah);return N(Bl,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[I(Vl,{children:t=>I(ep,{itemProps:l,index:i,ref:o,popupTriggerProps:t,children:e})}),I(Gl,{initialFocus:a,children:t})]})}const np=Rt({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}),rp=Rt({display:"flex",gap:"8px"});function ap({icon:e,iconUrl:t,displayLabel:n}){return N("div",{className:np,children:[N("div",{className:rp,children:[e,Sn(e)&&t&&I("img",{src:t,alt:"",width:"15px",height:"15px"}),I(ba,{wrap:"wrap",children:n})]}),I(Lo,{Component:No})]})}function op({category:e,handleCategoryChange:t}){return I(uh,{children:e.children?.map(e=>N(bh,{onClick:()=>t(Kh(e)),children:[I("img",{src:e.iconUrl,alt:"",width:"15px",height:"15px"}),I(ba,{wrap:"wrap",children:e.name})]},e.id))})}function ip({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=Wh(),a=t?.data,o=!r&&n&&void 0===a;return r?I(kh,{}):o?I(yh,{text:"No data"}):I(S,{children:a?.map(t=>t.hasChilds?I(tp,{triggerChildren:I(ap,{displayLabel:t.name,iconUrl:t.iconUrl}),popupChildren:I(op,{category:t,handleCategoryChange:e})},t.id):N(bh,{onClick:()=>e(Kh(t)),children:[I("img",{src:t.iconUrl,alt:"",width:"15px",height:"15px"}),I(ba,{wrap:"wrap",children:t.name})]},t?.id))})}const lp=({onClick:e})=>{const{query:{data:t}}=Wh();return I(mh,{onClick:e,placeholder:"Search expense categories...",SearchList:$h,DefaultList:ip,listLength:(t?.data??[]).length})},sp=jt(Bt["category-text"],Rt({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",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),Mo),cp=jt(null,Rt({color:"inherit"})),dp=jt(Bt["amount-input-container"],Rt({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{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"}}),Mo),up=()=>["accounting/glAccounts"],hp=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await $o(n);return vp(r)};function pp(e){return Wn({...e,queryKey:["accounting/glAccounts"],queryFn:hp})}function gp(){return pp({select:fp})}function mp(){return pp({select:yp})}const vp=e=>e.map(e=>({...e,id:Hi({id:e.id,prefix:"GL_ACCOUNT"})}));function Cp(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>Cp(e,t))}const bp=e=>!e.parentAccountNo;function fp(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentAccountNo){const e=t.get(n.parentAccountNo)??[];e.push(n),t.set(n.parentAccountNo,e)}return t}(e);return e.filter(bp).map(e=>({...e,children:Cp(e,t)}))}function yp(e){return fp(e).flatMap(e=>[e,...e.children])}const xp=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function kp(e,t){return m(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const Tp=Rt({display:"grid",textWrap:"nowrap",width:"100%"});function wp({children:e,rows:t,cols:n}){return I("div",{className:Tp,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const Ep=Ot({base:{minWidth:0,borderRadius:"zero",border:"1px solid",borderColor:"border.layout",_hover:{zIndex:1},_focus:{zIndex:2}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}},corners:{rounded:{_first:{borderTopLeftRadius:"sm",borderBottomLeftRadius:"sm"},_last:{borderTopRightRadius:"sm",borderBottomRightRadius:"sm"}}}}});function Ap({option:e,handleClick:t,selected:n,width:r,backgroundColor:a,corners:o}){const i=jt(Bt["button-group"],Dt(Ep({width:r,backgroundColor:a,corners:o}),nl,el,tl,Po));return void 0===e?null:I("button",{type:"button",...i,onClick:()=>t(e),"data-active":n?.value===e.value,children:n?.value===e.value?I(ba,{wrap:"wrap",textAlign:"center",children:e.label}):I(kl,{wrap:"wrap",alignment:"center",children:e.label})})}function Ip({options:e,handleClick:t,selected:n,rows:r,cols:a}){return I(wp,{rows:r,cols:a,children:e?.map(e=>I(Ap,{option:e,handleClick:t,selected:n},e.value))})}function Sp({options:e}){const t=Ul(),n=Zd();return I(Gl,{children:I(uh,{children:e.map(e=>I(bh,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.close()},children:I(kl,{children:e.label})},e.value))})})}const Np=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),Pp=jt(null,Rt({color:"typography.base.weak"})),Rp=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Mp=Rt({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),Dp=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank",{partnerIcons:{GMoney:e=>p.createElement("svg",{width:32,height:31,viewBox:"0 0 32 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.52694 10.9307L13.7957 1.94293V14.4753H1.2627L1.52694 10.9307Z",fill:"white"}),p.createElement("path",{d:"M27.5088 14.4753H4.15918V26.4539H27.5088V14.4753Z",fill:"white"}),p.createElement("path",{d:"M24.5894 17.3013C24.206 17.3011 23.8264 17.3764 23.4721 17.523C23.1178 17.6695 22.7959 17.8844 22.5247 18.1554C22.2536 18.4264 22.0384 18.7482 21.8916 19.1023C21.7448 19.4564 21.6692 19.836 21.6691 20.2194C21.657 19.4533 21.3443 18.7227 20.7982 18.1852C20.2522 17.6476 19.5167 17.3464 18.7505 17.3464C17.9844 17.3464 17.2489 17.6476 16.7029 18.1852C16.1568 18.7227 15.8441 19.4533 15.832 20.2194C15.82 19.4533 15.5072 18.7227 14.9612 18.1852C14.4152 17.6476 13.6797 17.3464 12.9135 17.3464C12.1473 17.3464 11.4118 17.6476 10.8658 18.1852C10.3198 18.7227 10.007 19.4533 9.99499 20.2194C9.99499 19.4453 9.68746 18.7029 9.14007 18.1555C8.59267 17.6081 7.85024 17.3005 7.07611 17.3005C6.30197 17.3005 5.55954 17.6081 5.01215 18.1555C4.46475 18.7029 4.15723 19.4453 4.15723 20.2194V26.2019H27.5083V20.2194C27.5081 19.4454 27.2005 18.7032 26.6531 18.1559C26.1057 17.6087 25.3634 17.3013 24.5894 17.3013Z",fill:"#82CFD0"}),p.createElement("path",{d:"M30.2716 11.1417C30.2645 11.087 30.2391 11.0363 30.1996 10.9977L16.0142 0.567773C15.9664 0.520112 15.9017 0.493347 15.8342 0.493347C15.7667 0.493347 15.702 0.520112 15.6542 0.567773C14.2761 1.95161 12.5294 2.87177 10.9591 4.00721C8.30372 5.92745 5.54684 10.6312 7.52396 13.8619C8.35772 15.2234 10.9576 14.6157 12.2558 14.6157H30.268C30.3011 14.6157 30.3328 14.6026 30.3561 14.5792C30.3795 14.5559 30.3926 14.5242 30.3926 14.4911V11.2648C30.3924 11.2326 30.3797 11.2017 30.3571 11.1787C30.3345 11.1557 30.3039 11.1424 30.2716 11.1417Z",fill:"#098080"}),p.createElement("path",{d:"M31.6375 29.4405C31.5655 29.2468 31.1544 29.1705 30.9607 29.1093C30.605 29.1266 30.2484 29.1012 29.8987 29.0337C29.7043 29.0992 29.5503 28.9984 29.3767 28.9336C29.0321 28.8954 28.6833 28.93 28.3529 29.0351C27.8122 29.1539 27.1368 28.876 26.6465 29.1417C25.498 28.9466 24.3304 28.8883 23.1682 28.9682C23.0149 28.9281 22.8572 28.9071 22.6987 28.9055C22.5293 28.9877 22.3418 29.0256 22.1537 29.0157C22.0241 29.0877 21.9708 29.0618 21.8657 28.9689C21.5439 28.8674 21.209 29.0783 20.8843 29.0913C20.0153 29.1417 19.7424 28.8674 18.8971 28.9473C18.2779 29.1907 17.6011 28.9473 16.9769 29.0747C16.8869 29.1511 16.7897 29.2051 16.6817 29.1259C16.4535 29.0135 16.231 29.0891 15.9948 29.0452C15.439 28.9613 14.8768 28.9278 14.3151 28.9451C14.0124 28.9032 13.7048 28.912 13.405 28.9711C13.2307 28.961 13.1011 28.8746 12.9219 28.9221C12.7087 28.9853 12.4904 29.0297 12.2695 29.0546C12.0909 28.9537 11.881 28.9237 11.6813 28.9703C10.9677 29.1263 10.2273 29.11 9.52129 28.9228C9.00109 29.0215 8.47139 29.0608 7.94233 29.0402C7.70571 28.9982 7.46294 29.0061 7.22953 29.0632C7.13017 29.1352 7.02649 29.2252 6.91129 29.1172C6.71977 29.0071 6.45985 29.0675 6.24889 29.0452C5.52529 28.9099 4.79089 28.9919 4.07521 28.9012C3.81237 28.9876 3.52878 28.9876 3.26593 28.9012C3.01899 28.9727 2.76588 29.021 2.50993 29.0452C2.36593 29.033 2.30113 28.9185 2.14417 28.9459C1.73809 28.9775 1.34065 29.1619 0.932411 29.1619C0.633962 29.1315 0.334417 29.208 0.0871313 29.3779C-0.128869 29.5787 0.0928914 29.92 0.358571 29.9078C0.473051 29.8754 0.569531 29.9495 0.682571 29.9344C1.11457 29.8891 1.52137 30.0727 1.94329 30.0021C2.69641 29.735 3.63961 30.0964 4.44817 30.0539C6.00409 30.0043 7.56001 30.1259 9.10297 30.0583C9.77559 30.1016 10.4508 30.0787 11.119 29.9899C11.6561 30.1425 11.8793 29.8163 12.3905 29.9179C12.7325 29.9949 13.0709 29.8725 13.3985 30.0215C13.9625 30.0695 14.5299 30.0628 15.0927 30.0014C15.9905 30.0417 16.8891 30.0777 17.7941 30.1094C18.4309 30.0538 19.0703 30.0351 19.7093 30.0532C20.2385 29.9899 20.3573 30.1504 20.9016 29.9812C21.2487 30.1123 21.5302 29.9423 21.8578 29.8883C22.0738 29.933 22.2898 29.9157 22.5022 29.9683C22.5943 29.9683 22.6786 29.92 22.77 29.9207C23.4017 30.0611 24.0525 30.0946 24.6953 30.0201C25.6471 29.9985 26.599 30.0921 27.5537 30.1094C27.9068 30.0523 28.2651 30.0345 28.6222 30.0561C29.1687 30.1051 29.7144 29.9891 30.2573 30.0763C30.52 29.9717 30.7974 29.909 31.0795 29.8905C31.3575 29.9027 31.7859 29.8005 31.6375 29.4405Z",fill:"black"}),p.createElement("path",{d:"M30.8084 14.4328C30.9006 13.913 30.8084 13.3989 30.8581 12.8747C30.8764 12.6282 30.8604 12.3803 30.8106 12.1382C30.7199 11.8329 30.9279 11.6212 30.8221 11.0819C30.7537 10.7759 30.4398 10.5967 30.1799 10.4642C29.7982 10.2275 29.4395 9.95556 29.1085 9.65202C28.819 9.4919 28.5526 9.29329 28.3165 9.06162C28.1483 9.01116 27.9917 8.92797 27.8557 8.81682C27.8061 8.80922 27.7601 8.78645 27.724 8.75164C27.6879 8.71683 27.6635 8.67168 27.6541 8.62242C27.4129 8.3409 26.9888 8.2797 26.7109 8.03922C26.5745 7.92938 26.4446 7.81157 26.3221 7.68642C26.1522 7.62882 26.0823 7.47474 25.9837 7.34082C25.8023 7.18746 25.5992 7.05282 25.4077 6.92322C25.2359 6.88587 25.077 6.80392 24.9469 6.68562C24.7309 6.4869 24.3896 6.26442 24.1621 6.0729C24.0635 5.9721 23.9461 6.02754 23.8381 5.97282C23.7301 5.74098 23.5127 5.62146 23.3197 5.45442C23.1558 5.31119 23.0019 5.15699 22.8589 4.9929C22.6595 4.89138 22.5075 4.6833 22.2973 4.59042C22.0532 4.35351 21.7769 4.15232 21.4765 3.99282C21.4098 3.8912 21.323 3.8043 21.2215 3.73744C21.1199 3.67058 21.0058 3.62518 20.8861 3.60402C20.6888 3.39234 20.5873 3.55578 20.5405 3.29442C20.3245 3.00642 19.8925 2.99634 19.6333 2.76162C19.5757 2.67522 19.4677 2.63922 19.4173 2.58162C19.3525 2.52402 19.3309 2.44482 19.2517 2.40162C19.0688 2.34402 19.0242 2.18562 18.9277 2.04162C18.7391 1.90194 18.5461 1.75362 18.3517 1.62402C18.1734 1.6003 18.0058 1.52525 17.8693 1.40802C17.6684 1.19562 17.3171 0.982498 17.0917 0.788818C16.9923 0.684418 16.8483 0.752818 16.7533 0.702418C16.6395 0.418738 16.4696 0.368338 16.2349 0.155218C16.1389 0.0760261 16.023 0.0247403 15.8998 0.00696345C15.7767 -0.0108134 15.651 0.00560267 15.5365 0.0544182C15.4 0.155515 15.2463 0.231128 15.0829 0.277618C14.9389 0.455458 14.6819 0.517378 14.5357 0.709618C14.3989 0.853618 14.2549 0.868018 14.0965 0.968818C13.9453 1.05522 13.8661 1.22802 13.7221 1.32162C13.6069 1.40082 13.4413 1.41522 13.3477 1.52322C13.2757 1.60242 13.2541 1.71762 13.1749 1.78242C13.0093 1.87458 13.0367 1.89546 12.9301 2.02002C12.4837 1.97178 12.3462 2.55282 12.0085 2.74722C11.8767 2.78682 11.8847 2.85234 11.5549 2.99922C11.4483 3.16554 11.2748 3.15474 11.1085 3.20082C10.9115 3.33734 10.7216 3.48394 10.5397 3.64002C10.4511 3.78402 10.3662 3.96618 10.1941 4.03602C9.86296 4.22706 9.55389 4.45403 9.2725 4.71282C9.2365 4.77042 9.2509 4.86402 9.1933 4.90002C8.87146 4.92738 8.7973 5.07786 8.5309 5.23122C8.3545 5.28594 8.25082 5.43642 8.0701 5.48322C8.03423 5.48394 7.99923 5.49437 7.9688 5.51338C7.93838 5.5324 7.91367 5.55929 7.8973 5.59122C7.71292 5.67938 7.54682 5.80151 7.4077 5.95122C7.271 6.05696 7.1209 6.14412 6.9613 6.21042C6.8173 6.29682 6.7381 6.46962 6.5941 6.56322C6.4717 6.64242 6.3133 6.65682 6.2125 6.76482C6.14536 6.92392 6.02937 7.05755 5.8813 7.14642C5.8273 7.2681 5.77618 7.27602 5.6509 7.26162C5.31178 7.36818 5.17354 7.80666 4.8805 7.98162C4.7725 8.01042 4.7005 8.11122 4.6285 8.14722C4.48829 8.19903 4.36068 8.28002 4.2541 8.38482C3.97546 8.4849 3.86818 8.45682 3.6421 8.70882C3.45021 8.80033 3.29346 8.95203 3.1957 9.14082C3.00994 9.38202 2.72626 9.45402 2.5045 9.65922C2.4181 9.73122 2.01562 9.9717 1.9717 10.0768C1.9357 10.1416 1.9429 10.2352 1.8853 10.2784C1.67711 10.3018 1.48234 10.3929 1.3309 10.5376C1.19569 10.6129 1.07791 10.716 0.985301 10.84C0.756341 10.9401 0.793781 11.2965 0.740501 11.4736C0.722192 11.5062 0.71082 11.5422 0.707103 11.5794C0.703386 11.6165 0.707402 11.6541 0.718901 11.6896C0.695499 11.9026 0.695499 12.1175 0.718901 12.3304C0.731436 12.512 0.714415 12.6943 0.668501 12.8704C0.654101 13.0576 0.747701 13.2304 0.740501 13.4104C0.692303 13.5332 0.671211 13.665 0.678667 13.7967C0.686123 13.9285 0.721952 14.057 0.783701 14.1736C0.766197 14.2704 0.776174 14.3702 0.812501 14.4616C0.811769 14.6419 0.878668 14.8158 0.999979 14.9491C1.12129 15.0824 1.28819 15.1654 1.4677 15.1816C1.80754 15.1982 2.14666 15.0045 2.4901 15.0232C2.57578 15.0635 2.69674 15.0297 2.7709 15.0376C2.8573 15.052 2.9221 15.1024 3.0085 15.088C3.09042 15.0721 3.1747 15.0729 3.25633 15.0902C3.33797 15.1075 3.41529 15.141 3.4837 15.1888C3.59818 15.2212 3.6997 15.1564 3.71482 15.3278C3.75706 15.6193 3.74706 15.916 3.6853 16.204C3.75226 16.3991 3.65434 16.546 3.5845 16.7224C3.5845 16.9845 3.58882 17.2487 3.5989 17.5072C3.69297 17.6812 3.73307 17.8792 3.7141 18.076C3.67558 18.4927 3.67558 18.9121 3.7141 19.3288C3.7897 19.4361 3.87394 19.5275 3.7717 19.6456C3.70641 19.9586 3.66787 20.2765 3.6565 20.596C3.66188 20.7411 3.63737 20.8857 3.5845 21.0208C3.60723 21.088 3.61219 21.1599 3.5989 21.2296C3.61278 21.5998 3.59834 21.9705 3.5557 22.3384C3.5413 22.5256 3.6349 22.7056 3.6205 22.8928C3.6133 23.0512 3.5269 23.2024 3.5557 23.3608C3.64262 23.5269 3.68246 23.7137 3.6709 23.9008C3.68724 23.9221 3.69896 23.9466 3.7053 23.9727C3.71164 23.9988 3.71247 24.0259 3.70772 24.0524C3.70298 24.0788 3.69277 24.1039 3.67775 24.1262C3.66273 24.1484 3.64323 24.1673 3.6205 24.1816C3.53626 24.466 3.70114 24.7835 3.7321 25.0723C3.77608 25.3665 3.7646 25.6664 3.69826 25.9564C3.27778 26.0471 2.67442 25.9183 2.23162 26.0551C2.04915 26.1091 1.85958 26.1353 1.6693 26.1328C1.60594 26.1803 1.53538 26.153 1.4605 26.1472C1.3958 26.1622 1.3349 26.1904 1.28162 26.2301C1.22834 26.2697 1.18383 26.3199 1.1509 26.3776C1.1221 26.4496 1.1725 26.5216 1.1725 26.5864C1.2445 26.788 1.61458 26.8586 1.8061 26.9176C2.13457 26.9004 2.46387 26.927 2.7853 26.9968C2.97466 26.9306 3.10714 27.0292 3.2749 27.0976C3.51322 27.0976 3.76594 27.0933 4.0021 27.0832C4.33474 26.8859 4.69186 27.0112 5.0461 26.9896C5.26471 27.0018 5.48397 26.9946 5.7013 26.968C5.80066 26.9025 5.88562 26.8017 5.9965 26.9176C6.1837 27.0328 6.4213 26.9464 6.6301 26.9896C6.84892 27.006 7.0658 27.0421 7.2781 27.0976C7.34296 27.0756 7.41238 27.0707 7.4797 27.0832C7.8235 27.0694 8.16787 27.0838 8.5093 27.1264C8.6821 27.148 8.8549 27.0544 9.0277 27.0616C9.1789 27.0688 9.3229 27.1552 9.4669 27.1264C9.87658 26.9407 9.73258 27.0811 10.1077 26.968C10.4418 27.2747 10.922 26.8895 11.3101 26.932C11.4541 26.9788 11.4887 26.9162 11.8429 26.9968C12.0229 26.9291 12.164 27.0292 12.3253 27.0976C12.5687 27.0976 12.8142 27.0933 13.0597 27.0832C13.2191 26.9922 13.4025 26.9521 13.5853 26.968C13.9254 26.994 14.2668 27.0012 14.6077 26.9896C14.7459 27.0335 14.8237 26.8787 14.9389 26.86C15.1866 27.0227 15.3939 26.9608 15.6805 26.9889C15.8994 27.0054 16.1162 27.0418 16.3285 27.0976C16.5603 27.0479 16.8037 27.1415 17.0413 27.076C17.218 27.0674 17.395 27.0844 17.5669 27.1264C17.7397 27.148 17.9053 27.0544 18.0853 27.0616C18.2031 27.11 18.3303 27.1313 18.4574 27.1238C18.5846 27.1163 18.7084 27.0803 18.8197 27.0184C19.0933 27.0602 19.1005 26.8636 19.2877 27.0616C19.634 27.1747 20.0077 26.8982 20.3605 26.932C20.5247 26.9795 20.5362 26.9162 20.8933 26.9968C21.0733 26.9291 21.2144 27.0292 21.3757 27.0976C21.6119 27.0976 21.8682 27.0933 22.1101 27.0832C22.2717 26.9911 22.4577 26.9509 22.6429 26.968C22.9806 26.9944 23.3196 27.0016 23.6581 26.9896C23.7971 27.0335 23.8784 26.8787 23.9893 26.86C24.2377 27.0227 24.4443 26.9608 24.7309 26.9889C24.952 27.0062 25.1712 27.0425 25.3861 27.0976C25.6172 27.0479 25.8613 27.1415 26.0989 27.076C26.2732 27.0678 26.4478 27.0847 26.6173 27.1264C26.7901 27.148 26.9629 27.0544 27.1357 27.0616C27.2797 27.0688 27.4237 27.1552 27.5677 27.1264C27.7259 27.0461 27.9016 27.0065 28.0789 27.0112C28.1948 26.9392 28.2488 26.9702 28.3381 27.0616C28.683 27.1617 29.0394 26.9284 29.3915 26.9176C29.5439 26.8665 29.7074 26.8578 29.8645 26.8924C30.0654 26.8204 30.4002 26.7599 30.4909 26.5612C30.4909 26.4892 30.5413 26.4172 30.5197 26.3452C30.486 26.2874 30.4403 26.2376 30.3857 26.1991C30.331 26.1605 30.2686 26.1343 30.2029 26.122C30.1453 26.1148 30.0949 26.1436 30.0373 26.122C29.7407 26.05 29.4123 26.104 29.1056 26.0212C28.8313 25.9262 28.598 26.1155 28.3453 26.1436C28.2258 26.0867 27.9968 26.1573 27.9774 25.9939C27.9389 25.747 27.9389 25.4956 27.9774 25.2487C28.0493 24.8929 28.0184 24.524 27.8881 24.1852C27.9121 24.0278 27.9266 23.8691 27.9313 23.71C27.9705 23.5679 27.9655 23.4172 27.9169 23.278C28.0232 22.9483 28.0552 22.5991 28.0105 22.2556C28.0942 21.9635 28.0917 21.6535 28.0033 21.3628C28.0148 20.5982 28.0753 19.8659 28.0825 19.102C28.1545 18.5411 27.9968 18.017 28.0537 17.4604C28.1048 16.7174 27.9875 15.9369 28.04 15.2061C28.1012 15.1118 28.2157 15.1881 28.3057 15.178C28.5925 15.1072 28.8835 15.0543 29.1769 15.0196C29.7486 15.0563 30.6911 15.2032 30.8084 14.4328ZM3.00922 10.6557C2.96818 10.5607 3.1489 10.4937 3.2173 10.4555C3.45392 10.2052 3.72265 9.9873 4.0165 9.80754C4.47154 9.52386 4.82218 9.12786 5.2981 8.88594C5.39386 8.79882 5.45146 8.66562 5.5429 8.58354C5.70774 8.53527 5.85361 8.43718 5.9605 8.30274C6.0325 8.20194 6.0829 8.06514 6.1837 8.00034C6.36658 7.92042 6.51634 7.78434 6.7021 7.71954C6.7741 7.66914 6.8029 7.58274 6.8749 7.53234C7.12272 7.46518 7.3518 7.34202 7.5445 7.17234C7.62945 7.08021 7.73962 7.0151 7.8613 6.98514C8.1097 6.90018 8.21338 6.63234 8.4229 6.50274C8.9665 6.13338 9.49282 5.78922 10.0357 5.41554C10.3362 5.24529 10.6062 5.02631 10.8349 4.76754C11.39 4.42266 11.8767 3.96978 12.4333 3.63714C12.5175 3.5493 12.5881 3.42618 12.6709 3.34914C12.8362 3.29378 12.9831 3.19417 13.0957 3.06114C13.1677 2.96034 13.2109 2.82354 13.3189 2.75874C13.4557 2.7033 13.563 2.61042 13.6933 2.54274C13.8373 2.51394 13.9093 2.38722 14.0029 2.29002C14.3084 2.20464 14.5863 2.0411 14.8093 1.81554C15.0297 1.75 15.2238 1.61643 15.3637 1.43394C15.5156 1.28274 15.7453 1.00194 15.9555 1.21146C16.137 1.37202 16.3314 1.51674 16.5229 1.66434C16.778 1.89627 17.0669 2.08806 17.3797 2.23314C17.7195 2.46282 18.0126 2.77458 18.3733 2.98194C18.5841 3.10151 18.7758 3.25198 18.9421 3.42834C18.9925 3.46434 19.0717 3.45714 19.1221 3.49314C19.1725 3.52914 19.2517 3.52194 19.2877 3.56514C19.5181 3.90138 19.7471 3.8445 20.0437 4.00434C20.1446 4.11027 20.2529 4.20892 20.3677 4.29954C20.4397 4.43058 20.5779 4.45722 20.6917 4.52274C20.8357 4.73845 21.0248 4.92025 21.2461 5.05554C21.3601 5.11357 21.4569 5.20045 21.5269 5.30754C21.6846 5.51346 21.9589 5.5473 22.1533 5.69634C22.8973 6.36031 23.6944 6.96232 24.5365 7.49634C24.9543 7.83506 25.3893 8.15204 25.8397 8.44602C25.9546 8.58811 26.1066 8.69554 26.2789 8.75634C26.523 8.81106 26.6245 9.09402 26.8837 9.16674C27.0105 9.18817 27.1324 9.23206 27.2437 9.29634C27.3819 9.45474 27.5756 9.5685 27.7045 9.73554C27.7876 9.75857 27.8654 9.79777 27.9333 9.8509C28.0013 9.90402 28.0581 9.97003 28.1005 10.0451C28.2942 10.3331 28.6556 10.4195 28.8551 10.6931C28.9314 10.817 28.8414 10.781 28.7629 10.7947C28.575 10.8602 28.4461 10.763 28.2805 10.6939C28.1628 10.6843 28.0443 10.6891 27.9277 10.7083C27.6066 10.6183 27.3395 10.8695 27.0277 10.8235C26.6424 10.7813 26.2538 10.7813 25.8685 10.8235C25.8109 10.8523 25.7605 10.9315 25.6885 10.9315C25.4574 10.768 25.2248 10.8314 24.9541 10.8019C24.7755 10.7371 24.5941 10.8019 24.4285 10.7299C24.3212 10.6579 24.2255 10.7342 24.1117 10.7083C23.9424 10.6783 23.7689 10.6807 23.6005 10.7155C23.4285 10.7241 23.2563 10.7071 23.0893 10.6651C22.9165 10.6435 22.7509 10.7371 22.5709 10.7299C22.4269 10.7227 22.2829 10.6363 22.1461 10.6651C21.9908 10.7456 21.8167 10.7829 21.6421 10.7731C21.5154 10.8415 21.483 10.8364 21.3829 10.7299C21.0337 10.6175 20.6708 10.8919 20.3173 10.8595C20.2302 10.8184 20.1171 10.8523 20.0293 10.8451C19.8958 10.7955 19.7508 10.7855 19.6117 10.8163C19.3323 10.7183 19.2834 10.6456 18.9565 10.7083C18.7555 10.6729 18.5485 10.7032 18.3661 10.7947C17.9272 10.8177 17.4874 10.8177 17.0485 10.7947C16.911 10.7644 16.8325 10.9099 16.7173 10.9315C16.5013 10.7709 16.2471 10.8292 15.9829 10.8019C15.7666 10.7842 15.5522 10.7481 15.3421 10.6939C15.111 10.7443 14.8727 10.6427 14.6365 10.7155C14.4622 10.7241 14.2875 10.7071 14.1181 10.6651C13.9453 10.6435 13.7797 10.7371 13.6069 10.7299C13.4904 10.6811 13.3643 10.6596 13.2383 10.6671C13.1122 10.6746 12.9896 10.7108 12.8797 10.7731C12.5787 10.7248 12.5917 10.9264 12.4117 10.7299C12.0625 10.6175 11.6996 10.8919 11.3461 10.8595C11.2597 10.8184 11.1459 10.8523 11.0581 10.8451C10.9246 10.7955 10.7796 10.7855 10.6405 10.8163C10.5325 10.8091 10.4461 10.7227 10.3381 10.6939C10.0991 10.6939 9.85354 10.6939 9.6109 10.7083C9.11338 10.9689 8.46466 10.6946 7.9333 10.8235C7.83394 10.8883 7.7497 10.9891 7.6381 10.8739C7.47322 10.7716 7.10098 10.8343 6.7597 10.7651C6.62647 10.7688 6.49397 10.7443 6.3709 10.6931C6.308 10.7124 6.24156 10.7174 6.1765 10.7075C5.8327 10.7193 5.4885 10.7049 5.1469 10.6643C4.9741 10.6427 4.8085 10.7363 4.6357 10.7291C4.4845 10.7219 4.3477 10.6355 4.2037 10.6643C4.08877 10.7298 3.961 10.7695 3.82923 10.7806C3.69745 10.7918 3.56482 10.7743 3.4405 10.7291C3.32242 10.6492 3.0769 10.804 3.00922 10.6557ZM9.56698 26.0277C9.46114 26.1717 8.7649 25.9845 8.6245 26.0003C8.49699 26.0247 8.36531 26.0147 8.2429 25.9715C8.02828 25.9385 7.80892 25.9558 7.6021 26.0219C7.34458 26.0267 7.08707 26.0123 6.8317 25.9787C6.21826 25.9867 5.58034 25.942 4.9597 25.9211C4.8553 25.9089 4.5853 26.0119 4.61914 25.8247C4.56874 25.4042 4.7329 24.9931 4.6501 24.5819C4.54046 24.3049 4.51786 24.001 4.5853 23.7107C4.6573 23.5667 4.5853 23.4227 4.5709 23.2787C4.77682 22.7027 4.59898 22.5047 4.7149 22.0475C4.7869 21.7797 4.6429 21.5054 4.6573 21.2411C4.64866 20.9035 4.72426 20.5823 4.6861 20.2619C4.74545 19.3295 4.75266 18.3944 4.7077 17.4611C4.7509 16.6994 4.6573 15.9175 4.6933 15.1622C4.8661 14.9159 5.5753 15.1809 5.8741 15.0635C5.97634 14.9843 6.04762 14.8929 6.1693 15.0059C6.3493 15.1211 6.5797 15.0347 6.7885 15.0779C7.00241 15.0957 7.2144 15.1318 7.4221 15.1859C7.4858 15.1714 7.55135 15.1665 7.6165 15.1715C7.95812 15.1584 8.30023 15.1753 8.6389 15.2219C8.9089 15.2219 9.3589 15.0059 9.53386 15.3098C9.67786 15.6748 9.49354 16.0391 9.5461 16.3955C9.5389 16.5107 9.4525 16.6043 9.4237 16.7195C9.4237 16.9816 9.42802 17.2459 9.4381 17.5043C9.56128 18.0498 9.5905 18.6123 9.5245 19.1675C9.49354 19.3072 9.64114 19.408 9.6613 19.5203C9.55076 19.7714 9.50615 20.0464 9.5317 20.3195C9.51335 20.5547 9.47725 20.7882 9.4237 21.0179C9.47482 21.2635 9.37258 21.5219 9.4453 21.7739C9.39141 22.1444 9.39627 22.521 9.4597 22.8899C9.4525 23.0483 9.3661 23.1995 9.3949 23.3579C9.47696 23.5256 9.51417 23.7116 9.5029 23.8979C9.5425 24.0362 9.55546 24.0211 9.4885 24.1391C9.30634 24.6647 9.79378 25.3264 9.56698 26.0277ZM15.3615 25.9723C14.7442 25.9127 14.1224 25.9173 13.5061 25.9859C12.8379 25.9399 12.1619 26.0248 11.4973 25.9499C11.3907 25.9687 11.2309 26.0457 11.1301 26.0507C10.9924 26.0087 10.848 25.9936 10.7046 26.0061C10.5966 26.0219 10.4929 26.1019 10.4418 25.973C10.4119 25.696 10.4141 25.4164 10.4483 25.1399C10.5923 24.6957 10.4483 24.5855 10.3763 24.1859C10.4339 23.9779 10.3971 23.759 10.4627 23.5451C10.4032 23.379 10.4083 23.1965 10.4771 23.0339C10.5944 22.7049 10.4497 22.3687 10.5491 22.0475C10.5133 21.5442 10.5109 21.0391 10.5419 20.5355C10.5949 19.6867 10.5925 18.8353 10.5347 17.9867C10.5791 17.1226 10.5618 16.2564 10.4828 15.3947C10.4461 15.1348 10.575 15.1751 10.7622 15.1341C10.9227 15.0995 11.2215 14.9534 11.3843 15.0189C11.4714 15.0599 11.5851 15.0254 11.6723 15.0333C11.8055 15.0844 11.9509 15.0944 12.0899 15.0621C12.1907 15.0967 12.2893 15.1376 12.3851 15.1845C12.6251 15.1945 12.8656 15.1897 13.1051 15.1701C13.2654 15.0816 13.448 15.0416 13.6307 15.0549C14.0111 15.0951 14.3946 15.0975 14.7755 15.0621C14.8403 15.0261 14.8835 14.9469 14.9555 14.9469C15.1902 15.1132 15.4206 14.9771 15.4386 15.2111C15.4445 15.4545 15.437 15.698 15.4163 15.9405C15.3657 16.0863 15.3557 16.2431 15.3875 16.3941C15.2745 16.6109 15.2341 16.8582 15.2723 17.0997C15.2384 17.3155 15.271 17.5365 15.3659 17.7333C15.4523 18.256 15.3003 18.7982 15.3875 19.3245C15.4688 19.439 15.5559 19.5131 15.4451 19.6413C15.381 19.9543 15.3449 20.2723 15.3371 20.5917C15.3579 20.8689 15.2391 20.8847 15.2795 21.2253C15.2946 21.5957 15.2777 21.9666 15.2291 22.3341C15.2147 22.5213 15.3083 22.7013 15.3011 22.8885C15.2584 23.0408 15.2366 23.1983 15.2363 23.3565C15.3202 23.5235 15.3575 23.7101 15.3443 23.8965C15.3599 23.9178 15.3711 23.9419 15.3774 23.9675C15.3837 23.9932 15.3848 24.0198 15.3808 24.0458C15.3768 24.0719 15.3677 24.097 15.354 24.1195C15.3403 24.1421 15.3223 24.1617 15.3011 24.1773C15.1765 24.628 15.6423 25.4668 15.3615 25.9723ZM21.2324 25.9435C21.0207 26.1191 20.6082 25.8535 20.3605 26.0075C20.1351 26.104 19.9069 25.9355 19.6621 26.0291C19.5467 26.087 19.4227 26.1259 19.2949 26.1443C19.1483 26.1119 18.9987 26.095 18.8485 26.0939C18.7095 26.0255 18.5843 26.0889 18.4453 26.1083C17.9226 25.9111 17.7426 26.068 17.2933 25.9715C16.9743 25.8686 16.6021 26.1307 16.3033 25.9888C16.2806 25.7736 16.2738 25.557 16.2831 25.3408C16.2831 25.0838 16.4149 24.8368 16.3285 24.5798C16.2662 24.4559 16.2272 24.3217 16.2133 24.1838C16.2572 23.9743 16.2399 23.7554 16.2925 23.543C16.239 23.3754 16.2466 23.1942 16.3141 23.0318C16.4329 22.7035 16.2839 22.3643 16.3861 22.0454C16.4646 21.7761 16.3242 21.5061 16.3285 21.239C16.3832 20.3296 16.3926 19.439 16.4365 18.5246C16.3584 17.6315 16.3464 16.7338 16.4005 15.839C16.3417 15.6473 16.3107 15.4483 16.3083 15.2479C16.3083 15.1204 16.5186 15.1708 16.5848 15.1795C16.9006 15.1545 17.2183 15.168 17.5309 15.2198C17.7037 15.2342 17.8693 15.1406 18.0421 15.1478C18.1822 15.1904 18.3277 15.2122 18.4741 15.2126C18.6249 15.1269 18.7982 15.0893 18.9709 15.1046C19.0796 15.0427 19.1315 15.0527 19.2301 15.1478C19.5663 15.263 19.9386 14.9822 20.2813 15.0182C20.3627 15.0578 20.4843 15.0254 20.5621 15.0326C20.6399 15.0398 20.7133 15.0974 20.8069 15.083C20.9005 15.0686 21.0603 15.0347 21.1381 15.1103C21.2466 15.3724 21.2839 15.6586 21.2461 15.9398C21.2009 16.0866 21.1911 16.242 21.2173 16.3934C21.1094 16.6118 21.0716 16.8583 21.1093 17.099C21.0738 17.3148 21.1066 17.5363 21.2029 17.7326C21.2285 18.0296 21.2285 18.3283 21.2029 18.6254C21.1923 18.8584 21.1995 19.0919 21.2245 19.3238C21.2605 19.3958 21.3397 19.4462 21.3325 19.5182C21.2299 19.7714 21.188 20.0451 21.2101 20.3174C21.1908 20.5529 21.1523 20.7865 21.0949 21.0158C21.1503 21.2599 21.0524 21.5198 21.1165 21.7718C21.1287 21.9605 21.1117 22.1499 21.0661 22.3334C21.0517 22.5206 21.1453 22.7006 21.1309 22.8878C21.0863 23.0153 21.0678 23.1505 21.0764 23.2853C21.0851 23.4201 21.1207 23.5518 21.1813 23.6726C21.1658 23.7967 21.1806 23.9227 21.2245 24.0398C21.1741 24.1579 21.0697 24.2176 21.1093 24.3782C21.2517 24.887 21.2935 25.4187 21.2324 25.9435ZM26.7253 26.0003C26.6002 26.0245 26.4709 26.0145 26.3509 25.9715C26.1363 25.938 25.9168 25.9553 25.7101 26.0219C24.8209 25.9917 23.9569 25.9564 23.0605 25.9211C22.8308 25.8599 22.2635 26.176 22.1749 25.8815C22.2184 25.3134 22.1772 24.7419 22.0525 24.1859C22.0921 23.9771 22.082 23.7583 22.1317 23.5451C22.1317 23.4515 22.0813 23.3723 22.0813 23.2787C22.1883 22.9492 22.2203 22.5999 22.1749 22.2563C22.254 22.0165 22.2615 21.7588 22.1965 21.5147C22.1707 21.0036 22.1779 20.4913 22.2181 19.9811C22.3211 19.0207 22.1965 18.2438 22.2181 17.4611C22.2721 16.9291 22.1461 16.3703 22.2397 15.8411C22.1888 15.6282 22.1553 15.4115 22.1396 15.1931C22.1605 14.9879 22.3729 15.0333 22.5205 15.0549C22.6873 15.08 22.8562 15.0873 23.0245 15.0765C23.2404 15.0944 23.4576 15.0896 23.6725 15.0621C23.7301 15.0261 23.7805 14.9469 23.8525 14.9469C24.0685 15.1103 24.3212 15.0463 24.5797 15.0765C24.796 15.0945 25.0103 15.1306 25.2205 15.1845C25.4487 15.1399 25.6871 15.232 25.9189 15.1629C26.0912 15.1567 26.2635 15.1761 26.4301 15.2205C26.6295 15.2371 26.96 15.0182 27.0623 15.2925C27.1933 15.6525 27.0047 16.0449 27.0565 16.3948C26.9402 16.6105 26.9021 16.8598 26.9485 17.1004C26.8599 17.4482 27.1112 17.7369 27.0637 18.0724C27.0381 18.4366 27.0309 18.8019 27.0421 19.1668C26.9989 19.354 27.2819 19.4786 27.1141 19.642C27.0561 19.9559 27.02 20.2735 27.0061 20.5924C27.0118 20.7375 26.9873 20.8821 26.9341 21.0172C26.9569 21.0844 26.9618 21.1563 26.9485 21.226C26.9624 21.5962 26.9479 21.9669 26.9053 22.3348C26.8837 22.522 26.9845 22.702 26.9701 22.8892C26.9211 23.0159 26.9002 23.1516 26.9089 23.2872C26.9176 23.4227 26.9557 23.5547 27.0205 23.674C27.0052 23.7981 27.02 23.9241 27.0637 24.0412C27.0083 24.1651 26.906 24.2104 26.9485 24.3796C27.0735 24.908 27.1112 25.4533 27.0601 25.9939C27.0313 26.0349 26.7894 25.996 26.7253 26.0003ZM29.8393 13.9965C29.7623 14.1643 29.5182 14.0577 29.3821 14.0483C29.3101 14.0411 29.2453 14.0987 29.1805 14.0987C29.1157 14.0987 29.0581 14.1563 29.0005 14.1419C28.836 14.0844 28.6581 14.0769 28.4893 14.1203C28.1871 14.2461 27.8497 14.2589 27.5389 14.1563C27.2099 14.2701 26.8909 14.0123 26.5381 14.0915C26.2566 14.1434 25.97 13.9706 25.6813 14.0843C25.3829 14.1339 25.078 14.129 24.7813 14.0699C24.1815 14.0858 23.5472 14.0318 22.9381 14.0123C22.6154 14.0726 22.2864 14.092 21.9589 14.0699C21.4643 14.0217 20.9646 14.1283 20.4685 14.0483C20.4109 14.0411 20.3461 14.0987 20.2813 14.0987C20.2165 14.0987 20.1589 14.1563 20.1013 14.1419C19.9368 14.0844 19.7589 14.0769 19.5901 14.1203C19.2906 14.2469 18.9552 14.2597 18.6469 14.1563C18.494 14.21 18.3262 14.2023 18.1789 14.1347C17.943 14.0786 17.6985 14.0688 17.4589 14.1059C17.1903 14.0266 16.9038 14.0316 16.6381 14.1203C15.7741 14.0793 14.9144 14.0519 14.0389 14.0123C13.3391 14.1283 12.6356 14.0332 11.9221 14.0843C11.6842 14.03 11.4354 14.0501 11.2093 14.1419C10.7694 13.9598 10.5519 14.3104 10.1725 14.2067C10.0295 14.2055 9.88703 14.1886 9.7477 14.1563C9.59478 14.2099 9.42703 14.2022 9.2797 14.1347C8.98378 14.0159 8.66554 14.1664 8.3725 14.0627C8.16208 14.0322 7.94741 14.0519 7.7461 14.1203C7.49317 14.1233 7.24039 14.1065 6.9901 14.0699C6.38386 14.0858 5.7589 14.0318 5.1397 14.0123C4.56094 14.072 3.97873 14.0912 3.3973 14.0699C3.15733 14.0926 2.91547 14.0854 2.6773 14.0483C2.6125 14.0411 2.5477 14.0987 2.4901 14.0987C2.4325 14.0987 2.3605 14.1563 2.2957 14.1419C2.17996 14.1102 2.06072 14.0931 1.94074 14.0908C1.6585 14.1628 1.70818 13.7164 1.7557 13.5515C1.81206 13.3035 1.82182 13.0471 1.7845 12.7955C1.85306 12.5638 1.8605 12.3182 1.8061 12.0827C1.5937 11.2324 2.68594 11.9445 3.0733 11.7587C3.18581 11.7 3.30758 11.661 3.4333 11.6435C3.63562 11.7004 3.83074 11.6651 4.0309 11.7299C4.10566 11.6998 4.18586 11.6856 4.26641 11.688C4.34697 11.6905 4.42613 11.7097 4.4989 11.7443C4.79914 11.8603 5.11522 11.7177 5.4133 11.8163C5.66746 11.9049 5.91154 11.7407 6.1621 11.7659C6.46882 11.7566 6.76762 11.8329 7.0621 11.7947C7.9249 11.8535 8.79044 11.8607 9.6541 11.8163C10.1581 11.8646 10.6556 11.7443 11.1589 11.8307C11.2763 11.8221 11.4109 11.7422 11.5261 11.7371C11.8803 11.8739 12.0798 11.7055 12.4045 11.6435C12.5492 11.6726 12.6962 11.6894 12.8437 11.6939C12.9763 11.7314 13.1173 11.7263 13.2469 11.6795C13.7574 11.8761 13.9403 11.7199 14.3845 11.8163C14.6379 11.9049 14.882 11.7407 15.1333 11.7659C15.9707 11.8099 16.7936 11.8264 17.6389 11.8667C17.9647 11.8123 18.2957 11.7954 18.6253 11.8163C19.1293 11.8653 19.6261 11.7443 20.1229 11.8307C20.2489 11.8228 20.3771 11.7436 20.4973 11.7371C20.6643 11.7948 20.8445 11.8023 21.0157 11.7587C21.0925 11.7085 21.1792 11.6755 21.2699 11.6618C21.3606 11.6481 21.4531 11.6542 21.5413 11.6795C21.7839 11.6687 21.9733 11.7652 22.2109 11.6795C22.5159 11.7852 22.8416 11.8173 23.1613 11.7731C23.3822 11.8475 23.6201 11.855 23.8453 11.7947C24.2314 11.7724 24.6184 11.7724 25.0045 11.7947C26.1363 11.8927 27.2444 11.8163 28.3741 11.8091C28.6751 11.7371 28.9897 11.8883 29.2748 11.7803C29.3151 11.6817 29.457 11.6918 29.5434 11.6781C30.0222 11.5247 29.7659 12.1353 29.8141 12.4067C29.7327 12.9453 29.9127 13.468 29.8393 13.9965Z",fill:"black"}))}}),Lp=Ot({base:{display:"flex",flexDirection:{base:"row",sm:"column"},alignItems:{base:"center",sm:"start"},justifyContent:"flex-start",textAlign:"start",gap:"4px",maxWidth:"100%",flexWrap:"wrap",minWidth:0},variants:{active:{true:{flexDirection:"column-reverse",alignItems:"start"},false:{flexDirection:{base:"column"},alignItems:{base:"start"}}}}});function Op({accountName:e,accountNo:t,syncText:n,active:r=!0}){const a=t?`${e} ${fd(t)}`:e;return N("div",{className:Lp({active:r}),children:[n&&I(ya,{intent:r?"normal":"danger",children:n}),I(kl,{wrap:"ellipsis",children:a})]})}const Fp=e=>["plaidInstitutionLogo",e??{}];function Bp(e){const t=Ln(),n=Vn();return M({queryKey:Fp({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await nd({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const Up=Rt({display:"flex",gap:"10px",maxWidth:"100%"});function Vp({accountName:e,accountNo:t,institutionId:n,syncText:r,active:a=!0,showIcon:o=!0}){const i=Bp(n);return N("div",{className:Up,children:[i&&o?I("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):I(Ls,{Component:Dp}),I(Op,{accountName:e,accountNo:t,active:a,syncText:r})]})}const Wp=Ot({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function Hp({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=jt("vertical"===e?Bt["vertical-divider"]:Bt["horizontal-divider"],n,Wp({alignment:e,color:t}));return I("div",{...r})}const qp=Rt({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function jp({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return I(hl,{...r,disabled:n,width:"fill-parent",children:I(_h,{children:e?yd(e.name,e.mask):N("div",{className:qp,children:[I(kl,{children:t}),I(Lo,{Component:$i})]})})})}const zp="TRIGGER_ACCOUNT",Kp="FORM_SELECTABLE_ACCOUNT",Yp=Rt({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function _p({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:a,warningMessage:o}){return N("div",{className:Yp,children:[N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(jp,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===zp?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),I(Ah,{bankAccounts:r,isFilling:a,onClick:t})]}),o&&I(tu,{errorMessage:o})]})}const Zp=(e,t,n)=>{if(!n)return;const r=e===Kp?t:n,a=e===Kp?n:t,o=(i=r?.mask,l=a?.mask,!i||!l||i!==l);var i,l;const s=(c=r?.apiName,d=a?.apiName,Wd(c)&&Vd(d));var c,d;const u=(h=r?.status,p=a?.status,"ACTIVE"===h&&"INACTIVE"===p);var h,p;return o?"Selected account number does not match destination account number":s?"Merging a linked account into a manually tracked account may result in duplicate transactions":u?"You selected an active account to be merged into an archived account":void 0},Gp=Rt({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),Qp=Rt({display:{base:"block",sm:"none"}}),Xp=Rt({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),Jp=Rt({display:"flex",justifyContent:"center",alignItems:"center"}),$p=Rt({display:{base:"none",sm:"block"}}),eg=Rt({display:{base:"block",sm:"none"}});function tg({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:a}){const o=n&&n.length>0;return N("div",{className:Gp,children:[N("div",{className:Xp,children:[o?I(_p,{selectedAccount:t,setSelectedAccount:a,mergeDestination:zp,bankAccounts:n,isFilling:r,warningMessage:Zp(zp,e,t??null)}):I(jp,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),N("div",{className:Jp,children:[I("div",{className:$p,children:I(Yc,{Component:No})}),I("div",{className:eg,children:I(Yc,{Component:fu})})]}),I(Vp,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""})]}),I("div",{className:Qp,children:I(Hp,{alignment:"horizontal"})})]})}const ng=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await $o(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Hi({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:a}};function rg(){return Wn({queryKey:["expenses/vendors"],queryFn:ng})}const ag=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:Wr(n)};return await Or(r)},og=Dt(Gt({body:"default"}),Rt({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),ig=Rt({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),lg=jt(Bt["button-inline"],Rt({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"}));function sg({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:a,inputRef:o}){return N("div",{className:ig,children:[I("input",{ref:o,type:"text",placeholder:e,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r()):"Escape"===e.key&&(e.preventDefault(),a())},onFocus:e=>{e.stopPropagation()},className:og}),I("button",{type:"button",onClick:r,...lg,children:I(ya,{children:"Add"})})]})}function cg({promptText:e,placeholderText:t,onSubmit:n}){const[r,a]=f(!1),[o,i]=f(""),l=g(null);return x(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),I(bh,{onClick:r?void 0:()=>{a(!0)},children:r?I(sg,{placeholder:t,value:o,onChange:i,onSubmit:()=>{o.trim()&&(n(o.trim()),i(""),a(!1))},onCancel:()=>{i(""),a(!1)},inputRef:l}):I(fh,{promptText:e})})}const dg={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function ug({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:a}){const o=m(()=>new Te(e??[],dg),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?I(kh,{}):N(S,{children:[I(cg,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:a}),0===i.length?I(yh,{text:"No results found"}):i.map(e=>I(bh,{onClick:()=>n(e),children:I(kl,{children:e.name})},e.id))]})}function hg({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?I(kh,{}):N(S,{children:[I(cg,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>I(bh,{onClick:()=>t(e),children:I(kl,{children:e.name})},e.id))]})}function pg({onClick:e}){const{query:{data:t,isLoading:n}}=rg(),{mutate:r}=Rd({mutationFn:ag,onSuccess:async()=>Bn.invalidateQueries({queryKey:["expenses/vendors"]})}),a=t?.data??[];return I(mh,{onClick:e,placeholder:"Search vendors...",SearchList:ug,DefaultList:hg,extraProps:{vendors:a,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:a.length})}const gg=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await $o(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Hi({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:a}};function mg(){return Wn({queryKey:["clientMgmt/clients"],queryFn:gg})}const vg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:Wr(n)};return await Or(r)},Cg={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function bg({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:a}){const o=m(()=>new Te(e??[],Cg),[e]),i=m(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?I(kh,{}):N(S,{children:[I(cg,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:a}),0===i.length?I(yh,{text:"No results found"}):i.map(e=>I(bh,{onClick:()=>n(e),children:I(kl,{children:e.name})},e.id))]})}function fg({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?I(kh,{}):N(S,{children:[I(cg,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>I(bh,{onClick:()=>t(e),children:I(kl,{children:e.name})},e.id))]})}function yg({onClick:e}){const{query:{data:t,isLoading:n}}=mg(),{mutate:r}=Rd({mutationFn:vg,onSuccess:async()=>Bn.invalidateQueries({queryKey:["clientMgmt/clients"]})}),a=t?.data??[];return I(mh,{onClick:e,placeholder:"Search customers...",SearchList:bg,DefaultList:fg,extraProps:{customers:a,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:a.length})}function xg({frequencies:e,onClick:t}){const n=Ul();return I(Gl,{children:I(uh,{children:e.map(e=>I(bh,{onClick:()=>(t(e),void n.close()),children:I(ba,{children:e.name})},e.value))})})}const{useAppForm:kg,withForm:Tg}=xe({formContext:Yd,fieldContext:_d,formComponents:{SaveButton:Xd},fieldComponents:{DiscreteAmountField:function({label:e}){const t=g(null),n=Zd();return I(lu,{inputRef:t,label:e,children:I(pu,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const n=g(null),r=Zd();return I(vu,{inputRef:n,label:e,children:I(pu,{value:r.state.value,onChange:r.handleChange,inputRef:n,autofocus:t})})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:a=!1}){const o=Zd(),i=ye(o.store,e=>e.meta.isDefaultValue),l=g(null),[s,c]=f(()=>o.state.value?bn(o.state.value):/* @__PURE__ */new Date),d=o.state.value?bn(o.state.value):null,[u,h]=f(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const a=Cn(r);if(a){let e=a;t&&n?e=xn(yn(a,t),n):t?e=yn(a,t):n&&(e=xn(a,n)),o.handleChange(fn(e)),c(e)}else o.handleChange("")},m=u||(d?mn(d):""),[v,C]=f(!1),b=e=>{v&&(()=>{if(d&&!i){const e=Cn(u);(t&&e&&gn(e,t)||n&&e&&gn(n,e))&&h(mn(d))}})(),C(e)},y=e=>{"Enter"===e.key&&(e.preventDefault(),b(!v))},x=a?vu:lu;return N(Bl,{placement:"bottom-start",onOpenChange:b,open:v,children:[I(Vl,{children:t=>I(x,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>C(!0),children:I("input",{...Ou,ref:l,type:"text",id:o.name,value:m,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:y,autoComplete:"off"})})}),I(Gl,{initialFocus:!1,children:I(Lu,{selectedDate:d,onDateSelect:e=>{o.handleChange(fn(e)),h(mn(e)),c(e)},viewDate:s,onViewDateChange:c,maxDate:t,minDate:n})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:n=!1,resizeable:r=!0}){const a=Zd(),o=g(null);return I(vu,{label:e,inputRef:o,children:I("textarea",{...Fu,ref:o,value:a.state.value||"",onChange:e=>a.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:r?"both":"none"},autoFocus:n})})},MessageAreaInput:$u,SplitExpenseCategoryField:function({value:e,onChange:t}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>N("button",{...sp,...t,type:"button",children:[e&&I("img",{src:e.iconUrl,alt:void 0,width:"15px",height:"15px"}),I(ba,{stylists:[cp],children:e?.name||"Uncategorized"})]})}),I(lp,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,a]=f(!1);return I("div",{...dp,"data-clicked":r,children:I(pu,{value:e,onChange:t,onClick:()=>a(!0),onBlur:()=>(a(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Zd(),r=Ph(t.id),{query:{data:a},isFilling:o}=Ad({select:e=>({...e,data:Lh(e?.data)})}),i=a?.data,l=Sn(e)||!nh(e);return I(Sh,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:o})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Zd(),{query:{data:r}}=mp(),a=function(e){const{query:t}=Ad({select:t=>({...t,data:Nh(t.data,e)})});return t.data?.data}(t?.id),{query:{data:o},isFilling:i}=Ad({select:e=>{return{...e,data:(t=e?.data,t?.filter(e=>"ACTIVE"===e.status&&e.isSupported&&e.glAccountId))};var t}}),l=o?.data,s=e?Hd(e.amount):"";return I(Sh,{label:s,onClick:e=>{const t=(a=r,o=e,a?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===o.glAccountId));var a,o,i;t&&n({id:(i=t).id||"",name:i.name,accountNo:i.accountNo})},bankAccount:a,bankAccountOptions:l,isFilling:i})},ButtonGroupField:function({label:e,options:t}){const n=Zd(),r=t.find(e=>e.value===n.state.value);return I(vu,{label:e,disableHover:!0,children:I(Ip,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Ip,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=Zd();return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:a=>I(vu,{label:t,popupTriggerProps:a,disabled:n,children:I("button",{...Np,type:"button",children:r.state.value?I(ba,{children:Rp(e,r.state.value)}):I(ba,{stylists:[Pp],children:`Select ${t}...`})})})}),I(Sp,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:a="Enter value..."}){const o=Zd(),i=g(null);return I(vu,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:I("input",{className:Mp,value:o.state.value,onChange:e=>o.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:a})})},BulkMergeAccountRowField:tg,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const a=g(null),o=r?vu:lu;return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(o,{inputRef:a,label:e,popupTriggerProps:t,children:I(ba,{children:n?.name??"Select a vendor..."})})}),I(pg,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const a=g(null),o=r?vu:lu;return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(o,{inputRef:a,label:e,popupTriggerProps:t,children:I(ba,{children:n?.name??"Select a customer..."})})}),I(yg,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=g(null),a=`${n?.name??Ni[0].name}`;return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(vu,{inputRef:r,label:e,popupTriggerProps:t,children:I(ba,{children:a})})}),I(xg,{frequencies:Ni,onClick:t})]})}}});const wg=[jt(null,Rt({"& path":{stroke:"icon.base"}}))];function Eg({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return N(hl,{type:"button",onClick:n,children:[e&&I(Lo,{Component:Wl,stylists:wg}),I(ba,{children:t})]})}const Ag=Rt({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),Ig=Rt({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),Sg=Rt({maxWidth:"600px"}),Ng=Rt({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),Pg=Rt({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Rg=Rt({display:"flex",justifyContent:"flex-start",alignItems:"center"}),Mg=Rt({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),Dg=Rt({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),Lg=Rt({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),Og=e=>{su(e),cu(e)};function Fg({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:a}=Ad(),o={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=Ud(),a=Ln(),o=Vn(),i=Nn(n),l=i?{selectedAccounts:n}:e;return i&&a&&n.forEach(({duplicateAccount:e})=>{var t,n,r;e&&(t=e.id,n=a,r=o,Si({queryKey:In(Mi({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:Li,accessToken:n,environment:r}))}),kg({defaultValues:l,onSubmit:async e=>{if(await zd()===sd){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!a)return void(await Kd());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=In(Mi({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),a=await Ii({queryKey:r,queryFn:Li,accessToken:t,environment:n});return a?.data?.[0]?.date}(t.id,a,o),r=(i=bn(e.tranStartDate||""),l=bn(n||""),s=bn(e.tranMinStartDate||""),Sn(l)?i:Nn(s)?xn(l,s):(Nn(i)&&xn(l,i),i));var i,l,s;return Sn(r)?null:fn(r)})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...qd(t),duplicateBankAccountIds:[qi(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await Kd()}}},onSubmitInvalid:()=>{}})}(o,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return N("form",{className:Ag,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:Og,children:[N("div",{className:Ig,children:[I(ba,{children:"Merge Accounts"}),I("div",{className:Sg,children:I(kl,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),N("div",{className:Ng,children:[N("div",{className:Pg,children:[I("div",{className:Rg,children:I(ba,{children:"Duplicate Account"})}),I("div",{className:Mg,children:I(ba,{children:"Into"})}),I("div",{className:Dg,children:I(ba,{children:"Destination Account"})})]}),I(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>I(i.AppField,{name:`selectedAccounts[${n}]`,children:t=>{const n=t.state.value.duplicateAccount?.id,o=function(e,t,n,r){const a=function(e,t,n){const r=new Set(e.map(e=>e.id));return t.forEach(({duplicateAccount:e})=>{e&&e.id!==n&&r.add(e.id)}),Array.from(r)}(e,t,n);return r?.filter(e=>!a.includes(e.id)&&Vd(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return I(tg,{destinationAccount:t.state.value.destinationAccount,selectedDuplicate:t.state.value.duplicateAccount,availableAccounts:o,isFilling:a,onSelectionChange:e=>{const n={duplicateAccount:e,destinationAccount:t.state.value.destinationAccount};t.handleChange(n)}},t.state.value.destinationAccount.id)}},n))})]}),I("div",{className:Lg,children:I(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return N(S,{children:[I(Eg,{showIcon:!1,onClick:()=>n()}),I(Pd,{onClick:()=>i.reset(o),disabled:!t,children:I(ba,{children:"Clear Selections"})}),I(Xd,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const Bg=Rt({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",width:"100%",maxWidth:"100%",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative",overflow:"hidden",boxSizing:"border-box"}),Ug=Ce.createConfirmation(be(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const a=n?n.map(e=>e.destinationAccount):r;return I(pd,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:I("div",{className:Bg,children:I(Fg,{destinationAccounts:a,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function Vg({plaidItemAccounts:e,matchingAccountPairs:t}){await Ug({matchingAccountPairs:t,plaidItemAccounts:e})}const Wg=Rt({display:"flex",flexDirection:"column",gap:"12px"}),Hg=async(e,t,n)=>{try{const r=await async function({accessToken:e,plaidItemId:t,environment:n}){if(!e)throw new Error("Access token is required to create Plaid link token");const r={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:td(n)},{url:a,headers:o}=Rr(r);return Qo({url:a,includeCredentials:!0,extraHeaders:o,params:t?{plaidItemId:t}:void 0})}({plaidItemId:e,accessToken:t,environment:n});return r.link_token?(Tr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(wr({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),Td("NO_LINK_TOKEN"))}catch(r){return wr({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),Td("LINK_TOKEN_FAILED")}};async function qg(e,t,n){const r=await async function(e,t){const n=In(Xc({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await Ii({queryKey:n,queryFn:Jc,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function jg(e,t,n,r){Tr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||Tr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const a=await async function(e,t,n){if(e){r=t,a=n,Si({queryKey:In(["banks/accounts",{}],{}),queryFn:Ed,accessToken:r,environment:a});const o=await qg(e,t,n);if(o){const e=await Id(t,n);return e?.data?.filter(e=>e.integration?.id===o.id)||[]}}var r,a;return[]}(t?.institution?.institution_id,n,r),{plaidItem:o}=await async function({publicToken:e,metadata:t,accessToken:n,environment:r}){if(!n)throw new Error("Access token is required to create Plaid link token");const a={path:"/banks2/webPlaidPublicToken",accessToken:n,endpointManager:td(r)},{url:o,headers:i}=Rr(a);return await Mr({url:o,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(Tr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([Bn.invalidateQueries({queryKey:["integrations"]}),Bn.invalidateQueries({queryKey:["banks/accounts",{}]}),Bn.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=Nn(e.apiErrorType)&&Nn(e.apiErrorCode),n="RELINK"===Tc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(o))return wr({error:new Error("Plaid Item requires relink, plaid reopened automatically"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:o}}),{relinkPlaidItemId:o.id};const i=await Id(n,r),s=i?.data?.filter(e=>Vd(e.apiName)&&"ACTIVE"===e.status)||[];return await async function(e,t,n,r,a){const o=n.institution?.name,i=l(e.plaidItemAccounts,t,"id");if(0===i.length)return 0===(e.plaidItemAccounts??[]).length?(wr({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await Cd({title:"Uh Oh!",body:"It appears something went wrong fetching the accounts from your bank. Please chat with the support or try again later.",buttons:[{key:ld,label:"Cancel"},{key:cd,label:"Chat",type:md}]})===cd&&xd({message:{text:`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`,attachments:[]}})}(o||"my bank")):void wr({error:new Error("No new accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}});if(!i.some(e=>"ACTIVE"===e.status))return wr({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),Cd({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${o} account.`,buttons:[{key:ld,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return wr({error:new Error("Accounts saved successfully with unsupported accounts"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),function(e,t,n){const r=e.length;return Cd({title:"All set! Ready to track your transactions?",body:N("div",{className:kd,children:[I(kl,{wrap:"wrap",children:`Your ${n} ${t} ${bd("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),I(kl,{wrap:"wrap",children:`The following linked ${r>1?"accounts are":"account is"} not supported at this time, so ${r>1?"they":"it"} will remain unsynced.`}),I("ul",{children:e.map(e=>I("li",{children:I(kl,{wrap:"wrap",children:yd(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:cd,label:"Get Started",type:md}]})}(s,o,e.plaidItemAccounts.length);const c=function(e,t){const n=[];for(const r of e){if(!r.apiMask)continue;const e=t.find(e=>e.mask===r.apiMask&&r.isSupported);e&&n.push({destinationAccount:Sd(r),duplicateAccount:e})}return n}(i,a);return c.length>0?async function({institutionName:e,matchingAccountPairs:t,plaidItemAccounts:n}){const r=t.slice(0,3),a=t.length>3;await Cd({title:"Your transactions are being categorized",body:N("div",{className:Wg,children:[I(kl,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),I(kl,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),N("ul",{children:[r.map(({duplicateAccount:e})=>I("li",{children:I(kl,{wrap:"wrap",children:yd(e?.name??"",e?.mask??"")})},e?.id)),a&&I("li",{children:I(kl,{wrap:"wrap",children:"and more..."})})]}),I(kl,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:ld,label:"No thanks"},{key:cd,label:"Review",type:md}]})===cd&&await Vg({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:o??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(wr({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=o,u=e.plaidItemAccounts.length,Cd({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${bd("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:cd,label:"Get started",type:md}]})):void 0;var d,u}(o,a,t,e,s),{}}catch(a){return wr({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:a}}),await async function(e){await Cd({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:ld,label:"Cancel"},{key:cd,label:"Chat",type:md}]})===cd&&xd({message:{text:`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`,attachments:[]}})}(t.institution?.name||"my bank"),{}}}async function zg(e,t,n){return Sn(e)?(Tr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(Tr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(wr({error:new Error("Plaid Item sync failed, refreshing Plaid Items"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),!0):("INVALID_UPDATED_USERNAME"===e.error_code&&(wr({error:new Error("Plaid Item sync failed due to invalid updated username"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),await async function(e){const t=await Cd({title:e||"Invalid Updated Username",body:'Your bank account has an updated username. To fix it, tap "Banks & Integrations", and unlink your old account, so you can relink it with your new username. If you need any assistance, tap "Chat" to chat with a member of our team.',buttons:[{key:ld,label:"Cancel"},{key:"chat",label:"Chat"},{key:cd,label:"Banks & Integrations",type:md}]});"chat"===t?xd({message:{text:"Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!",attachments:[]}}):t!==cd||(e=>{const t=ze.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||Ei("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const Kg="PLAID_LINK_NEW",Yg="PLAID_LINK_UPDATE",_g="PLAID_LINK_UNLINK";function Zg({plaidEvent:e,plaidItemId:t,apiAccessToken:n,apiErrorCode:r,message:a}){return{eventType:"onPlaidLink",message:a,defaultPrevented:!0,data:{plaidEvent:e,integrationId:t,apiAccessToken:n,apiErrorCode:r}}}const Gg=v({});function Qg({onPlaidLink:e,children:t}){return I(Gg.Provider,{value:{onPlaidLink:e},children:t})}function Xg(){return C(Gg)}async function Jg(e){const{url:t,headers:n}=Rr(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:a}=e,o=Sr({extraHeaders:n,authorization:t});Tr("HTTP DELETE Request",{url:a,accessToken:t});try{const e=await fetch(a,{method:"DELETE",headers:o,credentials:"include",body:JSON.stringify(r)});return Tr("HTTP DELETE Response",{url:a,status:e.status,statusText:e.statusText}),Nr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const $g=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:Wr(n)};return await Or(r)};function em(){return Rd({mutationFn:$g,onSuccess:()=>{const e=["integrations"];return Bn.invalidateQueries({queryKey:e})}})}const tm=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:Wr(t)};return await Or(n)};function nm(){return Rd({mutationFn:tm,onSuccess:()=>{const e=["integrations"];return Bn.invalidateQueries({queryKey:e})}})}const rm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String(qi(e.id)),removeFromApi:!0},accessToken:t,endpointManager:Wr(n)};return await async function(e){return Jg(e)}(r)};function am(){const{mutate:e}=nm();return Rd({mutationFn:rm,onSuccess:()=>{const e=["integrations"];return Bn.invalidateQueries({queryKey:e})},onError:async t=>{wr({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await Cd({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:ld,label:"Cancel"},{key:cd,label:"Try Again",type:md}]})===cd&&e()}})}function om(e){return new Promise(t=>{window.Plaid.create({token:e,onSuccess:(e,n)=>t({status:"success",public_token:e,metadata:n}),onExit:(e,n)=>t({status:"exit",metadata:n,error:e}),onEvent:(e,t)=>{Tr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function im(e,t,n,r){const a=await Hg(e,t,n);if(!a)return;const o=await om(a);if("success"===o?.status){const{public_token:e,metadata:a}=o;Tr("Plaid link successful",{public_token:e,metadata:a});const i=await jg(e,a,t,n);if(i.relinkPlaidItemId)return im(i.relinkPlaidItemId,t,n,r)}else if("exit"===o?.status){const{metadata:e,error:t}=o;Tr("Plaid link exited",{metadata:e,error:t}),await zg(t,e,a)&&r()}else wr({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:o,token:a}})}function lm(){const[e,t]=Qc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=Ln(),r=Vn(),{mutate:a}=nm(),{onPlaidLink:o}=Xg();return{linkPlaid:e=>{if(Nn(o)){const t=Zg(e);o(t)}else im(e.plaidItemId?qi(e.plaidItemId):void 0,n,r,a)},loading:e||Nn(t),hasOnPlaidLinkOverride:Nn(o)}}function sm(){const[e,t]=Qc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=Ln(),r=Vn(),{mutate:a}=nm(),{apiPartnerName:o}=C(Eo),{onPlaidLink:i}=Xg();return{linkPlaid:e=>{if(Nn(i)){const t=Zg(e);i(t)}else!async function(e,t,n,r,a){const o=await Hg(e,t,n);if(!o)return;const i=await om(o);if("success"===i?.status){const{public_token:e,metadata:o}=i;Tr("Plaid link from search successful",{public_token:e,metadata:o});const l=await async function(e,t,n,r,a){if(t?.institution?.institution_id){const i=await qg(t.institution.institution_id,n,r);if(i)return wr({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(o=a,Cd({title:"Already Linked",body:`It seems that this bank is already linked${o?` with ${o}`:""}. Please tap "Relink" to update the existing linked institution.`,buttons:[{key:ld,label:"Cancel"},{key:cd,label:"Relink",type:md}]}))===cd?{relinkPlaidItemId:qi(i.id)}:{}}var o;return Tr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),jg(e,t,n,r)}(e,o,t,n,r);l.relinkPlaidItemId&&im(l.relinkPlaidItemId,t,n,a)}else if("exit"===i?.status){const{metadata:e,error:t}=i;Tr("Plaid link from search exited",{metadata:e,error:t}),await zg(t,e,o)&&a()}}(e.plaidItemId?qi(e.plaidItemId):void 0,n,r,o,a)},loading:e||Nn(t),hasOnPlaidLinkOverride:Nn(i)}}const cm=jt(null,el,Rt({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",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),Po);function dm(){const{linkPlaid:e,loading:t}=lm();return N("button",{onClick:()=>e({plaidEvent:Kg,message:"Tile Plaid Link button pressed"}),...cm,disabled:t,children:[I(Yc,{Component:Kc}),I(kl,{intent:"primary",children:"Link Account"})]})}const um=Rt({width:266,minHeight:32});function hm(){return I(Ya,{styles:um})}const pm=Rt({backgroundColor:"money.positive.weak"}),gm=Rt({backgroundColor:"money.negative.weak"}),mm=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),vm=({defaultRange:e=an.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:a}=function({filter:e}){return jr({filter:e,select:zc})}({filter:e});let o;return o=t?ro:r??mm,N($r,{isSample:t,children:[I(Gr,{title:"Profit + Loss"}),I(Xr,{children:a?N(Za,{children:[I(hm,{}),I(hm,{})]}):N(S,{children:[I(sa,{title:ma(o.netIncome),label:"Profit"}),N(da,{children:[I(qc,{amount:o.income,total:o.absoluteSum,colorCss:pm,label:"Income"}),I(qc,{amount:o.expenses,total:o.absoluteSum,colorCss:gm,label:"Expenses"})]})]})}),t&&I(eo,{size:"sm"}),n&&I(dm,{})]})},Cm=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],bm={moneyIn:0,moneyOut:0,netMoneyIn:0};const fm=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,a=t[3].environment,o={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...sn(n.filter)},accessToken:r,endpointManager:Wr(a)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||Sn(n)||Sn(n.operatingActivities)||!n.operatingActivities.children?bm:function(e){let t=new F(0),n=new F(0);for(const r of e.children)r.total<0?n=n.plus(F(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await Or(o))},ym=Rt({backgroundColor:"money.positive.weak"}),xm=Rt({backgroundColor:"money.negative.weak"}),km=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),Tm=({defaultRange:e=an.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:a},isFilling:o}=function({filter:e}){return Wn({queryKey:Cm({filter:e}),queryFn:fm})}({filter:e});let i;i=t?oo:r??km;let l=0;return(t||a)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),N($r,{isSample:t,children:[I(Gr,{title:"Cash Flow"}),I(Xr,{children:o?N(Za,{children:[I(hm,{}),I(hm,{})]}):N(S,{children:[I(sa,{title:ma(i.netMoneyIn),label:"Change in Cash"}),N(da,{children:[I(qc,{amount:i.moneyIn,total:l,colorCss:ym,label:"Money In"}),I(qc,{amount:i.moneyOut,total:l,colorCss:xm,label:"Money Out"})]})]})}),t&&I(eo,{size:"sm"}),n&&I(dm,{})]})},wm=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),Em=jt(null,Rt({display:"flex",justifyContent:"end"}));function Am({color:e,bulletLabel:t,moneySummary:n}){return N("div",{...wm,children:[I(Sa,{color:e,label:t}),I("div",{...Em,children:I(kl,{children:n})})]})}const Im={total:0,children:[]},Sm=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||Sn(n)||Sn(n.expenses)||!n.expenses.children?Im:{total:n.expenses.total??0,children:(r=n.expenses.children,r.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var r},Nm=jt(null,Rt({display:"flex",gap:"10px",alignItems:"center"})),Pm=Rt({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),Rm=jt(null,Pm);function Mm({bulletAmount:e=3,shimmer:t=!1}){return I(S,{children:Array.from({length:e},(e,n)=>N("div",{...Nm,children:[I(Sa,{color:wa.var("colors.brand.secondary")}),t?I(Ya,{styles:Pm}):I("div",{...Rm})]},n))})}const Dm=jt(null,Rt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),Lm=[wa.var("colors.brand.primary"),wa.var("colors.brand.success"),wa.var("colors.brand.action")],Om=Object.freeze({total:0,children:[]});function Fm({defaultRange:e=an.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const a=ze(e=>e.externalOptions).dataVisualizationColors??Lm,{query:{data:o},isFilling:i}=function({filter:e}){return jr({filter:e,select:Sm})}({filter:e});let l;l=n?ao:o??Om;const s=void 0===t?"Total Expenses":`${dn[t]} Total`,c=l.children.length>0;return N($r,{isSample:n,children:[I(Gr,{title:"Expenses"}),I(Xr,{children:i?I(Za,{children:I(Mm,{shimmer:!0})}):N(S,{children:[I("div",{...Dm,children:I(sa,{title:ma(l.total),label:s})}),I(da,{children:c?l.children.map((e,t)=>I(Am,{color:a[t],bulletLabel:e.name,moneySummary:ma(e.total)},t)):I(Mm,{})})]})}),n&&I(eo,{size:"sm"}),r&&I(dm,{})]})}const Bm=jt(null,Rt({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Um({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:a}){const o=(i=e.month,{beginDate:$t(l=e.year,i,1),endDate:$t(l,i+1,0)});var i,l,s,c,d,u,h,p;return N("div",{...Bm,children:[N(Kt,{children:[I(Xt,{children:"Monthly Review"}),I(Pc,{period:e,setPeriod:t,disableNext:r||(s=e,c=n,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:r})]}),N(Mc,{children:[I(vm,{defaultRange:o,isSample:r,showLinkAccountButton:a}),I(Tm,{defaultRange:o,isSample:r,showLinkAccountButton:a}),I(Fm,{defaultRange:o,monthIndex:e.month,isSample:r,showLinkAccountButton:a})]})]})}const Vm="Oldest to Newest",Wm="Newest to Oldest",Hm="A-Z",qm="Z-A",jm="Lowest to Highest",zm="Highest to Lowest",Km="A-Z",Ym="Z-A";function _m(){const[e,t]=f(void 0),n=m(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in Pi)??!1,n=(e.direction&&e.direction in Ri)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const Zm=Rt({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"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),Gm=Rt({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Qm=Rt({background:"brand.primary.strong",border:"none"});function Xm({checked:e,onClick:t}){const[n,r]=f(e??!1),a=void 0===e?n:e;return I("button",{...jt(Bt["checkbox-input"],Zm,a?Qm:Gm,Ro),type:"button",onClick:a=>{void 0===e&&r(!n),t&&t(a)},"data-is-checked":a,children:a&&I(Hl,{Component:Qd})})}const Jm=jt(null,Rt({paddingLeft:"20px",paddingRight:"5px"}));function $m({checked:e,onClick:t}){return I("div",{...Jm,children:I(Xm,{checked:e,onClick:t})})}const ev=jt(Bt.text,Rt({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),ea);function tv({children:e}){return I("div",{...ev,children:e})}const nv=jt(Bt["date-cell"],Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function rv({date:e,annotation:t}){const n=mn(bn(e));return N("div",{...nv,children:[t&&I(tv,{children:t}),I(kl,{children:n})]})}const av=Rt({color:"money.negative"}),ov=Rt({color:"money.positive"}),iv=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>Pn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" "),lv=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 10.625H7.5C5.8424 10.625 4.25269 9.96652 3.08058 8.79442C1.90848 7.62231 1.25 6.0326 1.25 4.375V0.625",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M10 14.375L13.75 10.625L10 6.875",stroke:"currentColor",strokeMiterlimit:10})),"ChildRow"),sv=jt(Bt["transaction-date-cell-container"],Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px"}));function cv({transaction:e,showTypeLabel:t=!1,isChild:n=!1}){const r=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let n;return n=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:n,css:t?ov:av}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?av:ov}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?av:ov};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?av:ov};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:av};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=ov;return e.amount<0&&(t="Invoice Payment Refund",n=av),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:iv(e.type),css:e.amount<0?av:ov}))(e)}return t})(e),a=jt(Bt["transaction-type-label"],r.css),o=t?I("span",{...a,children:r.displayName}):void 0;return n?N("div",{...sv,children:[I(Yc,{Component:lv}),I(rv,{date:e.date,annotation:o})]}):I(rv,{date:e.date,annotation:o})}const dv=Rt({display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}),uv=Rt({display:"flex",flexDirection:"column"}),hv=Rt({width:20,minWidth:20,height:20,minHeight:20,borderRadius:"9999px"});function pv({label:e,subLabel:t,iconUrl:n}){return N("div",{className:dv,children:[n?I("img",{src:n,className:hv,alt:void 0,width:24,height:24}):I("span",{className:hv}),N("div",{className:uv,children:[I(kl,{children:e}),I(ya,{children:t})]})]})}function gv({bankTransaction:e,isChild:t=!1}){return t?I("div",{className:Rt({paddingLeft:"25px"}),children:I(pv,{label:e.displayName,subLabel:e.description,iconUrl:e.iconUrl})}):I(pv,{label:e.displayName,subLabel:e.bankAccount.displayName,iconUrl:e.iconUrl})}function mv(e){return va(eh(e.amount))}const vv=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.10632H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.69366H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.28131H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8687H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.71875 10.4749L3.33125 12.8686L0.9375 10.4749",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 1.50635V12.8688",stroke:"currentColor",strokeMiterlimit:10})),"NestedRows"),Cv=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.13135H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.71851H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.30682H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8934H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M0.9375 4.5251L3.33125 2.13135L5.71875 4.5251",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 13.4938V2.13135",stroke:"currentColor",strokeMiterlimit:10})),"NestedRowsExpanded"),bv=Rt({display:"flex",alignItems:"center",gap:"8px"}),fv=Rt({padding:"6px"});function yv({row:e}){const t=e.original,n=I(kl,{children:mv(t)});if(e?.getCanExpand()){const t=e.getIsExpanded();return I(ns,{ariaLabel:t?"Collapse children":"Expand children",ariaExpanded:t,children:N("div",{className:bv,children:[I(Yc,{Component:t?Cv:vv}),n]})})}return I("div",{className:fv,children:n})}const xv=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 1.25L1.25 13.75",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M13.75 9.84375V1.25H5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Withdraw"),kv=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 13.75L1.25 1.25",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.15625 13.75H13.75V5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Deposit"),Tv=Rt({padding:"10px",height:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"8px"}),wv=Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"});function Ev({annotation:e,accountName:t}){const n=(e=>{switch(e){case"Withdrawn from":return xv;case"Deposited to":return kv;default:return null}})(e);return N("div",{className:Tv,children:[n&&I(Yc,{Component:n}),N("div",{className:wv,children:[e&&I(ya,{children:e}),t&&I(kl,{children:t})]})]})}const Av=Rt({maxWidth:"100%",width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background","& .Tight-sub-label":{color:"typography.base"},"& .Tight-icon > path":{stroke:"icon.base"}}),Iv=Dt(Av,Rt({padding:"2.5px"})),Sv=Dt(Av,Rt({padding:"4px 5px",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{}})),Nv=Rt({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-label":{color:"typography.intent.secondary"},"& .Tight-icon > path":{stroke:"icon.intent.secondary"}}),Pv=Dt(Nv,Rt({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-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-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),Rv=Rt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-label":{color:"typography.intent.action"},"& .Tight-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-label":{color:"typography.intent.action.hover"},"& .Tight-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-label":{color:"typography.intent.action.hover"},"& .Tight-icon > path":{stroke:"icon.intent.action.hover"}}}),Mv=Dt(Rv,Rt({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-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-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),Dv=Rt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-label":{color:"typography.intent.success"},"& .Tight-icon > path":{stroke:"icon.intent.success"}}),Lv=Dt(Dv,Rt({_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-label":{color:"typography.intent.success.hover"},"& .Tight-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-label":{color:"typography.intent.success.hover"},"& .Tight-icon > path":{stroke:"icon.intent.success.hover"}}})),Ov=Rt({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-label":{color:"typography.intent.warning"},"& .Tight-icon > path":{stroke:"icon.intent.warning"}}),Fv=Dt(Ov,Rt({_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-label":{color:"typography.intent.warning.hover"},"& .Tight-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-label":{color:"typography.intent.warning.hover"},"& .Tight-icon > path":{stroke:"icon.intent.warning.hover"}}})),Bv=Rt({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-label":{color:"typography.intent.danger"},"& .Tight-icon > path":{stroke:"icon.intent.danger"}}),Uv=Dt(Bv,Rt({_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-label":{color:"typography.intent.danger.hover"},"& .Tight-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-label":{color:"typography.intent.danger.hover"},"& .Tight-icon > path":{stroke:"icon.intent.danger.hover"}}})),Vv=Rt({display:"flex",alignItems:"center",gap:"8px",height:"37px",margin:"0 8px",padding:"10px",borderRadius:"sm",cursor:"pointer",minWidth:0,outline:"none","&:focus-visible":{outline:"2px solid",outlineColor:"border.layout",outlineOffset:"2px"}}),Wv={default:Pv,neutral:Pv,warning:Fv,success:Lv,critical:Uv,highlight:Mv},Hv=T(function({variant:e="default",children:t,stylists:n=[],...r},a){const o=Zt([jt(Bt["selector-button"],Dt(Vv,Wv[e]),Ro),...n]);return I("button",{ref:a,...o,...r,children:t})}),qv={keys:[{name:"name"},{name:"accountNo"}],threshold:.1};function jv(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}function zv(e,t){const n=[];return e.forEach(e=>{const r=e.item,a=(o=r,t.find(e=>e.children.some(e=>e.accountNo===o.accountNo)));var o;!a&&r.children.length>0?function(e,t){e.children.forEach(n=>{jv(e,n,t)})}(r,n):a&&jv(a,r,n)}),n}const Kv=[jt(null,Rt({marginLeft:"6px",marginRight:"6px"}))],Yv=jt(null,Rt({whiteSpace:"normal"}));function _v({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:a}=mp(),o=kp(r,e),i=m(()=>new Te(o,qv),[o]),l=m(()=>zv(i.search(n),o),[o,n,i]);return a?I(kh,{}):l.map(({parent:e,child:n})=>I(bh,{onClick:()=>t(n),children:N(_h,{stylists:[Yv],children:[e.name,I(Lo,{Component:No,stylists:Kv}),n.name]})},`${n.accountNo}`))}function Zv({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:a}=gp(),o=kp(n,e);return a?I(kh,{}):a||r||void 0!==n?o.map(e=>I(tp,{triggerChildren:I(ap,{displayLabel:e.name}),popupChildren:I(Gv,{glAccount:e,onClick:t})},e.accountNo)):I(yh,{text:"No data"})}function Gv({glAccount:e,onClick:t}){return I(uh,{children:e.children.map(e=>I(bh,{onClick:()=>t(e),children:I(ba,{children:e.name})},e.accountNo))})}const Qv=Rt({maxWidth:"420px",width:"fit-content"});function Xv({onClick:e,types:t}){const{query:{data:n}}=gp(),r=kp(n,t);return I(mh,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?Qv:void 0,SearchList:_v,DefaultList:Zv,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}const Jv=async({data:e,accessToken:t,environment:n})=>eC({data:{data:e},accessToken:t,environment:n}),$v=async({data:e,accessToken:t,environment:n})=>Jv({data:[e],accessToken:t,environment:n}),eC=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:bo(n)};return await Lr(r)};function tC(){return Rd({onSuccess:async()=>{const e=["banks/transactions"];return Tr("mutation successful, invalidating BT queries"),Bn.invalidateQueries({queryKey:e}).catch(e=>wr({error:e,severity:"error"}))},mutationFn:Jv})}function nC(){return Rd({onSuccess:async()=>(Tr("mutation successful, invalidating BT queries"),Bn.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>wr({error:e,severity:"error"}))),mutationFn:$v})}function rC({transaction:e,parentTransaction:t,accountName:n}){const{startPrefetch:r,cancelPrefetch:a}=ti({prefetchFn:Yo(up,hp)}),{mutate:o}=nC(),i=void 0!==t;return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>N(Hv,{...t,onMouseEnter:r,onMouseLeave:a,children:[e.glAccount&&I("img",{src:e.glAccount.iconUrl,alt:void 0,width:"15px",height:"15px"}),I(kl,{children:n})]})}),I(Xv,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:a}=t,{id:i}=e,l=a.map(e=>e.id===i?{...e,glAccountId:n.id.toString()}:e);o({id:r,children:l})}}:t=>{o({id:e.id,glAccountId:t.id})},types:xp})]})}const aC=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),p.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}),p.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"),oC=jt(null,Rt({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),iC=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function lC({transaction:e}){const t=e.children.map(e=>e?.category?.name??e?.glAccount?.name).filter(e=>void 0!==e),n=new Set(t),r=[...n].join(", "),a=bd("Category","Categories",n.size,!0);return I(yl,{children:N("div",{...iC,children:[I(Yc,{Component:aC}),N("div",{...oC,children:[I(ba,{children:a}),I(ya,{children:r})]})]})})}function sC({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=zh(),a=e.category?.name??"Uncategorized",{mutate:o}=nC(),i=void 0!==t;return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>N(Hv,{...t,onMouseEnter:n,onMouseLeave:r,children:[e.category&&I("img",{src:e.category.iconUrl,alt:void 0,width:"15px",height:"15px"}),I(kl,{children:a})]})}),I(lp,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:a}=t,{id:i}=e,l=a.map(e=>e.id===i?{...e,categoryId:n.id.toString()}:e);o({id:r,children:l})}}:t=>{t?.id&&o({id:e.id,categoryId:t.id.toString()})}})]})}function cC({transaction:e,parentTransaction:t}){if(e.children.length>0)return I(lC,{transaction:e});switch(e.type){case"EXPENSE":case"BILL_PAYMENT":case"PAYROLL_PAYMENT":case"LOAN_PAYMENT":return I(sC,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return I(Ev,{annotation:Hd(e.amount),accountName:e.bankAccount?.name});case"PAYOUT":return wr({error:new Error("Should not get here. Payout without line items."),severity:"error"}),null;default:return I(rC,{transaction:e,parentTransaction:t,accountName:e.glAccount?.name})}}function dC({name:e}){return I(S,{children:e&&I(kl,{children:e})})}const uC=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],hC=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function pC({onClick:e}){const t=Ul(),{userRole:n}=C(Eo),r=(e=>{switch(e){case"OWNER":default:return uC;case"ACCOUNTANT":return hC}})(n)||[];return I(Gl,{children:I(uh,{children:r.map(({status:n,displayName:r})=>I(bh,{onClick:()=>(e(n),void t.close()),children:I(ba,{children:r})},n))})})}const gC={PARTNER_REVIEW_REQUIRED:"PARTNER_REVIEW_REQUIRED",USER_REVIEW_REQUIRED:"USER_REVIEW_REQUIRED",ACCOUNTANT_REVIEW_REQUIRED:"ACCOUNTANT_REVIEW_REQUIRED",RECONCILIATION_STAGED:"RECONCILIATION_STAGED",RECONCILED:"RECONCILED",RECONCILIATION_DISCREPANCY:"RECONCILIATION_DISCREPANCY",RECONCILIATION_AWAITING:"RECONCILIATION_AWAITING"},mC=[{name:"Needs my Review",value:[gC.USER_REVIEW_REQUIRED]},{name:"Flagged to Accountant",value:[gC.ACCOUNTANT_REVIEW_REQUIRED]},{name:"Discrepancy",value:[gC.RECONCILIATION_DISCREPANCY]},{name:"Processing",value:[gC.PARTNER_REVIEW_REQUIRED,gC.RECONCILIATION_STAGED]},{name:"Reconciled",value:[gC.RECONCILED]}],vC=[{name:"Needs my Review",value:[gC.ACCOUNTANT_REVIEW_REQUIRED]},{name:"Flagged to Business Owner",value:[gC.USER_REVIEW_REQUIRED]},{name:"Discrepancy",value:[gC.RECONCILIATION_DISCREPANCY]},{name:"Processing",value:[gC.PARTNER_REVIEW_REQUIRED]},{name:"Reconciled",value:[gC.RECONCILED]}];function CC(e){return e in gC}const bC=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),fC=Io(e=>p.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag",{partnerIcons:{GMoney:e=>p.createElement("svg",{width:25,height:36,viewBox:"0 0 25 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M15.966 6.54892L17.9038 6.90126L21.3583 7.88935L24.3379 8.83913L24.6826 8.91573L24.7592 9.07658L24.0468 10.3327L23.3115 11.7345L22.2698 14.3004L21.389 17.1957L20.9983 19.1336L20.7532 20.3745L20.5081 22.6876L20.3472 25.8817L20.3013 27.7276L19.9872 30.3932L19.2136 33.3957L18.4094 35.211L18.2102 35.6476L18.0187 35.6706L15.897 34.9276L14.4264 34.537L12.5192 33.9549L10.3821 33.4647L8.9881 33.1276L7.6247 32.8902L6.97363 28.0953L13.783 29.183L14.6715 25.6519L15.5447 19.8383L15.966 6.54892Z",fill:"white"}),p.createElement("path",{d:"M21.7873 15.9932C21.2665 13.1974 15.9814 9.95743 14.5337 12.8221C15.0546 17.5864 15.3763 24.7787 13.9286 29.3898C13.5303 29.3898 6.6367 28.0723 6.40691 28.44C6.09287 29.4817 5.34989 31.5728 4.875 32.5455C8.95755 32.783 14.3269 34.5983 18.2103 35.6476C21.4733 29.6885 19.5507 22.251 21.7873 15.9932Z",fill:"#078080"}),p.createElement("path",{d:"M14.0739 10.6085L14.3114 8.66295L14.8782 5.75997L15.4833 3.37785L16.2186 1.60849L16.142 1.30976L14.9012 1.15657L12.5037 0.750613L9.48585 0.421251L7.35649 0.252741L4.71394 0.114868L2.86798 0.145506L2.53862 0.306358L2.125 1.63146L5.21181 6.46466L14.0739 10.6085Z",fill:"white"}),p.createElement("path",{d:"M14.6491 21.8757C14.6108 18.5974 13.707 14.8595 14.0134 11.5889C13.6687 6.09699 8.16145 0.329326 2.30953 1.08762C1.19123 4.13613 0.471234 7.56762 0.356341 10.8153C0.364 16.0851 1.77336 22.4808 0.0576172 27.6357C4.2857 27.5361 9.56315 27.9574 13.684 28.8C14.2431 26.64 14.7793 24.1276 14.6491 21.8757Z",fill:"#2BABAD"}),p.createElement("path",{d:"M7.25705 16.6136C8.81802 16.6136 10.0834 15.3242 10.0834 13.7336C10.0834 12.143 8.81802 10.8536 7.25705 10.8536C5.69608 10.8536 4.43066 12.143 4.43066 13.7336C4.43066 15.3242 5.69608 16.6136 7.25705 16.6136Z",fill:"#078080"}),p.createElement("path",{d:"M24.7822 8.99231C24.8818 8.83912 24.6214 8.81614 24.5295 8.75486C24.5295 8.75486 24.4146 8.67827 24.338 8.67827C24.2997 8.67827 24.2614 8.69359 24.2231 8.67827C23.7635 8.44848 23.2733 8.33358 22.7907 8.1421C21.6648 7.88933 20.6077 7.4221 19.4665 7.19997C18.6546 6.99316 17.8197 6.7021 16.9771 6.56422C16.9082 6.57954 16.8546 6.51061 16.778 6.52593C16.7397 6.52593 16.7014 6.5489 16.6707 6.53359C16.5788 6.47997 16.4639 6.49529 16.372 6.44167C15.9048 6.31146 15.4069 6.21188 14.9243 6.12763C15.1005 5.59146 15.2154 5.13188 15.3303 4.56507C15.3992 4.48082 15.3763 4.37358 15.3839 4.27401C15.4452 4.09784 15.5141 3.94465 15.5831 3.77614C15.6214 3.44678 16.5941 1.38635 16.2648 1.39401C16.349 1.16422 15.7669 1.14124 15.675 1.16422C14.9473 0.957415 14.166 0.842521 13.4001 0.750606C12.5575 0.674011 11.6767 0.436564 10.8035 0.398266C9.95328 0.352308 9.07243 0.1455 8.19924 0.1455C7.34903 0.13784 6.45285 -0.0230108 5.57966 0.0229466C5.57966 0.0229466 5.44945 -3.20952e-05 5.37286 0.0229466C5.33456 0.0306062 5.30392 0.0612445 5.26562 0.0535849C5.10477 0.0382658 4.95924 0.0152871 4.79839 0.00762748C4.48434 0.0459253 2.60775 -0.122585 2.64605 0.229755C2.39328 0.245074 2.41626 0.643372 2.21711 0.819542C2.13285 0.972734 2.14817 1.08763 2.10988 1.23316C2.06392 1.36337 1.96434 1.52422 1.98732 1.66976C1.77285 2.02976 1.60434 2.47401 1.54307 2.88763C1.51243 2.94124 1.55073 3.01018 1.48945 3.03316C1.43583 3.11741 1.43583 3.29358 1.41285 3.41614C1.31328 3.64593 1.22137 3.86805 1.21371 4.12082C1.17541 4.25869 1.09115 4.4272 1.13711 4.56507C1.07583 4.62635 1.06817 4.71061 1.0452 4.79486C0.930302 5.12422 0.823068 5.47656 0.815408 5.82124C0.792429 5.87486 0.830727 5.93614 0.769451 5.97444C0.723493 6.06635 0.738812 6.2655 0.723493 6.39571C0.654557 6.6255 0.585621 6.83997 0.60094 7.08507C0.570302 7.22295 0.516685 7.40678 0.570302 7.53699C0.478387 7.7438 0.432429 7.99656 0.409451 8.22635C0.386472 8.4255 0.325195 8.62465 0.363493 8.81614C0.340514 8.86975 0.386472 8.93103 0.332855 8.96933C0.286897 9.08422 0.363493 9.21444 0.340514 9.32933C0.286897 9.58976 0.225621 9.83486 0.271578 10.0876C0.263919 10.2255 0.217961 10.4093 0.279238 10.5395C0.202642 10.754 0.187323 11.0068 0.187323 11.2366C0.187323 11.4357 0.133706 11.6425 0.194983 11.8264C0.179663 11.8876 0.23328 11.9412 0.179663 11.9872C0.149025 12.1787 0.271578 12.4774 0.172004 12.6842C0.156685 12.8298 0.217961 12.9676 0.225621 13.1055C0.225621 13.2434 0.194983 13.4349 0.279238 13.5574C0.23328 13.7795 0.24094 14.0323 0.256259 14.2621C0.271578 14.4612 0.2486 14.6681 0.325195 14.8519C0.317536 14.9132 0.371153 14.9591 0.325195 15.0127C0.309876 15.1046 0.363493 15.1966 0.386472 15.2885C0.409451 15.6025 0.363493 15.84 0.470727 16.1234C0.486046 16.2612 0.470727 16.4527 0.554983 16.5676C0.516685 16.9812 0.554983 17.4485 0.654557 17.8544C0.646897 17.9157 0.708174 17.9617 0.654557 18.0076C0.631578 18.1225 0.731153 18.2374 0.731153 18.36C0.723493 18.6204 0.700515 18.8655 0.78477 19.1106C0.792429 19.2485 0.769451 19.44 0.846046 19.5549C0.792429 19.9685 0.792429 20.4357 0.861366 20.8417C0.846046 20.9029 0.899663 20.9566 0.853706 20.9949C0.823068 21.1098 0.907323 21.2323 0.899664 21.3472C0.869025 21.6306 0.830727 21.8298 0.884344 22.0978C0.876685 22.2357 0.838387 22.4195 0.899664 22.5421C0.853706 22.611 0.861366 22.6953 0.846046 22.7872C0.792429 23.1242 0.723493 23.4842 0.746472 23.8136C0.723493 23.8672 0.769451 23.9285 0.715834 23.9668C0.669876 24.074 0.677536 24.5412 0.60094 24.6485C0.554983 24.7864 0.585621 24.9319 0.562642 25.0621C0.532004 25.2 0.463068 25.3685 0.501366 25.5064C0.332855 25.8893 0.202642 26.3336 0.149025 26.7395C0.118387 26.7932 0.156685 26.8544 0.0954081 26.8851C0.0341315 27.0689 -0.0884217 27.6817 0.103068 27.72C0.133706 27.7966 0.225621 27.7123 0.294557 27.7353C0.42477 27.7276 0.470727 27.7353 0.577961 27.7429C0.631578 27.72 0.669876 27.7506 0.715834 27.7659C0.846046 27.7812 0.95328 27.72 1.07583 27.7123C1.19839 27.7123 1.35924 27.7429 1.45881 27.674C1.81115 27.7506 2.21711 27.7736 2.56945 27.72C2.62307 27.7353 2.66903 27.6817 2.70732 27.7353C2.78392 27.7659 2.86051 27.72 2.94477 27.7046C3.0903 27.7276 3.19754 27.697 3.30477 27.7583C3.42732 27.7812 3.54988 27.7276 3.66477 27.7276C3.78732 27.7353 3.94817 27.7736 4.05541 27.7123C4.23924 27.7812 4.45371 27.8042 4.65285 27.8119C4.82137 27.8195 4.99754 27.8732 5.15839 27.8272C5.212 27.8425 5.25796 27.7966 5.2886 27.8502C5.35754 27.8808 5.44179 27.8502 5.51839 27.8349C5.67158 27.8655 5.77115 27.8349 5.88605 27.9038C6.03924 27.9344 6.18477 27.8655 6.3303 27.9115C6.23073 28.2408 6.12349 28.5855 6.0852 28.9302C6.09286 28.9685 6.07754 28.9915 6.0469 29.0068C6.00094 29.0834 5.99328 29.2519 5.9703 29.3744C5.932 29.474 5.90903 29.5812 5.83243 29.6578C5.77115 29.7881 5.77881 29.9336 5.73285 30.0638C5.67924 30.194 5.58732 30.3549 5.6103 30.4927C5.38817 30.8451 5.19668 31.2663 5.08179 31.6646C5.04349 31.7106 5.07413 31.7795 5.0052 31.8025C4.9286 31.8944 4.95158 32.04 4.89796 32.1395C4.8903 32.2161 4.71413 32.5072 4.87498 32.5532C4.9669 32.6987 5.23498 32.691 5.41115 32.7293C5.63328 32.8442 5.90137 32.7446 6.14647 32.8212C6.20009 32.8366 6.23839 32.76 6.27669 32.8136C6.59073 32.9285 6.92775 32.9438 7.24945 33.0204C7.31073 32.9974 7.37966 33.0127 7.44094 33.0051C7.46392 33.0204 7.4869 33.0587 7.5252 33.0587C7.60179 33.074 7.81626 33.0434 7.93115 33.1046C7.98477 33.097 8.02307 33.1276 8.06137 33.1583C8.18392 33.2042 8.30647 33.1659 8.42137 33.1812C8.53626 33.2042 8.69711 33.2732 8.80435 33.2195C8.97286 33.3115 9.18732 33.3651 9.38647 33.4034C9.55498 33.434 9.71583 33.5106 9.88434 33.4876C9.9303 33.5106 9.99158 33.4723 10.0146 33.5336C10.0835 33.5795 10.2673 33.5719 10.3899 33.5872C10.5354 33.6255 10.6503 33.7098 10.8035 33.7251C10.9797 33.6715 11.1712 33.8553 11.3473 33.7864C11.5158 33.8859 11.7226 33.9549 11.9141 34.0008C12.0826 34.0391 12.2435 34.1234 12.412 34.1081C12.458 34.131 12.5192 34.0927 12.5422 34.154C12.6265 34.2153 12.7567 34.1617 12.8486 34.2C12.9405 34.2459 13.0401 34.2459 13.1167 34.3225C13.2316 34.3761 13.3618 34.3532 13.4767 34.3838C13.5916 34.4221 13.7371 34.4987 13.8597 34.4604C14.1737 34.6366 14.5643 34.7744 14.9167 34.8204C14.9626 34.851 15.0239 34.8127 15.0392 34.874C15.1235 34.9353 15.2537 34.8893 15.3456 34.9276C15.4375 34.9812 15.5371 34.9812 15.606 35.0578C15.7209 35.1191 15.8512 35.0961 15.966 35.1268C16.0809 35.1651 16.2265 35.2493 16.349 35.211C16.5099 35.3259 16.709 35.4025 16.9082 35.4561C17.069 35.5098 17.2299 35.6017 17.3984 35.594C17.4443 35.6246 17.5056 35.5863 17.5209 35.6476C17.6052 35.7089 17.7354 35.6706 17.8273 35.7089C17.8886 35.7166 18.1107 35.7932 18.1643 35.6859C18.3099 35.8085 18.4631 35.4255 18.4631 35.4255C18.8307 34.5064 19.3286 33.5872 19.566 32.6068C19.8035 31.6264 20.1635 30.6153 20.2095 29.5812C20.3397 28.5472 20.5082 27.4595 20.5005 26.3949C20.5235 25.4144 20.6384 24.3804 20.6154 23.3846C20.6231 22.4808 20.8146 21.5464 20.8758 20.6349C20.8605 20.5506 20.9218 20.4893 20.8988 20.4051C20.8912 20.3668 20.8758 20.3208 20.8835 20.2825C20.9984 19.8612 21.0597 19.4323 21.1516 19.011C21.2741 18.4978 21.366 17.977 21.4733 17.4715C21.4503 17.3183 21.5422 17.1344 21.5882 17.0119C21.8256 16.1693 22.1473 15.3191 22.3388 14.4766C22.6988 13.68 23.0205 12.8451 23.3652 12.0408C23.7175 11.1293 24.292 10.2715 24.7363 9.37529C24.7363 9.39061 24.9507 9.02295 24.7822 8.99231ZM15.675 21.8374C15.9737 20.5812 15.9277 19.2638 16.0809 18C16.1192 18.0306 16.1346 18.0766 16.1729 18.0995C16.372 18.1915 16.395 18.4595 16.5635 18.5744C16.5865 18.7429 16.6707 18.9115 16.6937 19.08C16.7703 19.3404 16.7933 19.6085 16.8316 19.8689C16.8546 19.8995 16.8469 19.9302 16.8163 19.9532C16.7856 20.0681 16.8469 20.1906 16.8316 20.3055C16.7473 20.5889 16.6631 20.7421 16.6094 21.0178C16.5558 21.1481 16.4409 21.2859 16.4333 21.4238C16.1805 21.6612 15.9431 21.937 15.6597 22.1438C15.7209 22.0442 15.675 21.9446 15.675 21.8374ZM15.2001 24.9855C15.3226 24.1736 15.5601 23.354 15.6367 22.5191C16.5099 22.0672 17.1073 21.0868 17.1303 20.0987C17.0614 19.754 17.1916 19.3634 17.0154 19.034C16.8929 18.5132 16.6094 18.0383 16.2265 17.6783C16.1652 17.617 16.0656 17.5787 16.1039 17.4791C16.1729 15.9932 16.2112 14.5378 16.1422 13.0442C16.0656 12.0561 16.1729 11.0221 16.2188 10.0187C16.2495 9.31401 16.4563 8.60933 16.6707 7.92763C16.8929 7.93529 17.1073 8.05018 17.3218 8.0655C17.3907 8.05018 17.4367 8.11912 17.5056 8.1038C17.5363 8.1038 17.5746 8.08082 17.6129 8.09614C17.6818 8.12678 17.7584 8.16507 17.835 8.16507C18.4401 8.39486 19.1141 8.56337 19.7499 8.70124C19.9184 8.79316 20.0869 8.73188 20.2477 8.83912C20.355 8.83912 20.4316 8.92337 20.5388 8.94635C20.6231 8.95401 20.692 8.99997 20.7686 9.03061C20.8529 9.05359 20.9448 9.04593 21.0214 9.08422C20.7839 9.69699 20.7073 10.4859 21.0367 11.0757C21.1209 11.0681 21.1133 11.16 21.1592 11.2059C21.1975 11.2595 21.2818 11.2672 21.3124 11.3285C21.3584 11.3898 21.4043 11.4587 21.4809 11.497C21.5192 11.5506 21.5575 11.6119 21.6112 11.6425C21.6724 11.6732 21.726 11.7191 21.7797 11.7651C21.8486 11.8034 21.9329 11.811 21.9941 11.8646C21.9022 12.0332 21.726 12.4774 21.6341 12.6995C21.6188 12.7915 21.5422 12.8604 21.5422 12.9523C21.5346 13.0366 21.4656 13.0902 21.4656 13.1744C21.4656 13.2127 21.4733 13.2587 21.4503 13.3046C21.029 14.2085 20.6537 15.2042 20.4929 16.1923C20.1712 17.1344 19.8801 18.1608 19.8188 19.1566C19.5814 19.9915 19.5201 20.8723 19.4129 21.7455C19.4435 21.891 19.3899 22.0289 19.4358 22.1744C19.4205 22.2663 19.3899 22.3659 19.4052 22.4578C19.2673 23.2315 19.2826 24.0587 19.2673 24.8476C19.2903 25.8357 19.1218 26.8621 19.0912 27.8655C19.0682 28.8383 18.7771 29.9183 18.6622 30.891C18.6086 30.9753 18.6239 31.0672 18.6316 31.1591C18.6086 31.2204 18.5933 31.2817 18.5626 31.3429C18.5703 31.4425 18.4937 31.5115 18.4707 31.611C18.4707 31.6876 18.4248 31.7489 18.4018 31.8178C18.3865 31.8944 18.3941 31.9787 18.3558 32.0476C17.9269 31.9174 17.475 31.971 17.0537 32.0783C17.0384 32.0859 17.0231 32.1089 17.0077 32.1166C16.9924 32.1549 16.9541 32.1166 16.9312 32.1549C16.9235 32.1702 16.9158 32.2008 16.9005 32.2008C16.8622 32.2008 16.8239 32.1932 16.8086 32.2315C16.778 32.2315 16.7397 32.2085 16.7167 32.2391C16.7014 32.2544 16.6937 32.2544 16.6707 32.2468C16.5788 32.3157 16.4563 32.3693 16.3414 32.4383C16.3107 32.4612 16.3031 32.5149 16.2571 32.5225C16.2035 32.5455 16.1805 32.6144 16.1192 32.6298C16.1116 32.6374 16.1039 32.6681 16.1039 32.6757C16.0733 32.7293 15.9967 32.7446 15.9737 32.8059C15.9584 32.8519 15.9431 32.9055 15.8971 32.9285C15.8512 32.9821 15.7899 33.0204 15.7669 33.0893C15.7209 33.1276 15.6673 33.1659 15.6367 33.2195C15.6137 33.2808 15.5601 33.3268 15.5218 33.3804C15.4835 33.4417 15.4835 33.5183 15.4375 33.5795C15.1235 33.4646 14.8018 33.3957 14.4877 33.3038C14.4495 33.2808 14.4112 33.2655 14.3652 33.2732C14.3039 33.2885 14.2656 33.2195 14.2043 33.2349C14.1737 33.2349 14.1354 33.2578 14.1124 33.2425C13.7218 33.0587 13.3082 32.9821 12.9022 32.8366C12.6724 32.8212 12.4426 32.6987 12.2205 32.6987C12.1592 32.6374 12.075 32.6757 12.006 32.6757C11.9448 32.6451 11.8758 32.6068 11.8069 32.6144C11.286 32.4 10.6886 32.3004 10.1371 32.1932C10.0605 32.2008 9.99158 32.1472 9.91498 32.1472C9.81541 32.1702 9.72349 32.1472 9.62392 32.1166C9.5703 32.0936 9.51669 32.0859 9.45541 32.0859C9.37881 32.0553 9.30222 32.0093 9.21796 32.0017C9.14137 32.0017 9.07243 31.9634 8.99583 31.9404C8.90392 31.9251 8.812 31.9404 8.72775 31.9098C8.83498 31.3659 8.79669 30.7532 8.51328 30.2629L8.52094 30.2553C8.45966 30.194 8.452 30.0944 8.38307 30.0332C8.29115 29.9872 8.25286 29.8876 8.18392 29.811C8.07668 29.7038 7.98477 29.5583 7.83924 29.4893C7.72434 29.3744 7.57115 29.3515 7.42562 29.2978C7.42562 29.2978 7.43328 29.2902 7.43328 29.2825C7.42562 29.2749 7.42562 29.2749 7.41796 29.2672C7.49456 29.0451 7.55583 28.8153 7.58647 28.5855C8.36009 28.7234 9.15668 28.9072 9.92264 28.9532C10.1984 29.0068 10.4588 29.114 10.7499 29.114C11.4163 29.2442 12.098 29.4051 12.7643 29.4204C13.1626 29.5583 13.5609 29.5966 13.9746 29.6961C14.1584 29.0757 14.4341 28.4629 14.4954 27.8272C14.8248 26.931 15.0392 25.9429 15.2001 24.9855ZM14.3499 33.3038C14.3499 33.3115 14.3499 33.3115 14.3499 33.3038V33.3038ZM5.64094 27.5668C5.62562 27.5668 5.60264 27.5821 5.58732 27.5744C5.50307 27.5285 5.41881 27.5744 5.3269 27.5821C5.16605 27.5591 5.02051 27.5285 4.86732 27.5132C4.10137 27.4366 3.30477 27.4366 2.54647 27.4442C2.21711 27.4902 1.74222 27.3983 1.4052 27.3983C0.976259 27.4212 0.654557 27.4212 0.225621 27.4825C0.309876 27.3064 0.325195 27.2527 0.363493 27.0919C0.570302 26.211 0.899664 25.2919 0.976259 24.3651C0.96094 24.2808 1.02222 24.2195 0.999238 24.1276C0.9686 23.9744 1.02222 23.7829 1.05286 23.6451C1.18307 22.9021 1.16775 22.1515 1.19073 21.4008C1.14477 21.3012 1.18307 21.2093 1.16009 21.1021C1.10647 21.0025 1.12945 20.8876 1.14477 20.7804C1.12945 20.7268 1.12179 20.6732 1.14477 20.6195C1.18307 20.3055 1.11413 19.9838 1.12179 19.6698C1.10647 19.08 1.0452 18.4825 0.937961 17.9157C0.914983 17.617 0.945621 17.3412 0.869025 17.0578C0.838387 16.1464 0.616259 15.2732 0.585621 14.3847C0.562642 13.5191 0.486046 12.6383 0.478387 11.7881C0.493706 10.8689 0.631578 9.9038 0.59328 8.99231C0.754131 8.01954 0.945621 7.00082 1.02222 6.02805C1.25966 5.19316 1.45881 4.31231 1.67328 3.4621C1.88775 2.51231 2.32434 1.57018 2.63073 0.628053C2.63073 0.628053 2.70732 0.405925 2.68434 0.291032C2.8069 0.359968 2.96009 0.306351 3.10562 0.344649C3.22051 0.336989 3.33541 0.390606 3.45796 0.352308C3.61881 0.252734 3.8486 0.382947 3.99413 0.275713C4.34647 0.352308 4.76009 0.375287 5.11243 0.32167C5.16605 0.336989 5.212 0.283372 5.2503 0.336989C5.34988 0.375287 5.65626 0.31401 5.70988 0.32933C5.82477 0.32933 5.932 0.390606 6.06222 0.359968C6.20009 0.298691 6.36094 0.359968 6.50647 0.352308C6.54477 0.367627 6.56775 0.32167 6.60605 0.31401C6.78988 0.382947 7.00434 0.405925 7.21115 0.413585C7.37966 0.421244 7.55583 0.474862 7.72434 0.428904C7.77796 0.444223 7.82392 0.398266 7.86222 0.451883C7.96179 0.482521 8.1686 0.428904 8.25286 0.444223C8.39073 0.474862 8.52094 0.528479 8.66647 0.520819C8.72009 0.5055 8.76605 0.482521 8.81966 0.49784C8.94222 0.513159 9.10307 0.559117 9.2103 0.49784C9.48605 0.597415 9.80775 0.643372 10.1065 0.651032C10.2137 0.727628 10.3592 0.605074 10.4512 0.68933C10.5431 0.735287 10.6656 0.666351 10.7652 0.68167C10.8648 0.712308 10.9643 0.704649 11.0486 0.765925C11.1712 0.804223 11.2937 0.758266 11.4163 0.773585C11.5388 0.796564 11.692 0.850181 11.8069 0.788904C11.8605 0.842521 11.9371 0.834862 12.0137 0.85784C12.3048 0.934436 12.6112 1.01103 12.9099 0.988053C12.9558 1.01103 13.0171 0.965074 13.0401 1.01869C13.1014 1.04933 13.2469 1.03401 13.3618 1.02635C13.4537 1.05699 13.5533 1.04933 13.6299 1.11827C13.852 1.1489 14.0665 1.13358 14.2809 1.1872C14.3192 1.20252 14.3499 1.16422 14.3805 1.16422C14.4341 1.21784 14.5107 1.21784 14.5873 1.23316C14.8707 1.31741 15.1848 1.40167 15.4758 1.39401C15.5218 1.41699 15.5831 1.37103 15.606 1.43231C15.698 1.48593 15.966 1.43231 16.0043 1.44763C16.0503 1.47061 16.0963 1.45529 16.1422 1.43997C16.0043 1.56252 16.012 1.80763 15.8282 1.9838C15.7439 2.13699 15.7592 2.25188 15.7209 2.39741C15.675 2.52763 15.5754 2.68848 15.5984 2.83401C15.3839 3.19401 15.2154 3.63827 15.1541 4.05188C15.1235 4.1055 15.1618 4.17444 15.1005 4.19741C15.0546 4.26635 15.0469 4.43486 15.0316 4.56507C14.932 4.80252 14.8324 5.02465 14.8248 5.28507C14.7865 5.41529 14.7022 5.59146 14.7482 5.72933C14.572 6.11231 14.4495 6.56422 14.4265 6.9855C14.4035 7.03912 14.4418 7.10039 14.3805 7.13869C14.3269 7.24593 14.3805 7.3838 14.3499 7.49869C14.2733 7.75146 14.1967 7.98124 14.212 8.24933C14.1814 8.3872 14.1277 8.56337 14.1814 8.70124C14.1277 8.77018 14.1277 8.85444 14.1124 8.93869C14.0282 9.27571 13.9592 9.63571 13.9822 9.98039C13.9592 10.034 14.0052 10.0953 13.9516 10.1336C13.9056 10.2485 13.9516 10.7234 13.8826 10.8306C13.8597 11.0987 13.9056 11.3285 13.8673 11.5966C13.852 11.6425 13.898 11.6732 13.9056 11.7115C13.8597 11.7804 13.8673 11.8723 13.852 11.9566C13.8137 12.3012 13.7601 12.6689 13.8214 13.0059C13.806 13.0672 13.8597 13.1208 13.806 13.1668C13.7754 13.2817 13.852 13.7566 13.7984 13.8638C13.7831 14.0093 13.8443 14.1472 13.852 14.2851C13.852 14.4229 13.8214 14.6144 13.9056 14.737C13.852 15.1506 13.8597 15.6255 13.9516 16.0315C13.9439 16.0927 13.9975 16.1387 13.9516 16.1923C13.9286 16.3149 14.0205 16.4298 14.0282 16.5446C14.0282 16.8051 14.0129 17.0502 14.0971 17.3029C14.1124 17.4408 14.0971 17.6323 14.1814 17.7472C14.1431 18.1608 14.1814 18.6281 14.2809 19.034C14.2733 19.0953 14.3346 19.1412 14.2809 19.1872C14.258 19.3021 14.3805 19.7617 14.3346 19.8766C14.3269 20.0221 14.3882 20.1523 14.4035 20.2902C14.4112 20.4281 14.3882 20.6195 14.4648 20.7344C14.4035 21.0715 14.4188 21.4391 14.4571 21.7761C14.3958 21.914 14.5414 22.0519 14.4724 22.1744C14.4418 22.2893 14.526 22.4119 14.5184 22.5268C14.4877 22.8178 14.4495 23.0093 14.5031 23.2774C14.4954 23.4153 14.4571 23.5991 14.5184 23.7217C14.4188 24.1276 14.3575 24.5795 14.3652 24.9932C14.3422 25.0468 14.3882 25.1081 14.3346 25.1463C14.2886 25.2536 14.3499 25.3915 14.3269 25.5064C14.2503 25.7898 14.1814 25.9659 14.189 26.2493C14.1584 26.3872 14.0895 26.5557 14.1277 26.6936C13.9592 27.0766 13.829 27.5208 13.7754 27.9268C13.7448 27.9804 13.7831 28.0417 13.7218 28.0723C13.6605 28.1719 13.6758 28.4859 13.6529 28.5242C13.6222 28.5702 13.6299 28.6391 13.6375 28.6927C13.5073 28.6315 13.2239 28.5472 13.0784 28.5932C12.1746 28.3404 11.1941 28.2178 10.2673 28.1336C9.51668 27.9574 8.68179 27.8349 7.91583 27.8349C7.18817 27.6663 6.39924 27.6051 5.64094 27.5668ZM24.5677 9.16082C24.5524 9.19912 24.5218 9.2221 24.4912 9.23741C24.4912 9.23741 24.3992 9.45188 24.292 9.52082C24.1848 9.65869 24.1848 9.77359 24.1235 9.91146C24.0546 10.034 23.9397 10.1795 23.9397 10.3251C23.6716 10.6468 23.4418 11.0681 23.3192 11.4664C23.2809 11.5123 23.3039 11.5889 23.2426 11.6042C23.166 11.7038 23.1584 11.9412 23.0818 12.0332C22.9439 12.217 22.8597 12.4161 22.8137 12.6383C22.7601 12.7685 22.6452 12.9217 22.6682 13.0672C22.4384 13.4195 22.2469 13.8485 22.1626 14.2621C22.132 14.3157 22.1626 14.3847 22.0937 14.4076C22.0401 14.4766 22.0477 14.5761 22.0324 14.6604C21.9405 14.9744 21.7873 15.1506 21.7643 15.48C21.7184 15.6102 21.6341 15.7787 21.6648 15.9242C21.5499 16.1157 21.458 16.3532 21.4043 16.5829C21.3584 16.7744 21.2665 16.9659 21.2741 17.1574C21.2435 17.211 21.2818 17.28 21.2205 17.3029C21.1592 17.4102 21.2129 17.5481 21.1746 17.6629C21.0826 17.9081 20.9831 18.1455 20.9984 18.4059C20.9677 18.5438 20.8988 18.72 20.9371 18.8578C20.7763 19.2408 20.6767 19.7081 20.669 20.1217C20.646 20.1753 20.692 20.2366 20.6307 20.2749C20.5848 20.3821 20.646 20.52 20.6231 20.6349C20.5541 20.8876 20.4852 21.1251 20.5158 21.3932C20.5005 21.531 20.4392 21.7149 20.5005 21.8451C20.3856 22.251 20.3167 22.7183 20.355 23.1319C20.3397 23.1855 20.3856 23.2468 20.332 23.2851C20.3014 23.377 20.3473 23.4842 20.355 23.5838C20.332 23.8978 20.2477 24.097 20.3167 24.4034C20.309 24.5412 20.2707 24.7251 20.332 24.8553C20.2324 25.2612 20.2018 25.7285 20.2401 26.1421C20.2248 26.1957 20.2784 26.257 20.2171 26.2953C20.1865 26.4178 20.2631 26.6323 20.2248 26.7472C20.1635 26.9617 20.1482 27.1761 20.1712 27.4059C20.1558 27.5438 20.1022 27.7276 20.1635 27.8578C20.0486 28.2561 19.9797 28.7157 19.9873 29.1293C19.9643 29.1829 20.0103 29.2442 19.9567 29.2825C19.9107 29.3898 19.972 29.5276 19.949 29.6425C19.8724 29.9183 19.8112 30.1098 19.8188 30.3855C19.7882 30.5234 19.7269 30.6995 19.7729 30.8298C19.6733 31.0289 19.6043 31.274 19.5584 31.4961C19.5201 31.6876 19.4205 31.8715 19.4282 32.0706C19.3975 32.1242 19.4358 32.1932 19.3746 32.2161C19.3133 32.3157 19.3516 32.4459 19.3133 32.5532C19.2597 32.6834 19.2443 32.7676 19.1601 32.8749C19.0988 33.0051 19.1065 33.1506 19.0605 33.2808C19.0146 33.411 18.915 33.5719 18.938 33.7098C18.7158 34.0621 18.5243 34.4834 18.4095 34.8817C18.3712 34.9276 18.4018 34.9966 18.3329 35.0195C18.2563 35.1115 18.2256 35.4255 18.195 35.4561C18.1567 35.5021 18.1567 35.5634 18.1567 35.617C18.0877 35.5634 17.9958 35.5557 17.9192 35.5098C17.9192 35.5098 17.8043 35.4332 17.7277 35.4332C17.6741 35.4408 17.6205 35.4485 17.5746 35.4102C17.3601 35.3412 17.1686 35.211 16.9465 35.1651C16.349 34.9812 15.7439 34.7055 15.1312 34.6366C14.7865 34.4757 14.4265 34.3838 14.0588 34.2689C13.5763 34.1081 13.0707 33.9778 12.5805 33.9012C11.8835 33.6638 11.1329 33.4646 10.3975 33.3268C9.56264 33.1889 8.70477 32.8978 7.83924 32.8136C7.7703 32.8289 7.71668 32.7676 7.64009 32.7829C7.60179 32.7906 7.56349 32.8059 7.53286 32.7983C7.37966 32.76 7.23413 32.714 7.08094 32.6834C6.4069 32.5915 5.74051 32.4153 5.05115 32.4766C5.19669 32.2851 5.2503 32.1625 5.2886 31.9557C5.33456 31.8715 5.39583 31.7949 5.41115 31.7029C5.80179 31.0212 6.06222 30.2323 6.28434 29.474C6.27669 29.3898 6.34562 29.3361 6.34562 29.2442C6.34562 29.2059 6.3303 29.16 6.34562 29.114C6.43754 28.8766 6.52179 28.6391 6.59073 28.3864C6.60605 28.394 6.7669 28.4629 6.85115 28.4476C6.95839 28.4093 7.05796 28.4629 7.15754 28.4936C7.28009 28.4859 7.31839 28.5012 7.27243 28.6315C7.22647 28.777 7.17285 28.9532 7.18051 29.0987C7.08094 29.2059 7.0886 29.3821 6.99668 29.5047H7.01966C7.13456 29.52 7.24179 29.5812 7.34137 29.6119C7.4486 29.6578 7.57115 29.6808 7.65541 29.7727C7.74732 29.811 7.81626 29.857 7.86988 29.9336C7.91583 29.9642 7.97711 29.9795 8.00775 30.0332C8.02307 30.0408 8.04605 30.0485 8.05371 30.0715C8.04605 30.1787 8.17626 30.2323 8.22988 30.3166C8.25286 30.3319 8.30647 30.4774 8.31413 30.5004C8.34477 30.6076 8.39073 30.7072 8.36775 30.8221C8.39073 30.9446 8.42137 31.0672 8.46732 31.1821C8.48264 31.3506 8.42137 31.5344 8.48264 31.6876C8.39839 31.8178 8.39839 31.994 8.29881 32.1242C8.47498 32.1472 8.63583 32.2238 8.812 32.2544C8.91924 32.2544 9.01881 32.3004 9.12605 32.3234C9.22562 32.3081 9.30988 32.354 9.40179 32.377C9.48605 32.3617 9.56264 32.377 9.6469 32.377C9.67754 32.4 9.70051 32.4383 9.74647 32.4383C9.86903 32.4383 9.9686 32.4383 10.0912 32.4689C10.2214 32.4995 10.3286 32.5915 10.4665 32.5991C10.612 32.5378 10.7805 32.7064 10.9184 32.6374C11.0563 32.7293 11.2324 32.7829 11.3933 32.8212C11.5312 32.8519 11.669 32.9285 11.8146 32.9055C11.8605 32.9285 11.8988 32.8825 11.9218 32.9438C11.9907 32.9974 12.1056 32.9361 12.1822 32.9668C12.2588 33.0051 12.3507 33.0051 12.4043 33.074C12.5039 33.12 12.6112 33.0893 12.7107 33.1123C12.8103 33.1429 12.9405 33.2119 13.0324 33.1659C13.1626 33.2655 13.3388 33.3268 13.4997 33.3651C13.6375 33.4034 13.7754 33.48 13.9133 33.4646C13.9592 33.4953 13.9975 33.4493 14.0205 33.5106C14.0894 33.5642 14.3269 33.5642 14.3499 33.5719C14.3882 33.6102 14.4418 33.6025 14.4801 33.6255C14.5184 33.6715 14.5643 33.6868 14.6256 33.6944C14.7022 33.7404 14.7865 33.6944 14.8631 33.7251C14.9703 33.7634 15.1158 33.8476 15.2307 33.8017C15.315 33.8859 15.4988 33.9242 15.5831 33.9855C15.5831 33.9855 15.5831 33.9012 15.5907 33.9012C15.7056 33.7404 15.7899 33.5719 15.9048 33.411C15.9124 33.3344 15.9967 33.3038 16.0273 33.2425C16.035 33.1966 16.0426 33.1659 16.0809 33.1353C16.0886 33.1276 16.0886 33.1123 16.0886 33.1046C16.0963 33.074 16.1346 33.097 16.1575 33.074C16.2571 32.9744 16.3107 32.8442 16.372 32.8136C16.3797 32.8059 16.4026 32.8212 16.418 32.8212C16.4333 32.8212 16.4792 32.7676 16.4716 32.737C16.4869 32.6987 16.5482 32.691 16.5788 32.6527C16.6248 32.6144 16.6784 32.5685 16.7397 32.5838C16.778 32.5378 16.8622 32.5455 16.8929 32.4919C16.9465 32.4995 16.9388 32.4919 16.9541 32.4459C16.9771 32.4459 16.9694 32.4306 16.9771 32.4229C17.0307 32.4919 17.138 32.354 17.1686 32.3464C17.2299 32.3617 17.2758 32.3157 17.3295 32.3234C17.4826 32.3846 17.6358 32.2391 17.789 32.2698C17.9116 32.2621 18.0418 32.3234 18.149 32.2698C18.2486 32.3464 18.4401 32.3693 18.532 32.4383C18.578 32.2391 18.7082 32.0629 18.7235 31.8561C18.7771 31.7719 18.7771 31.6723 18.8001 31.5804C18.8384 31.5191 18.8614 31.4502 18.8384 31.3812C18.8384 31.3429 18.8614 31.3046 18.846 31.2664C18.9533 31.1591 18.9456 30.6842 19.0375 30.5464C19.0835 30.2936 19.0758 30.0332 19.1448 29.7804C19.1601 29.7344 19.1218 29.7038 19.1218 29.6655C19.1754 29.5966 19.1754 29.5123 19.1984 29.4204C19.2826 29.0834 19.3592 28.7157 19.3363 28.371C19.3592 28.3174 19.3133 28.2561 19.3669 28.2178C19.4052 28.1183 19.3669 27.9344 19.3746 27.8195C19.4741 27.4595 19.4358 27.1225 19.4741 26.7549C19.4895 26.7089 19.4435 26.6783 19.4435 26.64C19.4971 26.571 19.4818 26.4791 19.4971 26.3949C19.5507 26.0502 19.5967 25.6825 19.5507 25.3455C19.566 25.2842 19.5124 25.2306 19.5737 25.1846C19.6043 25.0851 19.5584 24.9778 19.5431 24.8783C19.566 24.5949 19.6426 24.3421 19.5814 24.0587C19.589 23.9208 19.635 23.7293 19.566 23.6068C19.658 23.2774 19.6809 22.9098 19.6809 22.5651C19.7575 22.4349 19.6273 22.274 19.7116 22.1668C19.7575 22.0519 19.6809 21.9217 19.6963 21.8068C19.7499 21.5387 19.8188 21.3242 19.7805 21.0485C19.7958 20.9106 19.8571 20.7268 19.8035 20.5966C19.9414 20.1983 20.0256 19.7387 20.0409 19.3251C20.0639 19.2715 20.018 19.2102 20.0792 19.1719C20.1329 19.0646 20.0716 18.9268 20.1022 18.8119C20.1788 18.5591 20.2631 18.337 20.2631 18.0689C20.2937 17.931 20.3703 17.7549 20.3243 17.6247C20.5005 17.2417 20.6307 16.7974 20.6843 16.3838C20.715 16.3302 20.6767 16.2612 20.738 16.2383C20.7992 16.1387 20.7533 15.9932 20.7992 15.8859C20.8529 15.7787 20.8605 15.6638 20.9448 15.5719C21.006 15.4417 20.9984 15.2961 21.029 15.1583C21.075 15.0281 21.1669 14.8595 21.1363 14.7217C21.3431 14.354 21.5192 13.9251 21.6112 13.5191C21.6495 13.4732 21.6188 13.3966 21.6801 13.3812C21.7567 13.2817 21.7184 13.1361 21.772 13.0366L21.7873 13.0442C21.7873 13.0442 21.7797 13.0442 21.772 13.0366C21.8026 12.9983 21.8026 12.9523 21.8409 12.9217C21.8563 12.8987 21.8486 12.8604 21.8792 12.8374C21.9712 12.7608 22.0095 12.6229 22.0095 12.5081C22.0401 12.3625 22.1933 12.217 22.1626 12.0715C22.2699 11.9872 22.2852 11.8264 22.3848 11.7344C22.2622 11.7038 22.178 11.5812 22.0631 11.5276C21.9712 11.4817 21.8869 11.4281 21.8103 11.3591C21.7337 11.3361 21.6877 11.2825 21.6418 11.2289C21.5729 11.2136 21.5039 11.1753 21.4733 11.091C21.4426 11.0221 21.3584 10.9915 21.3048 10.9378C21.2818 10.9302 21.2741 10.8 21.2741 10.7846C21.2282 10.6927 21.1516 10.5778 21.1592 10.4706C21.098 10.4323 21.0903 10.371 21.1056 10.3021C21.0826 10.2332 21.098 10.1795 21.1286 10.1183C21.1439 9.98805 21.1133 9.85784 21.1209 9.72763C21.1516 9.61273 21.1899 9.47486 21.2129 9.35997C21.2129 9.29869 21.1669 9.28337 21.2358 9.23741C21.3124 9.12252 21.3354 8.96933 21.435 8.8621C21.2129 8.83146 21.029 8.67827 20.8069 8.65529C20.7303 8.60933 20.646 8.58635 20.5541 8.57869C20.4852 8.57103 20.4316 8.5021 20.355 8.50976C20.3014 8.52507 20.2477 8.5021 20.2018 8.49444C20.1558 8.50976 20.1405 8.47146 20.1099 8.44848C20.0026 8.40252 19.6656 8.36422 19.6197 8.33358C19.566 8.34124 19.5354 8.30295 19.4971 8.26465C19.3822 8.21103 19.2673 8.23401 19.1524 8.21103C19.0452 8.18039 18.8997 8.1038 18.7848 8.1421C18.5473 7.99656 18.2486 7.91231 17.9729 7.86635C17.8809 7.77444 17.7277 7.87401 17.6512 7.7821C17.5669 7.72848 17.4443 7.7821 17.3601 7.75146C17.2682 7.7055 17.1763 7.71316 17.0997 7.63656C16.9771 7.58295 16.8469 7.6289 16.7243 7.58295C16.8086 7.3072 16.9005 7.13869 16.9388 6.83231C17.0231 6.86295 17.1073 6.87061 17.1686 6.93188C17.2912 6.97784 17.4137 6.95486 17.5286 6.97784C17.6435 7.00848 17.7967 7.08507 17.9116 7.03912C17.9652 7.10039 18.0341 7.10039 18.1107 7.13103C18.3865 7.23827 18.6929 7.35316 18.9839 7.36082C19.0299 7.3838 19.0912 7.3455 19.1141 7.40678C19.1831 7.45273 19.275 7.42976 19.3592 7.43741C19.5737 7.49103 19.6886 7.59061 19.8954 7.6289C20.0792 7.58295 20.2554 7.77444 20.4316 7.71316C20.5924 7.82039 20.7992 7.89699 20.9984 7.94295C21.1669 7.9889 21.3201 8.08082 21.4963 8.07316C21.5422 8.1038 21.6035 8.0655 21.6188 8.12678C21.7031 8.18805 21.8333 8.1421 21.9252 8.18039C22.0171 8.23401 22.1167 8.23401 22.1933 8.31827C22.3082 8.37954 22.4384 8.35656 22.5533 8.3872C22.6682 8.4255 22.8137 8.50976 22.9363 8.47146C23.2426 8.65529 23.6333 8.80082 23.9856 8.8621C24.0316 8.89273 24.0929 8.85444 24.1082 8.91571C24.1924 8.97699 24.4682 8.96933 24.5065 8.99231C24.5448 9.02295 24.5984 9.01529 24.6443 9.00763C24.6367 9.0689 24.5754 9.09954 24.5677 9.16082Z",fill:"black"}),p.createElement("path",{d:"M10.352 13.7566C10.3137 12.5847 9.64727 11.2672 8.43706 10.9302C7.24217 10.2868 5.74855 10.754 4.89834 11.7191C3.51195 13.1438 4.1094 15.9855 6.04727 16.5753C7.95451 17.594 10.4515 15.8629 10.352 13.7566ZM10.0762 13.7566C10.0456 13.9021 10.0762 13.9864 10.0073 14.0859C9.96897 14.2161 9.99961 14.3617 9.96897 14.4919C9.93068 14.6221 9.83876 14.7829 9.85408 14.9208C9.59366 15.2732 9.32557 15.6332 9.01153 15.9395C8.99621 15.9778 8.97323 15.9855 8.93493 15.9778C8.8277 16.0238 8.77408 16.154 8.66685 16.2076C8.55961 16.2536 8.4677 16.3149 8.3528 16.3149C8.20727 16.3455 8.10004 16.4527 7.97748 16.4834C7.84727 16.5217 7.66344 16.514 7.54855 16.5983C7.13493 16.5523 6.71365 16.491 6.3077 16.3991C6.26174 16.3685 6.1928 16.3991 6.16983 16.3378C6.09323 16.2689 5.77919 16.2 5.64897 16.0774C5.5877 15.9702 5.44983 15.8629 5.33493 15.817C5.17408 15.7251 5.1128 15.5106 4.94429 15.434C4.76812 15.0587 4.62259 14.6527 4.49238 14.2621C4.50004 14.2008 4.43876 14.1625 4.48472 14.1089C4.50004 13.994 4.42344 13.8791 4.42344 13.7642C4.45408 13.6187 4.42344 13.5344 4.49238 13.4349C4.53068 13.3047 4.50004 13.1591 4.53068 13.0289C4.56897 12.8987 4.66089 12.7378 4.64557 12.6C4.906 12.2476 5.17408 11.8876 5.48812 11.5812C5.50344 11.5429 5.52642 11.5353 5.56472 11.5429C5.67195 11.497 5.72557 11.3668 5.8328 11.3132C5.94004 11.2672 6.03195 11.2059 6.14685 11.2059C6.29238 11.1753 6.39961 11.0681 6.52217 11.0374C6.65238 10.9991 6.83621 11.0068 6.9511 10.9225C7.36472 10.9685 7.786 11.0298 8.19195 11.1217C8.23791 11.1523 8.30685 11.1217 8.32982 11.1829C8.38344 11.2366 8.4677 11.2442 8.54429 11.2595C8.8277 11.3591 8.90429 11.5889 9.15706 11.7038C9.31791 11.7957 9.37919 12.0102 9.5477 12.0868C9.72387 12.4621 9.8694 12.8681 9.99961 13.2587C9.99195 13.32 10.0532 13.3583 10.0073 13.4119C9.99195 13.5268 10.0762 13.6417 10.0762 13.7566Z",fill:"black"}),p.createElement("path",{d:"M14.1581 4.39658C14.0892 4.3736 14.0355 4.32764 13.9666 4.30466C13.8517 4.27403 13.7675 4.21275 13.6602 4.16679C13.5913 4.15913 13.5606 4.10552 13.507 4.06722C13.4764 4.0519 13.4381 4.06722 13.4151 4.04424C13.3921 4.02126 13.3692 4.0136 13.3385 3.99828C13.3309 3.89105 13.2006 3.87573 13.1317 3.81445C13.0704 3.70722 13.0015 3.58466 12.9172 3.49275C12.9249 3.41615 12.856 3.34722 12.8483 3.27828C12.856 3.23998 12.8483 3.20169 12.8253 3.17105C12.81 3.10211 12.8636 3.04083 12.833 2.9719C12.8253 2.88764 12.8177 2.81105 12.787 2.72679C12.7717 2.58126 12.8253 2.42041 12.8177 2.27488C12.787 2.22126 12.787 2.19062 12.833 2.14466C12.8789 2.02977 12.8789 1.87658 12.9555 1.777H12.9479L12.9555 1.76935C12.7334 1.76169 12.5343 1.64679 12.3121 1.65445C12.1666 1.59317 12.0211 1.63147 11.8755 1.57786C11.8066 1.58552 11.7453 1.60083 11.6764 1.58552C11.6381 1.60849 11.6151 1.57786 11.5845 1.55488C11.4696 1.51658 11.1249 1.5319 11.0789 1.50892C10.9717 1.4936 10.8721 1.42466 10.7496 1.43998C10.6194 1.4936 10.4662 1.417 10.3283 1.417C10.29 1.40169 10.267 1.44764 10.2364 1.44764C10.1292 1.37105 9.98362 1.40169 9.86873 1.33275C9.66958 1.30977 9.47043 1.30211 9.27894 1.26381C9.21766 1.29445 9.15639 1.27913 9.10277 1.29445C9.07979 1.27913 9.05681 1.24083 9.01851 1.24849C8.75043 1.31743 8.55128 1.18722 8.29851 1.18722C8.13766 1.26381 7.93086 1.11828 7.77766 1.2102C7.47894 1.07998 7.1266 1.11828 6.8049 1.06466C6.74362 1.0953 6.68234 1.08764 6.62873 1.10296C6.60575 1.08764 6.58277 1.057 6.54447 1.06466C6.46022 1.06466 6.38362 1.11062 6.29937 1.10296C6.26873 1.08764 6.22277 1.10296 6.19213 1.07998C6.16915 1.07232 6.13851 1.0953 6.11554 1.07998C6.06958 1.03403 5.97766 1.03403 5.90873 1.04169C5.80149 1.10296 5.66362 1.04935 5.54107 1.057C5.51043 1.057 5.46447 1.08764 5.43383 1.07232C5.34192 1.04169 5.23468 1.057 5.15043 1.01105C5.17341 1.1336 5.05086 1.19488 5.02788 1.30977C5.01256 1.40935 4.9283 1.47062 4.9283 1.5702C4.92064 1.61615 4.85171 1.63147 4.85937 1.68509C4.87468 1.72339 4.85171 1.75403 4.83639 1.78466C4.84405 1.83062 4.81341 1.8153 4.78277 1.83062C4.73681 1.8919 4.69086 2.03743 4.69086 2.03743C4.69086 2.09105 4.61426 2.137 4.56064 2.16764C4.49937 2.22126 4.49937 2.31318 4.45341 2.36679C4.39979 2.42807 4.30788 2.48169 4.31554 2.56594C4.22362 2.56594 4.17766 2.66552 4.08575 2.67318C4.06277 2.71147 4.00915 2.71147 3.99383 2.74977C3.97086 2.78041 3.94022 2.77275 3.90958 2.78807C3.87894 2.80339 3.87128 2.84169 3.84064 2.84935C3.81766 2.857 3.77937 2.84935 3.76405 2.87232C3.74873 2.88764 3.74873 2.91828 3.73341 2.92594C3.69511 2.9336 3.69511 2.98722 3.65681 2.94892C3.50362 2.96424 3.41171 3.14807 3.28149 3.08679C3.22022 3.09445 3.1283 3.13275 3.09 3.17871C2.8832 3.20935 2.67639 3.28594 2.46958 3.23232C2.50788 3.30892 2.41596 3.38552 2.39298 3.44679C2.38532 3.50807 2.35469 3.56169 2.35469 3.62296C2.32405 3.68424 2.29341 3.73786 2.30873 3.80679C2.29341 3.89871 2.26277 4.02892 2.21681 4.11318C2.15554 4.35062 2.03298 4.84083 2.02532 5.06296C1.99468 5.20083 1.91043 5.377 1.95639 5.51488C1.77256 5.87488 1.74958 6.30381 1.65 6.69445C1.67298 6.77105 1.65 6.83998 1.65766 6.91658C1.63469 6.94722 1.60405 6.9702 1.60405 7.01615C1.62703 7.42211 1.4432 7.72083 1.48149 8.08849C1.45851 8.22637 1.4049 8.4102 1.45851 8.54807C1.37426 8.76254 1.33596 9.0153 1.32064 9.25275C1.30532 9.4519 1.24405 9.65871 1.29 9.85786C1.27469 9.91913 1.32064 9.97275 1.26703 10.0187C1.25171 10.2179 1.30532 10.5702 1.22107 10.731C1.19043 10.8766 1.24405 11.0145 1.24405 11.16C1.23639 11.3055 1.19809 11.4893 1.26703 11.6196C1.20575 11.8417 1.19043 12.1021 1.19809 12.3319C1.19809 12.531 1.16745 12.7455 1.22873 12.937C1.21341 12.9983 1.26703 13.0519 1.22107 13.0979C1.19809 13.1821 1.23639 13.2664 1.25937 13.343C1.27468 13.703 1.21341 13.9174 1.31298 14.2315C1.32064 14.3693 1.29766 14.5685 1.38192 14.6834C1.34362 14.9132 1.35128 15.1659 1.38192 15.4034C1.4049 15.6025 1.38958 15.817 1.46617 16.0008C1.45851 16.0621 1.51979 16.1081 1.47383 16.1617C1.45851 16.2536 1.51213 16.3379 1.53511 16.4298C1.56575 16.7821 1.51979 16.9813 1.62703 17.2876C1.64234 17.4255 1.62703 17.617 1.71128 17.7396C1.67298 17.9693 1.6883 18.2221 1.71894 18.4519C1.74192 18.651 1.71894 18.8579 1.78788 19.0417C1.78022 19.103 1.83383 19.1489 1.78788 19.2025C1.7649 19.3251 1.85681 19.44 1.85681 19.5625C1.84149 19.8306 1.81851 20.0757 1.88745 20.3285C1.88745 20.4664 1.86447 20.6579 1.94107 20.7804C1.87213 21.2017 1.85681 21.6689 1.91043 22.0902C1.89511 22.1515 1.94873 22.2051 1.89511 22.251C1.85681 22.5345 1.97171 22.7489 1.84915 22.9634C1.83383 23.1013 1.84915 23.2238 1.86447 23.3617C1.84915 23.5072 1.78022 23.6987 1.84915 23.8366C1.79554 23.9591 1.75724 24.1659 1.74192 24.2962C2.01766 24.3191 2.27043 24.4034 2.5232 24.503C2.56915 24.5183 2.59979 24.5566 2.63809 24.5872C2.69171 24.6255 2.76064 24.6255 2.8066 24.6715C2.85256 24.6791 2.86022 24.7098 2.86022 24.7481C2.95979 24.8553 3.11298 24.9242 3.1666 25.0698C3.19724 25.154 3.2432 25.2306 3.27383 25.3149C3.27383 25.4374 3.32745 25.5676 3.38873 25.6749C3.4883 25.8357 3.41171 26.0655 3.50362 26.2187C3.47298 26.3642 3.45766 26.5481 3.39639 26.6936C3.63383 26.6936 3.8483 26.7625 4.08575 26.7472C4.18532 26.7855 4.29256 26.7549 4.39213 26.7625C4.47639 26.7855 4.55298 26.7932 4.62958 26.7625C4.66788 26.7625 4.70617 26.7779 4.74447 26.7549C4.77511 26.7472 4.79043 26.7779 4.81341 26.7855C4.93596 26.8162 5.06617 26.7472 5.18873 26.7625C5.27298 26.7855 5.35724 26.7702 5.42617 26.8315C5.53341 26.8621 5.63298 26.8085 5.73256 26.8162C5.83213 26.8315 5.97 26.8698 6.06192 26.8085C6.20745 26.8774 6.39128 26.9081 6.55979 26.9157C6.69766 26.9234 6.85085 26.977 6.98873 26.9387C7.03468 26.9617 7.07298 26.9081 7.10362 26.9617C7.21086 26.9847 7.39468 26.9387 7.4866 26.9847C7.53256 26.9693 7.5632 27 7.60149 27.023C7.70873 27.0536 7.8083 27.0076 7.90788 27.0153C8.00745 27.0306 8.14532 27.0766 8.23724 27.023C8.38277 27.0996 8.5666 27.1379 8.73511 27.1455C8.87298 27.1608 9.01851 27.2221 9.16405 27.1838C9.21 27.2068 9.2483 27.1532 9.27128 27.2145C9.39383 27.2681 9.59298 27.1915 9.65426 27.2451C9.71554 27.2374 9.75383 27.2681 9.80745 27.2987C9.86873 27.3064 9.93 27.314 9.99128 27.3217C10.0372 27.314 10.0832 27.2834 10.1368 27.3064C10.2517 27.3217 10.4049 27.3906 10.5121 27.3293C10.6117 27.4059 10.7649 27.383 10.8721 27.4519C10.8875 27.4366 10.9411 27.2374 10.987 27.1915C11.0177 27.0766 11.0636 26.9693 11.1249 26.8698C11.1326 26.7625 11.2398 26.7089 11.2321 26.594C11.2475 26.5481 11.2551 26.4945 11.3164 26.4945C11.3853 26.4332 11.4543 26.257 11.4543 26.257C11.4466 26.2187 11.5309 26.211 11.5462 26.1957C11.5615 26.1957 11.5921 26.0808 11.6075 26.0732C11.6381 26.0655 11.6611 26.0272 11.684 26.0042C11.7223 25.9583 11.776 25.92 11.8372 25.9123C11.8679 25.8817 11.9215 25.8204 11.9751 25.7974C12.0364 25.7974 12.0211 25.7898 12.0287 25.7438C12.0517 25.7362 12.044 25.7285 12.0517 25.7132C12.1436 25.7821 12.1513 25.6366 12.2126 25.6136C12.2662 25.6059 12.3198 25.5753 12.3734 25.56C12.5419 25.5983 12.6721 25.4374 12.833 25.4451C12.9402 25.4221 13.0857 25.4604 13.1777 25.3915C13.3002 25.4374 13.4611 25.4374 13.5913 25.5064V25.4987H13.5989C13.6143 25.2919 13.7138 25.0927 13.7062 24.8859C13.7521 24.794 13.7292 24.7021 13.7368 24.6102C13.7675 24.5413 13.7751 24.4723 13.7445 24.3957C13.7521 24.3498 13.7445 24.3115 13.7445 24.2655C13.844 24.1659 13.7368 24.0127 13.7598 23.8902C13.8057 23.6298 13.8594 23.3847 13.8057 23.1242C13.8134 22.9864 13.8517 22.7949 13.7828 22.6723C13.8823 22.2281 13.8594 21.7455 13.7981 21.3013C13.7751 21.2706 13.7828 21.24 13.8057 21.2093C13.8364 21.0944 13.7445 20.9719 13.7445 20.8493C13.7598 20.5813 13.7828 20.3438 13.7062 20.0834C13.6985 19.9455 13.7215 19.754 13.6372 19.6315C13.6832 19.2102 13.6526 18.7353 13.553 18.3293C13.5606 18.2681 13.4994 18.2221 13.5453 18.1685C13.553 18.0536 13.4458 17.8238 13.4611 17.7166C13.484 17.4868 13.4611 17.2723 13.3921 17.0502C13.3768 16.9123 13.3921 16.7208 13.3079 16.6059C13.3462 16.1847 13.3155 15.7251 13.2313 15.3115C13.2389 15.2502 13.1853 15.2042 13.2313 15.1506C13.2543 15.051 13.193 14.9515 13.17 14.8596C13.17 14.6834 13.147 14.6068 13.193 14.4613C13.1777 14.2085 13.1164 13.9634 13.1317 13.703C13.1394 13.657 13.0934 13.634 13.0857 13.5957C13.1317 13.5191 13.1164 13.4349 13.1164 13.3506C13.1777 12.8527 13.1547 12.3932 13.124 11.8876C13.1394 11.5583 13.216 11.3362 13.17 11.0298C13.1853 10.8919 13.2313 10.7081 13.17 10.5779C13.2772 10.2562 13.3155 9.88849 13.3309 9.54381C13.4075 9.4136 13.2926 9.25275 13.3768 9.14552C13.4228 9.03828 13.3615 8.90041 13.3845 8.78552C13.4228 8.67062 13.4075 8.55573 13.484 8.45615C13.53 8.31828 13.4917 8.17275 13.507 8.03488C13.53 7.897 13.5989 7.72083 13.553 7.58296C13.7062 7.19232 13.8134 6.74041 13.8517 6.32679C13.8823 6.27317 13.8364 6.20424 13.8977 6.1736C13.9589 6.06637 13.9513 5.76764 13.9589 5.737C13.9972 5.69871 13.9896 5.63743 14.0126 5.59913C14.0585 5.56083 14.0738 5.49956 14.0815 5.43828C14.1045 5.377 14.1121 5.31573 14.0968 5.25445C14.1121 5.12424 14.204 4.97871 14.1964 4.84083C14.1734 4.8102 14.1734 4.77956 14.2117 4.75658C14.2653 4.67232 14.296 4.51147 14.3572 4.43488C14.3189 4.47318 14.204 4.42722 14.1581 4.39658ZM13.7981 5.04764C13.7598 5.42296 13.5836 5.76764 13.6066 6.14296C13.4151 6.75573 13.2696 7.39913 13.193 8.04254C13.0321 9.29105 12.833 10.5319 12.833 11.8034C12.856 11.88 12.8023 11.9566 12.833 12.0408C12.8406 12.0791 12.8713 12.1251 12.8636 12.1634C12.8483 12.3472 12.8177 12.5234 12.81 12.7072C12.8177 13.5345 12.7564 14.4076 12.9326 15.2042C12.9402 16.2 13.0245 17.257 13.2466 18.2221C13.2619 19.4247 13.484 20.6425 13.484 21.8374C13.4764 22.68 13.4764 23.5608 13.4381 24.3727C13.4151 24.411 13.4381 24.4493 13.4304 24.4876C13.4151 24.5413 13.3768 24.5949 13.3768 24.6562C13.3768 24.7404 13.3538 24.817 13.3385 24.8936C13.3309 24.9702 13.3538 25.0545 13.3309 25.131C13.0321 25.0621 12.0517 25.2076 11.9138 25.491C11.8755 25.4987 11.8372 25.4987 11.8296 25.537C11.7989 25.537 11.753 25.5293 11.7377 25.56C11.73 25.5753 11.7147 25.5753 11.6994 25.5753C11.6151 25.6596 11.5002 25.7285 11.4006 25.8127C11.347 25.9123 11.2321 25.9889 11.1938 26.1038C11.1172 26.1574 11.0943 26.2417 11.0713 26.3259C11.0253 26.3949 10.9487 26.4562 10.9334 26.5404C10.8951 26.5864 10.8415 26.6247 10.8185 26.6859C10.8032 26.7549 10.7572 26.8085 10.7266 26.8698C10.7036 26.9387 10.7036 27.0153 10.673 27.0766C10.3436 27.0076 10.0143 26.9923 9.69256 26.9464C9.59298 26.9081 9.43213 26.9081 9.30192 26.9464C8.93426 26.8315 8.55894 26.8162 8.17596 26.7472C7.8083 26.7089 7.4483 26.6706 7.09596 26.6859C6.33 26.5404 5.51809 26.4868 4.75213 26.5021C4.59128 26.4945 4.43809 26.4562 4.2849 26.4408C4.2083 26.4562 4.13171 26.4255 4.06277 26.4179C3.97086 26.4179 3.8866 26.4485 3.79469 26.4255C3.82532 25.9353 3.69511 25.3532 3.41937 24.9396C3.34277 24.8323 3.27383 24.7174 3.18192 24.6255C3.11298 24.5949 3.05171 24.5566 3.02107 24.4953C2.87554 24.3804 2.74532 24.2272 2.56915 24.1736C2.43894 24.0817 2.28575 24.074 2.13256 24.051C2.1632 23.5532 2.27809 22.8025 2.19383 22.2817C2.27809 21.2706 2.27809 20.1983 2.09426 19.2102C2.13256 17.9847 1.83383 16.7591 1.74958 15.5489C1.69596 14.5302 1.54277 13.5115 1.55809 12.5081C1.55043 11.6962 1.64234 10.8613 1.58873 10.0647C1.71894 9.19147 1.81086 8.27998 1.91809 7.39913C2.01766 6.41105 2.33937 5.40764 2.5232 4.4119C2.55383 4.34296 2.57681 4.08254 2.59979 4.00594C2.66107 3.937 2.68405 3.83743 2.72234 3.74552C2.73766 3.6919 2.71469 3.63062 2.74532 3.577C3.02873 3.58466 3.35809 3.45445 3.61851 3.37786C3.65681 3.31658 3.72575 3.33956 3.77171 3.28594C3.80234 3.19403 3.91724 3.23232 3.97086 3.15573C4.37681 3.02552 4.69086 2.65786 4.9283 2.30552C4.99724 2.26722 4.9666 2.18296 5.02788 2.137C5.08915 2.08339 5.03554 1.99147 5.10447 1.93786C5.14277 1.84594 5.20405 1.777 5.26532 1.70041C5.28064 1.63913 5.31128 1.59318 5.34958 1.54722C5.37256 1.4936 5.3649 1.42466 5.39554 1.37105C5.69426 1.40169 6.01596 1.39403 6.31469 1.39403C7.11128 1.37871 7.94617 1.55488 8.76575 1.56254C9.56234 1.57786 10.3896 1.79232 11.2092 1.83062C11.2857 1.8153 11.347 1.86126 11.4236 1.8536C11.5232 1.82296 11.6075 1.83828 11.6994 1.86126C11.753 1.88424 11.8066 1.88424 11.8602 1.88424C11.9292 1.90722 11.9981 1.94552 12.0747 1.95318C12.1589 1.94552 12.2355 1.98381 12.3121 1.99913C12.3964 2.00679 12.4883 1.99147 12.5726 2.01445C12.4577 2.45871 12.4806 2.96424 12.5955 3.41615C12.6109 3.55403 12.7257 3.67658 12.81 3.77615C12.8636 3.89871 12.9479 4.0136 13.0398 4.10552C13.147 4.15147 13.2313 4.22041 13.3079 4.30466C13.3538 4.31998 13.3998 4.3353 13.4228 4.38126C13.507 4.46552 13.6219 4.48849 13.7138 4.55743C13.7904 4.58807 13.867 4.58041 13.9436 4.62637C13.9206 4.64169 13.8364 4.91743 13.7981 5.04764Z",fill:"black"}))}}),yC=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck",{partnerIcons:{GMoney:Vs}}),xC=(e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===gC.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===gC.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===gC.ACCOUNTANT_REVIEW_REQUIRED||l===gC.RECONCILIATION_AWAITING),a=((e,t)=>"ACCOUNTANT"===t&&e===gC.USER_REVIEW_REQUIRED)(e,t),o=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);var l;let s,c,d;return r?(s="Pending Review",c=bC,d="neutral"):a?(s="Pending User Review",c=bC,d="neutral"):n?(s="Needs Review",c=fC,d="warning"):o?(s="Discrepancy",c=Jd,d="critical"):i?(s="Reconciled",c=yC,d="success"):(s="Processing",c=bC,d="neutral"),{text:s,variant:d,Icon:c}},kC=jt(Bt["review-status-selector-button"]),TC=jt(Bt["review-status-dropdown-arrow"],Rt({display:"none"}));function wC({status:e,transactionId:t}){const[n,r]=f(!1),{mutate:a}=nC(),o=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=C(Eo),{text:s,variant:c,Icon:d}=xC(e,l);return t&&((u=t).startsWith(Vi.TRANSACTION_LINE_ITEM)||u.startsWith(Vi.PROCESSOR_TRANSACTION))?null:N(Bl,{open:n,blockInteraction:!1,onOpenChange:o,enableClickMiddleware:!1,placement:"bottom-start",children:[I(Vl,{children:e=>N(Hv,{variant:c,...e,stylists:[kC],onClick:i,children:[I(Yc,{Component:d}),I(kl,{children:s}),I("div",{...TC,children:I(Lo,{Component:fu})})]})}),I(pC,{onClick:e=>{a({id:t,reviewStatus:e}),o()}})]});var u}function EC({status:e,transactionId:t}){return I(wC,{status:e,transactionId:t},t)}function AC(){return I(Yc,{Component:No})}function IC(){return I(AC,{})}const SC=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),NC=jt(null,Rt({stroke:"icon.base.weak"}));function PC({hasConversation:e,hasUnread:t=!1}){return I(S,{children:e?I(nc,{hasUnread:t}):I("div",{"data-testid":"no-conversations-dash",children:I(Hl,{Component:SC,stylists:[NC]})})})}function RC({conversationId:e}){const{query:{data:t}}=ci(e??null),{startPrefetch:n,cancelPrefetch:r}=ui(),{startPrefetch:a,cancelPrefetch:o}=_i(),i=Nn(t),l=i&&"READ"===t?.readStatus,s=y(()=>{Nn(e)&&(n({id:e}),a({id:e}))},[e,n,a]),c=y(()=>{Nn(e)&&(r(),o())},[e,r,o]);return I("div",{onMouseEnter:s,onMouseLeave:c,children:I(PC,{hasConversation:i,hasUnread:!l})})}const MC=jt(Bt["badge-chip"],Iv),DC=jt(null,na),LC=jt(null,Ro),OC=jt(Bt["neutral-badge"],Nv),FC=jt(Bt["highlight-badge"],Rv),BC=jt(Bt["success-badge"],Dv),UC=jt(Bt["warning-badge"],Ov),VC=jt(Bt["critical-badge"],Bv);function WC({type:e,children:t}){let n;switch(e){case"critical":n=VC;break;case"warning":n=UC;break;case"neutral":n=OC;break;case"success":n=BC;break;case"highlight":n=FC}const r=Zt([MC,DC,n,LC]);return I("div",{...r,children:t})}function HC({reviewStatus:e}){const{userRole:t}=C(Eo),{variant:n,Icon:r}=xC(e,t);return I(WC,{type:n,children:I(Yc,{Component:r})})}const qC=Rt({padding:"12px 16px",display:"flex",gap:"6px",flexDirection:"row",maxWidth:"100%"}),jC=Rt({display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,gap:"8px"}),zC=Rt({display:"flex",gap:"8px",justifyContent:"flex-start",alignItems:"center",minWidth:0}),KC=Rt({display:"flex",alignItems:"center",gap:"12px",minWidth:0}),YC=Rt({display:"flex",gap:"8px",flexDirection:"column",minWidth:0}),_C=Rt({width:24,minWidth:24,height:24,minHeight:24,borderRadius:"9999px"});function ZC({row:e}){const t=e.original;return N("div",{className:qC,children:[N("div",{className:YC,children:[N("div",{className:zC,children:[t.iconUrl?I("img",{src:t.iconUrl,className:_C,alt:void 0,width:24,height:24}):I("span",{className:_C}),I(ba,{children:t.description})]}),N("div",{className:KC,children:[I(HC,{reviewStatus:t.reviewStatus}),I(ya,{children:t.bankAccount?.name})]})]}),N("div",{className:jC,children:[I(yv,{row:e}),I(Lo,{Component:No})]})]})}const GC=Z(),QC=[GC.display({id:Ye.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?I($m,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),GC.accessor("date",{id:Ye.DATE,cell:e=>{const t=void 0!==e.row.getParentRow();return I(yl,{children:I(cv,{transaction:e.row.original,isChild:t})})},header:()=>I(is,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Vm,sortDescDisplay:Wm}),size:130,maxSize:144}),GC.accessor("description",{id:Ye.DESCRIPTION,cell:e=>{const t=void 0!==e.row.getParentRow();return I(yl,{children:I(gv,{bankTransaction:e.row.original,isChild:t})})},header:()=>I(is,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Hm,sortDescDisplay:qm}),size:180}),GC.accessor("amount",{id:Ye.AMOUNT,cell:e=>I(yl,{alignVariant:"flexEnd",children:I(yv,{row:e.row})}),header:()=>I(is,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:jm,sortDescDisplay:zm,align:"right"}),size:130,maxSize:180}),GC.accessor("category.id",{id:Ye.CATEGORY,cell:({row:e})=>I(cC,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>I(is,{columnName:"Category",padding:"none"}),size:130,meta:{clickable:!0}}),GC.accessor(e=>e.classSegments[0]?.id,{id:Ye.CLASS_SEGMENT,cell:e=>I(yl,{children:I(dC,{name:e.row.original.classSegments[0]?.name})}),header:()=>I(is,{columnName:"Business"}),size:130}),GC.accessor("reviewStatus",{id:Ye.REVIEW_STATUS,cell:e=>I(yl,{children:I(EC,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>I(is,{columnName:"Status",sortDef:"REVIEW_STATUS",sortAscDisplay:Km,sortDescDisplay:Ym,padding:"large"}),size:200,maxSize:230,meta:{clickable:!0}}),GC.display({id:Ye.COMMENTS,cell:e=>{const t=e.row.original;return I(yl,{alignVariant:"center",children:I(RC,{conversationId:t.conversation?.id})})},header:()=>I(is,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),GC.display({id:Ye.EXPAND,cell:()=>I("div",{className:Rt({paddingLeft:"25px"}),children:I(IC,{})}),size:40,maxSize:60})],XC=GC.display({id:"MOBILE",cell:e=>I(ZC,{row:e.row})}),JC=v({dimensions:{width:null,height:null}});function $C(){const{dimensions:e}=C(JC);return Nn(e.width)&&e.width<parseInt(wa("sizes.breakpoint-xl"))}const eb=[];function tb({transactions:e,columns:t}){const n=$C(),r=n?["MOBILE"]:t,a=n?{MOBILE:!0}:function(e){if(e)return Object.values(Ye).reduce((t,n)=>(t[n]=e.includes(n),t),{})}(t),o=n?[XC]:(i=t)?QC.filter(e=>i.includes(e.id)):QC;var i;return G({data:e??eb,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??eb.length,columns:o,getCoreRowModel:Q(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,iconUrl:t.iconUrl??"",reconciliationMatch:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],suggestedCategories:[],conversation:null};var t}),getExpandedRowModel:X(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:r,columnVisibility:a}})}const nb=[Ye.COMMENTS,Ye.DATE,Ye.DESCRIPTION,Ye.AMOUNT,Ye.CATEGORY,Ye.REVIEW_STATUS];function rb(e,t){return Ei("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function ab(e){const t=e.row,n=e.column.columnDef.meta?.clickable,r=t.getCanExpand(),a="BANK_TRANSFER"===t.original.type,o="category"===e.column.id&&(r||a),i="comments"===e.column.id,l="amount"===e.column.id;if(i){const e=t.getParentRow();rb(e?.original.id??t.original.id,"conversation")}else if(l&&r)t.toggleExpanded();else if(!n||o){const e=t.getParentRow();rb(e?.original.id??t.original.id)}}function ob({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Ui(),a=y(()=>n({id:e.original.id}),[n,e.original]);return I(wi,{rowData:e,onMouseEnter:a,onMouseLeave:r,onCellClick:ab,shouldDisplayDivider:n=>{return r=n,a=t,o=e.getVisibleCells().length,!(0===r||a&&1===r||r===o-1||a||1===r);var r,a,o}})}function ib(){return N(S,{children:[I(Ls,{Component:yC}),I(ba,{wrap:"wrap",children:"All caught up"}),I(ya,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const lb=jt(Bt["button-warning"],Rt({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{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"}}));function sb({children:e,stylists:t=[],...n}){return I(dl,{stylists:[lb,...t],...n,children:e})}function cb(){const{linkPlaid:e,loading:t}=lm();return I(sb,{onClick:()=>e({plaidEvent:Kg,message:"Plaid Link button pressed"}),disabled:t,children:I(ba,{children:"Link your bank"})})}const db=jt(null,Rt({whiteSpace:"wrap"}));function ub(){return N(S,{children:[I(Ls,{Component:Dp}),I(ba,{textAlign:"center",stylists:[db],children:"Your bank transactions will be categorized for you"}),I(ya,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),I(cb,{})]})}const hb=Rt({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function pb(){return N(S,{children:[I("div",{className:hb,children:I(Yc,{Component:bC})}),I(ba,{children:"Transactions are being processed"}),I(ya,{children:"Any transactions that require review will show up here."})]})}function gb(){const{dimensions:e}=C(JC);return Nn(e.width)&&e.width<parseInt(wa("sizes.breakpoint-xl"))}const mb=Rt({xl:{minWidth:"900px"}});function vb({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:a,transactions:o}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return tb({transactions:e,columns:t?[...t,Ye.EXPAND]:void 0})}({transactions:e,columns:nb})}({transactions:o}),{query:{data:l},isFilling:s}=Oi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=gb(),d=!Sn(l?.data?.[0])&&!s,u=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=I(ib,{})):r=I(pb,{}):r=I(ub,{}),r}(e??!1,o.length>0,d);return N("div",{className:mb,children:[I("div",{id:ho}),N(Do.Provider,{value:a,children:[N(Kt,{children:[I(Xt,{children:c?"Transactions":"Transactions For Your Review"}),I(js,{children:I(Vo,{})})]}),I(vl,{dashboard:"businessOwnerDashboard",children:r?I(Ko,{}):N(S,{children:[I(Cl.Provider,{value:{sortInstance:t,setSortInstance:n},children:I(mi,{headerGroups:i.getHeaderGroups()})}),Sn(u)?I(Ci,{children:i.getRowModel().rows.map(e=>I(ob,{rowData:e,hasSelect:!1},e.id))}):I(Ds,{children:u})]})})]})]})}function Cb(){const{sortInstance:e,setSortInstance:t,apiSort:n}=_m(),{query:{data:r},isFilling:a,paginationControls:o}=Oi({filter:go,sort:n,limit:10}),i=r?.data??vo,{hasPlaidLinkedBankAccount:l,isFilling:s}=Mh();return I(vb,{sortInstance:e,setSortInstance:t,isFilling:a||s,paginationControls:o,transactions:i,hasLinkedAccount:l??!1})}const bb=jt(Bt["button-action"],Rt({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{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"}}));function fb({children:e,stylists:t=[],...n}){return I(dl,{stylists:[bb,...t],...n,children:e})}const yb=Io(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),p.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),xb=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:$s,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:fC,buttonText:"Review"};case"LINK_BANK":return{Icon:Dp,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:Dp,buttonText:"Fix"};case"RELINK":return{Icon:Dp,buttonText:"Relink"};case"CHAT":return{Icon:Jd,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:yb,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:yC,buttonText:""};default:return{Icon:Jd,buttonText:""}}},kb=jt(Bt["banner-title"],Rt({display:"flex",alignItems:"center",gap:"8px"})),Tb=jt(Bt["banner-icon"],Rt({width:"20px",height:"20px"}));function wb({title:e,type:t}){const{Icon:n}=xb(t);return N("div",{...kb,children:[I(Yc,{Component:n,stylists:[Tb]}),I(ba,{wrap:"wrap",children:e})]})}const Eb=jt(null,Rt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:{base:"4px",xl:"5px"},flex:{xl:"1 1 0"},minWidth:{xl:"200px"},width:"100%"}));function Ab({title:e,description:t,type:n}){return N("div",{...Eb,children:[I(wb,{title:e,type:n}),I(ya,{wrap:"wrap",children:t})]})}const Ib=jt(Bt["banner-button"],Rt({display:"flex",justifyContent:"center",alignItems:"center",width:{base:"100%",xl:"128px"},gap:{xl:"15px"},flexShrink:{xl:"0"}})),Sb=jt(Bt["banner-button-text"]),Nb=jt(Bt["banner-button-icon"]);function Pb({priority:e,type:t,handleClick:n}){const{buttonText:r}=xb(t),{Button:a}=(e=>{switch(e){case"URGENT":return{Button:ad};case"HIGH":return{Button:sb};case"MEDIUM":return{Button:fb};default:return{Button:dl}}})(e);return N(a,{onClick:n,stylists:[Ib],children:[I(ba,{stylists:[Sb],children:r}),I(Lo,{stylists:[Nb],Component:No})]})}const Rb=Ot({base:{display:"flex",flexDirection:{base:"column",xl:"row"},padding:{base:"16px",xl:"15px"},gap:{base:"16px",xl:"0"},justifyContent:{xl:"space-between"},alignItems:{base:"flex-start",xl:"center"},alignSelf:"stretch",width:{base:"100%",xl:"auto"},minWidth:{xl:"350px"},borderRadius:{base:"sm",xl:"lg"},border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Mb={HIGH:Bt["banner-high"],MEDIUM:Bt["banner-medium"],LOW:Bt["banner-low"],URGENT:Bt["banner-urgent"]};function Db({task:e,handleClick:t}){const{name:n,description:r,shortDescription:a,type:o,priority:i}=e,l=gb()?a:r,s=jt(Bt.banner,Mb[i],Rb({priority:i}));return N("div",{...s,children:[I(Ab,{title:n,description:l,type:o}),I(Pb,{priority:i,type:o,handleClick:t})]})}function Lb(e,t){xd({message:{text:`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`,attachments:[]}})}function Ob(e,t,n,r,a){return()=>Cd({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:a})}function Fb(e,t,n,r,a,o){return{alert:Ob(e,t,a,o,[{key:ld,label:"Cancel"},{key:yc.CHAT,label:"Chat",type:md}]),actions:{[yc.CHAT]:()=>Lb(t,r)}}}function Bb(e){const{mutateAsync:t}=am(),n=Ln(),r=Vn(),{apiPartnerName:a}=C(Eo),o=gb(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=lm(),{linkPlaid:c,loading:d}=lm();if(Sn(e))return Fb(Tc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=Tc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case yc.DELETE_OR_RELINK:case yc.RELINK:return l?null:(g=i,m=a,v=o,{alert:Ob(u,(p=e).apiInstitutionName,m,v,[{key:ld,label:"Cancel"},{key:cd,label:"Relink",type:md}]),actions:{success:()=>{g({plaidEvent:Yg,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case yc.UNLINK_RELINK:return d?null:function(e,t,n,r,a,o,i){return{alert:Ob(e,t.apiInstitutionName,a,o,[{key:ld,label:"Cancel"},{key:yc.CHAT,label:"Chat"},{key:cd,label:"Unlink and Relink",type:md}]),actions:{success:async()=>{i||await n({id:String(t.id)}),r({plaidEvent:"PLAID_LINK_UNLINK_RELINK",plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink and Relink Bank Error button pressed"})},[yc.CHAT]:()=>Lb(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,a,o,s);case yc.OPEN_BANK:return l?null:function(e,t,n,r,a,o,i,l){return{alert:Ob(e,t.apiInstitutionName,i,l,[{key:ld,label:"Cancel"},{key:yc.CHAT,label:"Chat"},{key:yc.RELINK,label:"Relink"},{key:cd,label:"Go To Bank",type:md}]),actions:{success:async()=>{const e=await nd({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:a}),o=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(o,"_blank")},[yc.RELINK]:()=>{o({plaidEvent:Yg,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[yc.CHAT]:()=>Lb(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,a,o);case yc.UNLINK_ONLY:return function(e,t,n,r,a,o,i){return{alert:Ob(e,t.apiInstitutionName,a,o,[{key:ld,label:"Cancel"},{key:cd,label:"Unlink",type:md}]),actions:{success:()=>{i?r({plaidEvent:_g,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink Bank Error button pressed"}):n({id:String(t.id)})}}}}(u,e,t,c,a,o,s);default:return Fb(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,a,o)}var p,g,m,v}const Ub=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){wr({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function Vb({task:e}){const{linkPlaid:t,loading:n}=lm(),{linkPlaid:r,loading:a}=sm(),o=Bb(e?.meta?.plaidItem),i=n&&"RELINK"===e.type,l=a&&"LINK_BANK"===e.type&&!1,s="RELINK"!==e.type&&"LINK_BANK"!==e.type&&Sn(o);return i||l||s?null:I(Db,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:Yg,plaidItemId:e?.meta?.plaidItem?.id,apiAccessToken:e?.meta?.plaidItem?.apiAccessToken,apiErrorCode:e?.meta?.plaidItem?.apiErrorCode,message:"Fix Relink Bank Error button pressed"}):"LINK_BANK"===e.type?(Tr("Plaid Banner Link Bank clicked",{plaidItem:e?.meta?.plaidItem}),r({plaidEvent:Kg,message:"Plaid Banner Link Bank pressed"})):Nn(o)&&(Tr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),Ub(o))}})}const Wb=jt(Bt.banner,Bt["banner-default"],Rb({priority:"DEFAULT"}));function Hb(){const e=gb()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return I("div",{...Wb,children:I(Ab,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const qb=jt(Bt.banner,Bt["banner-default"],Rb({priority:"DEFAULT"}));function jb(){const e=gb()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return I("div",{...qb,children:I(Ab,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const zb=Rt({width:"100%",height:72,minWidth:"300px"});function Kb(){return N(S,{children:[I(Ya,{styles:zb}),I(Ya,{styles:zb}),I(Ya,{styles:zb})]})}function Yb({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const a=e.length>0;return r?I(Kb,{}):a?e.map(e=>{if(void 0===fo[e.type]||"ONBOARDING_FORM"===e.type&&Sn(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(yc).includes(e.type))return I(Vb,{task:e},e.id);const n=e.actionLink,r=Nn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return I(Db,{task:e,handleClick:r},e.id)}):I(n?jb:Hb,{})}const _b=jt(Bt["button-table-header"]),Zb=Rt({height:{xl:"auto",base:"44px"}});function Gb(){const e=Ad({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return I("div",{className:Zb,children:N(hl,{onClick:()=>{Ei(e?"BanksAndIntegrations":"NewConnection")},width:"fill-parent",stylists:[_b],children:[I(Lo,{Component:Kc}),I(Pl,{children:"Banks & Integrations"})]})})}function Qb(){return ed({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})})}function Xb(){return $c({filter:{status:{equal:"ACTIVE"}}},{select:e=>({multiAccountIntegrations:e.data?.filter(e=>["PLAID","UNIT"].includes(e.apiName))||[],integrations:e.data?.filter(e=>!["PLAID","UNIT"].includes(e.apiName))||[],cursor:e.cursor})})}const Jb=jt(Bt["business-owner-dashboard"],Rt({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),$b=Rt({display:"flex",width:"100%",justifyContent:"center"}),ef=e=>{const t=po[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},tf={status:{in:["ACTIVE","INACTIVE"]}},nf={filter:{status:{in:["ACTIVE"]}}};function rf({period:e,onChangePeriod:t}){const{sortInstance:n,setSortInstance:r,apiSort:a}=function(){const[e,t]=f(void 0);return{sortInstance:e,setSortInstance:y(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in ni)??!1,n=(e.direction&&e.direction in ri)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:o},isFilling:i,paginationControls:l}=li({limit:10,sort:a,filter:mo}),s=o?.data??Co,c=gb(),{query:{data:d},isFilling:u}=To({select:e=>wo(e,c)},nf),{query:{data:h}}=Dh(),{query:{data:p}}=Qb(),g=gb(),v=m(()=>{let e=[];const t=p?.data;t&&(e=t.map(e=>Ec(e)));let n=[];!1===h?.hasPlaidLinkedBankAccount&&(n=[wc]);const r=d??[];return[...e,...n,...r]},[d,h,p]),C=function(){const{query:{data:e}}=Oi({filter:tf,limit:1});return(e?.data?.length??0)>0}(),b=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(C,h),x=/* @__PURE__ */new Date,k={month:x.getMonth(),year:x.getFullYear()};const[T,w]=Ol(k,e,t),E=(A=T.month,{beginDate:$t((P=T.year)-1,A+1,1),endDate:$t(P,A+1,0)});var A,P;return I("div",{className:$b,children:N("div",{...Jb,children:[N(Kt,{children:[I(Xt,{children:"Action Items"}),I(Gb,{})]}),I(co,{children:I(Yb,{taskBanners:v,handleScrollAction:ef,isWaitingForPlaidItemAccountsSync:!C&&!0===h?.plaidItemAccountsReadyToSync,isFilling:u})}),!g&&N(S,{children:[I(Um,{period:T,handleDateChange:e=>{var t,n;(t=k).year===(n=e).year&&n.month>t.month||n.year>t.year||w(e)},todayPeriod:k,showSamples:b,showLinkAccountButton:b&&!h?.plaidItemAccountsReadyToSync}),I(Kt,{children:I(Xt,{children:"Financial Summary"})}),I(fc,{isSample:b,period:T}),I(lo,{filter:E,isSample:b})]}),I(Ys,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:g}),I(Cb,{})]})})}function af(e){return I(Ar||S,{children:e.children})}function of({children:e}){return I(af,{children:I("div",{className:Vt(Bt.component),children:e})})}function lf(e){return I(of,{children:I(rf,{...e})})}function sf(e,t){return e?{...e,...t}:t}function cf(e){return Oe({key:"category",name:"Category",possibleValues:e})}const df=async e=>{const t=e.queryKey;return async function(e,t){const n={path:"/sdk/introspect",accessToken:e,environment:t};return await $o(n)}(t[1].accessToken,t[1].environment)};function uf(){return Wn({queryKey:["sdk/introspect"],queryFn:df})}const hf=[{value:"in",label:"In"}];function pf(e){return Oe({key:"reviewStatus",name:"Review Status",possibleValues:e,operators:hf})}const gf=({displayInput:e,parsedInput:t,operator:n,model:r,handleFilterClick:a})=>{if(void 0===r.operators)return;const{label:o,value:i}=n;a(r.createFilter({name:`${o} ${e}`,value:{[r.key]:{name:"",value:{[i]:t}}}}))},mf=h.object({amount:h.number({message:"Required"}),amountOperator:h.object({value:h.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:h.enum(["Equals","Does not equal","Greater than","Less than","Greater than or equal to","Less than or equal to"])})}),vf=jt(null,Rt({display:"flex",flexDirection:"column",gap:"15px",marginInline:"40px",marginTop:"35px"})),Cf=jt(null,Rt({display:"flex",flexDirection:"row",gap:"16px",justifyContent:"right",marginBottom:"20px"}));function bf({children:e,title:t,onCancelClick:n,onSubmit:r}){return N("form",{onSubmit:e=>{e.preventDefault(),r()},...vf,children:[I(ba,{children:t}),e,N("div",{...Cf,children:[I(Eg,{showIcon:!1,onClick:n}),I(Xd,{showIcon:!1,textContent:"Apply"})]})]})}function ff({model:e,handleFilterClick:t}){const n=Ul(),r=function({model:e,handleFilterClick:t}){return kg({defaultValues:(n=e?.operators?.[0],{amount:null,amountOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:mf},onSubmit:n=>{if(null===n.value.amount)return;const r={displayInput:ga(n.value.amount,{cents:"always",dollarSign:!0,signage:"default"}),parsedInput:th(n.value.amount),operator:n.value.amountOperator,model:e,handleFilterClick:t};gf(r)}});var n}({model:e,handleFilterClick:t});return N(bf,{title:"Amount...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"amountOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),I(r.AppField,{name:"amount",children:e=>I(e.EditableAmountField,{label:"Total",autofocus:!0})})]})}const yf=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"greaterThan",label:"Greater than"},{value:"greaterThanEqual",label:"Greater than or equal to"},{value:"lessThan",label:"Less than"},{value:"lessThanEqual",label:"Less than or equal to"}],xf=h.object({date:h.string().refine(e=>""!==e,{message:"Required"}),dateOperator:h.object({value:h.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:h.enum(["On","Not on","After","Before","On or after","On or before"])})});function kf({model:e,handleFilterClick:t}){const n=Ul(),r=function({model:e,handleFilterClick:t}){return kg({defaultValues:(n=e?.operators?.[0],{date:"",dateOperator:n||{value:"equal",label:"On"}}),validators:{onSubmit:xf},onSubmit:n=>{const r={displayInput:mn(bn(n.value.date)),parsedInput:n.value.date,operator:n.value.dateOperator,model:e,handleFilterClick:t};gf(r)}});var n}({model:e,handleFilterClick:t});return N(bf,{title:"Date...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"dateOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),I(r.AppField,{name:"date",children:e=>I(e.DateInput,{label:"Date",autofocus:!0,editable:!0})})]})}const Tf=[{value:"equal",label:"On"},{value:"notEqual",label:"Not on"},{value:"greaterThan",label:"After"},{value:"greaterThanEqual",label:"On or after"},{value:"lessThan",label:"Before"},{value:"lessThanEqual",label:"On or before"}],wf=h.object({description:h.string().refine(e=>""!==e,{message:"Required"}),descriptionOperator:h.object({value:h.enum(["equal","notEqual","contain"]),label:h.enum(["Equals","Does not equal","Contains"])})});function Ef({model:e,handleFilterClick:t}){const n=Ul(),r=function({model:e,handleFilterClick:t}){return kg({defaultValues:(n=e?.operators?.[0],{description:"",descriptionOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:wf},onSubmit:n=>{const r={displayInput:`"${n.value.description}"`,parsedInput:n.value.description,operator:n.value.descriptionOperator,model:e,handleFilterClick:t};gf(r)}});var n}({model:e,handleFilterClick:t});return N(bf,{title:"Description...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"descriptionOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),I(r.AppField,{name:"description",children:e=>I(e.TextAreaInput,{label:"Description",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Af=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function If(e){return Oe({key:"bankAccount",name:"Bank Account",possibleValues:e})}const Sf=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await $o(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Hi({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:a}};function Nf(e){return Oe({key:"customer",name:"Customer",possibleValues:e})}function Pf(e){return Oe({key:"vendor",name:"Vendor",possibleValues:e})}const Rf={EXPENSE:"EXPENSE",REVENUE:"REVENUE",BANK_TRANSFER:"BANK_TRANSFER",TAX_PAYMENT:"TAX_PAYMENT",INVOICE_PAYMENT:"INVOICE_PAYMENT",PAYOUT:"PAYOUT",PAYROLL_PAYMENT:"PAYROLL_PAYMENT",BILL_PAYMENT:"BILL_PAYMENT",LOAN_PAYMENT:"LOAN_PAYMENT"},Mf=[{name:"Expense",value:Rf.EXPENSE},{name:"Income",value:Rf.REVENUE},{name:"Bank Transfer",value:Rf.BANK_TRANSFER},{name:"Tax Payment",value:Rf.TAX_PAYMENT},{name:"Invoice Payment",value:Rf.INVOICE_PAYMENT},{name:"Payout",value:Rf.PAYOUT},{name:"Payroll Payment",value:Rf.PAYROLL_PAYMENT},{name:"Bill Payment",value:Rf.BILL_PAYMENT},{name:"Loan Payment",value:Rf.LOAN_PAYMENT}];function Df(){return{values:[...Mf].map(e=>function(e){const t="in";return{name:e.name,value:{type:{name:e.name,value:{[t]:[e.value]}}}}}(e))}}const Lf={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},Of=[{name:"Active",value:Lf.ACTIVE},{name:"Inactive",value:Lf.INACTIVE},{name:"Removed",value:Lf.REMOVED}],Ff=e=>e.map(e=>({id:e.id,status:Lf.INACTIVE}));function Bf(){const e="in";return{values:[...Of].map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[t.value]}}}}))}}const Uf=h.object({notes:h.string().refine(e=>""!==e,{message:"Required"}),notesOperator:h.object({value:h.enum(["equal","notEqual","contain"]),label:h.enum(["Equals","Does not equal","Contains"])})});function Vf({model:e,handleFilterClick:t}){const n=Ul(),r=function({model:e,handleFilterClick:t}){return kg({defaultValues:(n=e?.operators?.[0],{notes:"",notesOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Uf},onSubmit:n=>{const r={displayInput:`"${n.value.notes}"`,parsedInput:n.value.notes,operator:n.value.notesOperator,model:e,handleFilterClick:t};gf(r)}});var n}({model:e,handleFilterClick:t});return N(bf,{title:"Notes...",onCancelClick:()=>n.close(),onSubmit:r.handleSubmit,children:[I(r.AppField,{name:"notesOperator",children:t=>I(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),I(r.AppField,{name:"notes",children:e=>I(e.TextAreaInput,{label:"Note",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Wf=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],Hf=(qf={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,reconciliationMatch:!0,invoice:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(qf));var qf;function jf(e){return Oe({key:"glAccount",name:"GL Account",possibleValues:e})}function zf(){const{filters:e,addFilters:t,removeFilter:n,userTransactionDashFiltersActive:r}={filters:ze(e=>e.transactionsDashFilters),addFilters:ze(e=>e.addTransactionsDashFilters),removeFilter:ze(e=>e.removeTransactionsDashFilter),userTransactionDashFiltersActive:ze(e=>e.userTransactionDashFiltersActive)},{getCategories:a,getBankAccounts:o,getVendors:i,getCustomers:l,getGlAccounts:c,getReviewStatuses:d}=function(){const e=function(){const{query:{data:e},isFilling:t}=Vh(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Uncategorized";var n;return{name:t,value:{category:{name:t,value:{id:{in:[(n=e).id?n.id.toString():""]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),t=function(){const{query:{data:e},isFilling:t}=Ad(),n=e?.data,r=m(()=>n?.map(e=>{const t=e?.name,n=e?.mask,r=yd(t,n);return{name:r,value:{bankAccount:{name:r,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),n=function(){const{query:{data:e},isFilling:t}=mg(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Customer";return{name:t,value:{customer:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),r=function(){const{query:{data:e},isFilling:t}=rg(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Vendor";return{name:t,value:{vendor:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[t,r])}(),a=function(){const{query:{data:e},isFilling:t}=Wn({queryKey:["clientMgmt/businesses","classSegments"],queryFn:Sf}),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Class Segment";return{name:t,value:{classSegments:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return y(()=>({values:r??[],isFilling:t}),[r,t])}(),o=function(){const{query:{data:e},isFilling:t}=mp(),n=m(()=>e?.map(e=>{const t=e.name;return{name:t,value:{glAccount:{name:t,value:{id:{in:[e.id]}}}}}}),[e]);return y(()=>({values:n??[],isFilling:t}),[n,t])}(),i=function(){const e=function(){const{query:{data:e}}=uf();return"ACCOUNTANT"===e?.userRole}(),t=m(()=>function(e){const t="in";return[...e].map(e=>({name:e.name,value:{reviewStatus:{name:e.name,value:{[t]:e.value}}}}))}(e?vC:mC),[e]);return y(()=>({values:t,isFilling:!1}),[t])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:a,getGlAccounts:o,getReviewStatuses:i}}(),u=m(()=>({reviewStatus:pf(d),amount:Oe({key:"amount",name:"Amount",operators:yf,ModalComponent:ff}),bankAccount:If(o),category:cf(a),customer:Nf(l),date:Oe({key:"date",name:"Date",operators:Tf,ModalComponent:kf}),description:Oe({key:"description",name:"Description",operators:Af,ModalComponent:Ef}),glAccount:jf(c),notes:Oe({key:"notes",name:"Notes",operators:Wf,ModalComponent:Vf}),status:Oe({key:"status",name:"Status",possibleValues:Bf}),vendor:Pf(i),type:Oe({key:"type",name:"Type",possibleValues:Df}),search:Be}),[o,a,i,l,c,d]),h=m(()=>[u.reviewStatus,u.amount,u.bankAccount,u.category,u.customer,u.date,u.description,u.glAccount,u.notes,u.status,u.type,u.vendor],[u.reviewStatus,u.amount,u.bankAccount,u.category,u.customer,u.date,u.description,u.glAccount,u.notes,u.status,u.type,u.vendor]),p=m(()=>function(e){const t={...e};return Hf.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(e.reduce(Kf,{})),[e]),g=y(e=>u[e],[u]);return{filters:e,filterPopupModels:h,addFilters:t,removeFilter:n,apiFilters:p,getModel:g,userTransactionDashFiltersActive:r}}function Kf(e,t){const n={},r=t.value;var a,o,i,l;return r.date&&(n.date=(a=e.date,o=r.date.value,a?{...a,...o}:o)),r.amount&&(n.amount=(i=e.amount,l=r.amount.value,i?{...i,...l}:l)),r.description&&(n.description=r.description.value),r.category&&(n.category=function(e,t){return sf(e,t)}(e.category,r.category.value)),r.reviewStatus&&(n.reviewStatus=function(e,t){return e&&e.in?t.in?{...e,in:[.../* @__PURE__ */new Set([...e.in,...t.in])]}:e:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return sf(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return sf(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return sf(e,t)}(e.glAccount,r.glAccount.value)),r.type&&(n.type=function(e,t){return e?{...e,...t}:t}(e.type,r.type.value)),r.search&&(n.search=r.search.value),r.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return sf(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return sf(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}function Yf(e,t=500,n){const r=g();!function(e){const t=g(e);t.current=e,x(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const a=m(()=>{const a=c(e,t,n),o=(...e)=>a(...e);return o.cancel=()=>{a.cancel()},o.isPending=()=>!!r.current,o.flush=()=>a.flush(),o},[e,t,n]);return x(()=>{r.current=c(e,t,n)},[e,t,n]),a}const _f=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),Zf=Rt({animation:"linear 1s spin infinite"}),Gf={background:"conic-gradient(from 90deg,rgba(255, 255, 255, 0) 0deg,rgba(148, 216, 232, 1) 360deg)",height:"100%",width:"100%",opacity:1};function Qf({size:e}){const t=e??15;return N("svg",{className:Zf,width:t,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[I("g",{clipPath:"url(#paint0_angular_27751_8190_clip_path)","data-figma-skip-parse":"true",children:I("g",{transform:"matrix(0 0.0075 -0.0075 0 8.5 8.5)",children:I("foreignObject",{x:"-1266.67",y:"-1266.67",width:"2533.33",height:"2533.33",children:I("div",{style:Gf})})})}),I("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"stopsVar":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"transform":{"m00":-9.1848822316819949e-16,"m01":-14.999998092651367,"m02":15.999998092651367,"m10":14.999998092651367,"m11":-9.1848822316819949e-16,"m12":1.0},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),I("defs",{children:I("clipPath",{id:"paint0_angular_27751_8190_clip_path",children:I("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z"})})})]})}const Xf=jt(Bt["filter-bar"],Rt({display:"flex",padding:"16px",flexDirection:"column",alignItems:"flexStart",gap:"8px",flex:"1 0 0",borderRadius:"2px",border:"1px solid {colors.border.layout}",background:"surface.foreground",minWidth:0,xl:{display:"flex",flex:"1 0 0",flexDirection:"column",height:"35px",padding:"0 10px",justifyContent:"center",alignItems:"flex-start",gap:"10px",borderRadius:"sm",background:"surface.background"}})),Jf=jt(Bt["filter-search-bar"],Rt({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),$f=jt(null,Rt({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),ey=jt(null,Rt({border:"none",outline:"none",background:"transparent",fontSize:"16px",fontStyle:"normal",fontWeight:"sm",lineHeight:"18px",letterSpacing:"0.96px",display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",height:"100%",minWidth:0,padding:0,_placeholder:{color:"typography.base.weak"},xl:{fontSize:"14px",lineHeight:"16px"}}));function ty({onChange:e,searchTerm:t,isFetching:n}){const[r,a]=f(t),[o,i]=f(!1),l=Yf(y(t=>{e(t),i(!1)},[e,i]),280),s=Rt({width:25});return I("div",{...Xf,children:N("div",{...Jf,children:[I("div",{className:s,children:n||o?I(Qf,{}):I(Yc,{stylists:[$f],Component:_f})}),I("input",{...ey,value:r,onChange:e=>{return t=e.target.value,a(t),o||i(!0),void l(t);var t},placeholder:"Search",onKeyDown:cu})]})})}const ny=Rt({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),ry=jt(Bt["filter-pill"],Rt({display:"inline-flex",height:"25px",padding:"5px 10px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"md",border:"{borderWidths.lg} solid",borderColor:"border.intent.secondary",background:"surface.intent.secondary",fontSize:"sm",fontWeight:"sm",lineHeight:"14px",color:"typography.intent.secondary"})),ay=jt(null,Rt({border:"none",background:"none",padding:0,cursor:"pointer"})),oy=jt(null,Rt({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function iy({text:e,onClickRemove:t}){return N("div",{...ry,children:[I("div",{...oy,children:e}),I("button",{...ay,onClick:t,children:I(Hl,{Component:Wl,stylists:[jt(null,ny)]})})]})}function ly({filters:e,removeFilter:t}){return e.map((e,n)=>{if(e.modelKey===Fe)return;const r=`${e.name}`;return I(iy,{text:r,onClickRemove:()=>{t(n)}},e.id)})}const sy=Io(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_24404_41655)"},p.createElement("path",{d:"M1 1V3.366L6.317 9.866V14L8.683 12.817V9.866L14 3.366V1H1Z",strokeWidth:1,strokeMiterlimit:10}))),"Filter");function cy({children:e,forceMount:t,fadeIn:n=!0}){const r={transform:"none",willChange:"auto",...n?{}:{animation:"none"}};return I(Gl,{style:r,forceMount:t,children:e})}const dy=Rt({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),uy=jt(null,dy);function hy({children:e,clickHandler:t}){const n=Ul();return t||(t=()=>{n.close()}),I(pe,{lockScroll:!0,...uy,onClick:t,children:e})}const py=Ot({base:{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative"},variants:{width:{lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"}},sm:{minWidth:{sm:"360px",base:"100dvw"},maxWidth:{sm:"392px",base:"100dvw"}}}}});function gy({width:e="lg",children:t}){const n=jt(Bt["modal-popup"],py({width:e}));return I("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}function my({model:e,handleFilterClick:t}){return N(Bl,{placement:"right-start",modal:!0,children:[I(Vl,{children:t=>I(bh,{...t,children:I(ba,{children:e.name})})}),I(cy,{children:I(hy,{children:I(gy,{children:e.ModalComponent&&I(e.ModalComponent,{model:e,handleFilterClick:t})})})})]})}function vy({filterModels:e,addFilters:t}){const n=Ul(),r=e=>{t([e]),n.close()};return I(Gl,{children:I(uh,{children:e.map(e=>{const t=e.possibleValues?e.possibleValues():null;return Sn(t)?I(my,{model:e,handleFilterClick:r},e.key):I(Cy,{model:e,handleFilterClick:r},e.key)})})})}function Cy({model:e,handleFilterClick:t}){if(void 0===e.possibleValues)return;const{values:n,isFilling:r}=e.possibleValues();return I(tp,{triggerChildren:I(ap,{icon:e.icon,displayLabel:e.name}),popupChildren:r?I(kh,{}):I(by,{values:n,handleValueClick:n=>{const r=e.createFilter(n);t(r)}})},e.key)}function by({values:e,handleValueClick:t}){return I(uh,{children:e.length>0?e.map(e=>I(fy,{handleClick:()=>t(e),value:e},e.name)):I(yh,{text:"No data"})})}function fy({value:e,handleClick:t}){return I(bh,{onClick:t,children:I(ba,{children:e.name})})}function yy({Component:e,stylists:t}){return I(e,{stylists:[jt(Bt["medium-icon"],Bt.icon),...t??[]],size:17})}const xy=Rt({display:"flex",padding:{base:"26px",xl:"18px"},gap:"8px",height:"35px"});function ky({addFilters:e,filterModels:t}){const n=gb();return N(Bl,{modal:!1,placement:"bottom-start",children:[I(Vl,{children:e=>I(hl,{popupTriggerProps:e,stylists:[jt(null,xy)],children:n?I(yy,{Component:sy}):N(S,{children:[I(Lo,{Component:sy}),I(kl,{children:"Filters"})]})})}),I(vy,{filterModels:t,addFilters:e})]})}const Ty=jt(Bt["dashboard-header"],Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),wy=jt(null,Rt({display:"flex",alignItems:"center",gap:"8px",padding:"15px 15px 0 15px",width:"100%",xl:{gap:"12px"}})),Ey=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%"}));function Ay({filterModels:e,filters:t,addFilters:n,removeFilter:r,getModel:a,isFetching:o}){const i=m(()=>Sn(t)?"":t.find(e=>e.modelKey===Fe)?.value.search?.value,[t]);return N("div",{...Ty,children:[N("div",{...wy,children:[I(ty,{isFetching:o,searchTerm:i,onChange:e=>{const t=a(Fe);if(void 0===t)return;const r=t.createFilter({name:"Search",value:{search:{name:e,value:e}}});n([r])}}),I(ky,{addFilters:n,filterModels:e}),I("div",{className:Rt({display:"none",xl:{display:"flex"}}),children:I(Vo,{})})]}),I("div",{...Ey,children:I(ly,{filters:t,getModel:a,removeFilter:r})})]})}const Iy=_e.filter(e=>e!==Ye.COMMENTS&&e!==Ye.CLASS_SEGMENT),Sy=jt(null,Rt({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function Ny(){return I("div",{...Sy,children:I(Vo,{})})}function Py({Component:e,stylists:t}){return I(e,{stylists:[jt(Bt["xx-large-icon"],Bt.icon),...t??[]],size:50})}function Ry(){return N(S,{children:[I(Py,{Component:_f}),I(Xt,{children:"No results found"}),I(ya,{wrap:"wrap",children:"Based on the filters that are applied, there are no results to display."})]})}const My=v({resetSelected:void 0});function Dy({Icon:e,label:t,children:n,onClick:r}){return n?N(Bl,{placement:"bottom-start",children:[I(Vl,{children:n=>N(ns,{popupTriggerProps:n,children:[e&&I(Yc,{Component:e}),I(Pl,{children:t})]})}),n]}):N(ns,{onClick:r,children:[e&&I(Yc,{Component:e}),I(Pl,{children:t})]})}const Ly=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2768)"},p.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:"currentColor"}),p.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:"currentColor"}),p.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:"currentColor"}))),"Dots"),Oy=Io(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),p.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}),p.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function Fy({transactions:e,id:t,label:n}){const{mutate:r}=tC(),a=Ul(),{resetSelected:o}=C(My);return CC(t)?I(bh,{onClick:()=>(t=>{if(e.length>0){const a=(n=t,e.map(e=>({id:e.id,reviewStatus:n})));r(a)}var n;a.close(),o&&o()})(t),children:n}):null}const By=[{id:"delete",label:"Delete",Icon:Oy,component:function({transactions:e,...t}){const{mutate:n}=tC(),r=()=>{const t=Ff(e);n(t)};return I(Dy,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&Cd({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:ld,label:"Cancel"},{key:sd,label:"Delete",type:vd}]}).then(e=>{e===sd&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:Io(e=>p.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.36217 8.45534H7.95444C8.20781 8.45534 8.45081 8.35469 8.62998 8.17552C8.80914 7.99636 8.9098 7.75336 8.9098 7.49998C8.9098 7.24661 8.80914 7.00361 8.62998 6.82444C8.45081 6.64528 8.20781 6.54463 7.95444 6.54463H7.31753C7.06416 6.54463 6.82116 6.44397 6.64199 6.26481C6.46283 6.08564 6.36217 5.84265 6.36217 5.58927C6.36217 5.33589 6.46283 5.09289 6.64199 4.91373C6.82116 4.73456 7.06416 4.63391 7.31753 4.63391H8.9098",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M7.63599 3.36011V4.63392",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M7.63599 8.45532V9.72913",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.54074 14.1875L4.23491 12.9137L5.93545 14.1875L7.62962 12.9137L9.33015 14.1875L11.0307 12.9137L12.7312 14.1875L13.3681 13.5506V0.8125H1.90384V13.5506L2.54074 14.1875Z",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"})),"Expenses"),filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=tC(),a=e.length;return a>0&&I(Dy,{label:`${t} ${bd("Expense","Expenses",a,!0)}`,...n,children:I(lp,{onClick:function(t){var n,a;t?.id&&r((n=e,a=t.id.toString(),n.map(e=>({id:e.id,categoryId:a}))))}})})}},{id:"review",label:"Change Review Status",Icon:yC,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:Fy},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:Fy},{id:"RECONCILED",label:"Reconciled",component:Fy}]},{id:"more",label:"More",Icon:Ly,subActions:[{id:"recategorize-revenue",component:function({transactions:e}){const t=Ul(),{mutate:n}=tC(),{resetSelected:r}=C(My),a="Recategorize "+bd("Revenue","Revenues",e.length,!0);return I(tp,{triggerChildren:I(ap,{displayLabel:a}),popupChildren:I(Xv,{onClick:function(a){var o,i;n((o=e,i=a.id,o.map(e=>({id:e.id,glAccountId:i})))),t.close(),r&&r()},types:xp})})},filter:e=>"REVENUE"===e.type}]}];function Uy({subActionList:e}){return I(uh,{children:e})}function Vy({subActions:e,transactions:t,label:n,Icon:r}){const a=m(()=>e.map(e=>{const{component:n,id:r,filter:a,label:o}=e,i=t.filter(e=>!a||a(e));return i.length>0?I(n,{id:r,transactions:i,label:o},r):null}).filter(e=>null!==e),[e,t]);return I(Dy,{label:n,Icon:r,children:I(Gl,{children:a.length>0?I(Uy,{subActionList:a}):I(bh,{children:I(kl,{children:"No Actions Available for Selection"})},"no-actions")})})}const Wy=jt(Bt["bulk-select"],Rt({display:"flex",gap:"15px",flexDirection:"row",alignItems:"center",height:"20px",justifyContent:"flex-start"}));function Hy({table:e}){const t=e.getSelectedRowModel(),n=m(()=>t.rows.map(e=>e.original),[t]),r=t.rows.length,a=r>0,o=m(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]);return N("div",{...Wy,children:[I($m,{checked:e.getIsAllRowsSelected(),onClick:e.getToggleAllRowsSelectedHandler()}),I(My.Provider,{value:o,children:a&&N(S,{children:[I(ba,{children:`${r} selected`}),By.map(e=>{const{component:t,subActions:r,id:a,filter:o,...i}=e,l=n.filter(e=>!o||o(e));return r?I(Vy,{subActions:r,transactions:n,...i},a):t&&I(t,{transactions:l,...i},a)})]})})]})}function qy({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const a=$C(),o=function({transactions:e,columns:t}){const n=$C(),r=tb({transactions:e,columns:t?[Ye.SELECT,...t,Ye.EXPAND]:void 0});return function(e,t,n=!0){const r=n&&!Sn(t.getColumn(Ke.SELECT)),a=g(r?e:null);if(r){if(a.current!==e&&void 0!==a.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}a.current=e}}(e,r,!n),r}({transactions:e,columns:t});let i;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?i=I(Ry,{}):r&&0===e?.length&&(i=I(pb,{})):i=I(ub,{}),N(vl,{dashboard:"transactionDashboard",children:[Sn(i)&&!a&&I(Hy,{table:o}),I(mi,{headerGroups:o.getHeaderGroups()}),Sn(i)?I(Ci,{children:o.getRowModel().rows.map(e=>I(ob,{rowData:e},e.id))}):I(Ds,{children:i})]})}const jy=Rt({display:"flex",padding:"16px 12px",border:"0.75px",borderStyle:"solid",borderRadius:["borderWidths.sm"],borderColor:["border.layout"]}),zy=Dt(jy,Rt({flexDirection:"column",alignItems:"flex-start",gap:"16px",flex:1}));function Ky({children:e}){return I("div",{className:zy,children:e})}const Yy=Ot({base:{display:"flex",alignItems:"center",gap:"10px",alignSelf:"stretch"}});function _y({children:e}){return I("div",{className:Yy(),children:e})}const Zy=Ot({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"12px",alignSelf:"stretch"}});function Gy({children:e}){return I("div",{className:Zy(),children:e})}const Qy=Ot({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}});function Xy({children:e,type:t,isSample:n=!1}){return I("div",{className:Qy({type:t,isSample:n}),children:e})}const Jy=e=>["banks/transactions/summary",e],$y=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query/summary",bodyParams:t[1],accessToken:t[2].accessToken,endpointManager:bo(t[2].environment)},r=await Lr(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null},ex=[{key:"NEEDS_REVIEW",apiStatuses:[gC.USER_REVIEW_REQUIRED],label:"Needs Review",variantKey:"NeedsReview",icon:fC,count:0},{key:"DISCREPANCY",apiStatuses:[gC.RECONCILIATION_DISCREPANCY],label:"Discrepancy",variantKey:"Discrepancy",icon:Jd,count:0},{key:"PROCESSING",apiStatuses:[gC.RECONCILIATION_STAGED,gC.PARTNER_REVIEW_REQUIRED],label:"Processing",variantKey:"Processing",icon:bC,count:0},{key:"RECONCILED",apiStatuses:[gC.RECONCILED],label:"Reconciled",variantKey:"Reconciled",icon:yC,count:0}];const tx=Ot({base:{display:"flex",width:"200px",height:"48px",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",cursor:"pointer"},variants:{filterStatus:{inactive:{},active:{borderRadius:["borderWidths.sm"],borderLeftWidth:"4px",borderLeftStyle:"solid",borderLeftColor:["brand.action.strong"],background:["surface.background.hover"]}}},defaultVariants:{filterStatus:"inactive"}});function nx({addFilters:e,filters:t,getModel:n,removeFilter:r,filterNames:a,filterStatus:o="inactive",filterModelKey:i,extractFilterValue:l,children:s}){const c=[],d=n(i);return d?(t.forEach((e,t)=>{const n=e.value[i]?.value;if(!n)return;const r=d.operators;r&&r.forEach(e=>{n[e.value]?.forEach(e=>{a.includes(e)&&c.push(t)})})}),I("div",{className:tx({filterStatus:o}),onClick:"inactive"===o?()=>{const t=n(i);if(!t||!t.possibleValues)return;const r=[];t.possibleValues().values.forEach(e=>{const n=l(e.value);if(n&&a.includes(n)){const n=t.createFilter(e);r.push(n)}}),e(r)}:()=>{c.forEach(e=>{r(e)})},children:s})):null}const rx=Ot({base:{display:"flex",padding:"8px",alignItems:"center",gap:"8px",alignSelf:"stretch",background:["surface.background"]},variants:{filterStatus:{inactive:{paddingLeft:"8px"},active:{paddingLeft:"4px"}}},defaultVariants:{filterStatus:"inactive"}}),ax=Ot({base:{display:"flex",padding:"10px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:["borderWidths.sm"],borderWidth:"1px",borderStyle:"solid"},variants:{reviewStatus:{Processing:{borderColor:["border.layout"],background:["surface.background"]},NeedsReview:{borderColor:["surface.intent.warning.active"],background:["surface.intent.warning"]},Discrepancy:{borderColor:["surface.intent.danger.weak"],background:["surface.intent.danger.opaque"]},Reconciled:{borderColor:["surface.intent.success.active"],background:["surface.intent.success"]}}},defaultVariants:{reviewStatus:"NeedsReview"}}),ox=Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",flex:"1 0 0"}),ix=Ot({base:{display:"flex",padding:"1px 0",alignItems:"center",gap:"10px",alignSelf:"stretch",fontFamily:["label"],fontSize:"14px",fontStyle:"normal",lineHeight:"16px",letterSpacing:"0.84px"},variants:{filterStatus:{inactive:{fontWeight:["label.sub"]},active:{fontWeight:["label.strong"]}}},defaultVariants:{filterStatus:"inactive"}}),lx=Rt({display:"flex",padding:"1px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function sx(){const{filters:e,addFilters:t,removeFilter:n,getModel:r,apiFilters:{reviewStatus:a,...o},userTransactionDashFiltersActive:i}=zf(),{data:l}=function(e){const{query:{data:t},isFilling:n,isRehydrating:r}=function({groupBy:e,filter:t}){return Wn({queryKey:Jy({groupBy:e,filter:t}),queryFn:$y})}({groupBy:"REVIEW_STATUS",filter:e});return{data:t?.data??void 0,isFilling:n,isRehydrating:r}}(o),s=["Needs Review","Discrepancy","Processing","Reconciled"],c=function(e){const t=ex.map(e=>({...e}));return e&&0!==e.length?(e.forEach(e=>{if(e.value&&CC(e.value)&&void 0!==e.count){if("ACCOUNTANT_REVIEW_REQUIRED"===e.value||"PARTNER_REVIEW_REQUIRED"===e.value)return;const n=t.find(t=>t.apiStatuses.includes(e.value));n&&(n.count+=e.count)}}),t):t}(l).sort((e,t)=>s.indexOf(e.label)-s.indexOf(t.label));if(c.some(e=>"Reconciled"!==e.variantKey&&e.count>0)&&!i){const e=[],n=r("status"),a=n?.possibleValues?.();a&&a.values.forEach(t=>{const r=t.value.status?.value.in;if(r?.includes("ACTIVE")){const r=n?.createFilter(t);r&&e.push(r)}});const o=r("reviewStatus"),i=o?.possibleValues?.();i&&i.values.forEach(t=>{const n=t.value.reviewStatus?.value.in;if(n&&n.includes("USER_REVIEW_REQUIRED")){const n=o?.createFilter(t);n&&e.push(n)}}),t(e)}return I(Xy,{children:N(Ky,{children:[I(_y,{children:I(kl,{children:"Review Status"})}),I(Gy,{children:c.map(o=>{const i=o.apiStatuses.some(e=>{return t=e,a?.in?.includes(t)??!1;var t})?"active":"inactive";return I(nx,{addFilters:t,filters:e,removeFilter:n,getModel:r,filterStatus:i,filterNames:o.apiStatuses,filterModelKey:"reviewStatus",extractFilterValue:e=>e.reviewStatus?.value.in?.[0],children:N("div",{className:rx({filterStatus:i}),children:[I("div",{className:ax({reviewStatus:o.variantKey}),children:I(Lo,{Component:o.icon},o.key)}),I("div",{className:ox,children:I("div",{className:ix({filterStatus:i}),children:o.label})}),I("div",{className:lx,children:String(o.count)})]})},o.key)})})]})})}const cx=Rt({display:"none",xl:{display:"flex",height:"318px",maxHeight:"318px",alignItems:"flex-start",gap:"16px",alignSelf:"stretch",borderRadius:["borderWidths.sm"]}});function dx(e){return I("div",{className:cx,children:e.children})}const ux=jt(null,Rt({display:"flex",flexDirection:"column",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"12px",gap:"8px",minWidth:"180px"})),hx=jt(null,Rt({width:"100%",height:"1px",backgroundColor:"border.layout"})),px=jt(null,Rt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"20px"})),gx=wa.var("colors.money.positive"),mx=wa.var("colors.money.negative");function vx({active:e,payload:t}){if(!e||!t||0===t.length)return null;const n=t.find(e=>"income"===e.dataKey),r=t.find(e=>"expense"===e.dataKey),a=t[0]?.payload?.longLabel||"",o=n?.value??0,i=r?.value??0;return N("div",{...ux,children:[I(ba,{children:a}),I("div",{...hx}),N("div",{...px,children:[I(Sa,{color:gx,label:"Income",diameter:12}),I(ya,{children:ma(Number(o))})]}),N("div",{...px,children:[I(Sa,{color:mx,label:"Expense",diameter:12}),I(ya,{children:ma(Number(i))})]})]})}const Cx={top:20,right:20,left:20,bottom:5},bx=jt(Bt["profit-loss-graph"],Rt({"& .recharts-surface":{outline:"none"}})),fx=wa.var("colors.border.layout"),yx={fill:wa.var("colors.typography.base"),fontSize:wa.var("fontSizes.metric.sm")},xx=wa.var("colors.money.positive.weak"),kx=wa.var("colors.money.negative.weak"),Tx=wa.var("colors.money.positive"),wx=wa.var("colors.money.negative");function Ex({data:e}){return I(B,{width:"100%",height:"100%",...bx,style:{flexGrow:1},children:N(U,{data:e,accessibilityLayer:!0,barCategoryGap:"20%",margin:Cx,children:[I(H,{dataKey:"label",interval:0,tickLine:!1,stroke:fx,tick:yx}),I(j,{content:({active:e,payload:t})=>I(vx,{active:e,payload:t}),isAnimationActive:!1,cursor:{fill:"transparent"}}),I(z,{name:"Expense",dataKey:"expense",minPointSize:2,fill:kx,isAnimationActive:!1,activeBar:{fill:wx}}),I(z,{name:"Income",dataKey:"income",minPointSize:2,fill:xx,isAnimationActive:!1,activeBar:{fill:Tx}})]})})}const Ax=Rt({display:"flex",flexDirection:"row",gap:"8px",justifyContent:"flex-end"}),Ix=wa.var("colors.money.positive.weak"),Sx=wa.var("colors.money.negative.weak");function Nx(){return N("div",{className:Ax,children:[I(Sa,{color:Ix,label:"Income",diameter:10}),I(Sa,{color:Sx,label:"Expense",diameter:10})]})}const Px=Ot({base:{display:"flex",flexDirection:"row","& > * + *":{marginLeft:"-1px"}},variants:{width:{full:{width:"100%"}}}});function Rx({width:e,children:t}){return I("div",{className:Px({width:e}),children:t})}function Mx({options:e,handleClick:t,selected:n}){return I(Rx,{width:"full",children:e.map(e=>I(Ap,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground",corners:"rounded"},e.value))})}const Dx=jt(null,Rt({display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"20px"})),Lx=jt(null,Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px"})),Ox=jt(null,Rt({flexDirection:"column",alignItems:"flex-end",gap:"10px",width:"300px",display:"flex"})),Fx=Dt(jy,Rt({flexGrow:1,flexShrink:0,minHeight:"100%",flexDirection:"column"})),Bx=e=>"QUARTERLY"===e?function(e){const t=/* @__PURE__ */new Date,n=3*(e-1),r=function(e){const t=e.getMonth(),n=t-t%3+3;return Jt($t(e.getFullYear(),n,0))}(t);return{beginDate:function(e){const t=e.getMonth(),n=t-t%3;return Jt($t(e.getFullYear(),n,1))}($t(t.getFullYear(),t.getMonth()-n,t.getDate())),endDate:r}}(4):"YEARLY"===e?{beginDate:Jt($t(/* @__PURE__ */(new Date).getFullYear()-4,0,1)),endDate:tn()}:"PAST_YEAR";const Ux=[{label:"Months",value:"MONTHLY"},{label:"Quarters",value:"QUARTERLY"},{label:"Years",value:"YEARLY"}];function Vx(){const[e,t]=f({label:"Months",value:"MONTHLY"}),n=function(e){const{query:{data:t}}=jr({filter:Bx(e),grouping:e,select:t=>{if("SUCCESS"!==t.result)return[];const n=t.json?.data;if(void 0===n)return[];let r=n;return"YEARLY"===e&&(r=function(e){let t=!1;const n=[],r=e.length-1,a=e.length-2;return e.forEach((e,o)=>{((e?.income?.total??0)>0||(e?.expenses?.total??0)>0)&&(t=!0),(t||o===r||o===a)&&n.push(e)}),n}(n)),r.map(t=>{const n=t.period?.beginDate,{label:r,longLabel:a}=function(e,t){return void 0===e?{label:"",longLabel:""}:"MONTHLY"===t?function(e){const t=bn(e??"");return{longLabel:t?kn(t,{abbreviateMonth:!1,abbreviateYear:!1}):"",label:Kr(e)}}(e):"QUARTERLY"===t?function(e){const t=en(e),n=t.getMonth(),r=Math.trunc(n/3)+1,a=t.getFullYear();return{label:`Q${r} ${"'"+a%100}`,longLabel:`Quarter ${r} ${a}`}}(e):"YEARLY"===t?function(e){const t=en(e).getFullYear();return{label:t.toString(),longLabel:t.toString()}}(e):{label:"",longLabel:""}}(n,e);return{longLabel:a,income:t.income?.total??0,expense:t.expenses?.total??0,label:r}})}});return t??[]}(e.value),r=n.reduce((e,t)=>e+t.income-t.expense,0);return N("div",{className:Fx,children:[N("div",{...Dx,children:[N("div",{...Lx,children:["All Transactions",I(sa,{title:ma(r),label:void 0})]}),N("div",{...Ox,children:[I(Mx,{options:Ux,handleClick:e=>t(e),selected:e}),I(Nx,{})]})]}),I(Ex,{data:n})]})}const Wx=Rt({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1440px"}),Hx=Rt({display:"flex",justifyContent:"center"}),qx=Rt({display:"flex",flexDirection:"column",gap:"10px"}),jx={filter:{status:{in:["ACTIVE"]}}},zx=e=>{const t=po[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}};function Kx({limit:e=100,columns:t=Iy}){const{sortInstance:n,setSortInstance:r,apiSort:a}=_m(),{filters:o,filterPopupModels:i,addFilters:l,removeFilter:s,apiFilters:c,getModel:d}=zf(),u={limit:e,sort:a,filter:{...c}},{isFilling:h,paginationControls:p,query:{data:g,isError:v,error:C,isFetching:b}}=Oi(u),f=g?.data,{hasPlaidLinkedBankAccount:y}=Mh(),x=y??!1,k=gb(),{query:{data:T},isFilling:w}=To({select:e=>wo(e,k)},jx),{query:{data:E}}=Dh(),{query:{data:A}}=Qb(),S=m(()=>{let e=[];const t=A?.data;t&&(e=t.map(e=>Ec(e)));let n=[];!1===E?.hasPlaidLinkedBankAccount&&(n=[wc]);const r=T??[];return[...e,...n,...r]},[T,E,A]),P=(f?.length??0)>0;if(v)return I("div",{children:`Error: ${C?.message}`});if(h)return I(Ko,{});if(void 0!==f){const e=function(e,t){let n;return n=0===e?"FILTERS_NOT_APPLIED":e>0&&0===t?"FILTERS_MATCHED_NONE":"FILTERS_MATCHED_ANY",n}(o.length,f.length);return I("div",{className:Hx,children:I("div",{className:Wx,children:N(Do.Provider,{value:p,children:[k&&N("div",{className:qx,children:[N(Kt,{children:[I(Xt,{children:"Action Items"}),I(Gb,{})]}),I(co,{children:I(Yb,{taskBanners:S,handleScrollAction:zx,isWaitingForPlaidItemAccountsSync:!P&&!0===E?.plaidItemAccountsReadyToSync,isFilling:w})})]}),!k&&N(dx,{children:[I(sx,{}),I(Vx,{})]}),I("div",{className:Rt({border:"{borderWidths.md} solid {colors.border.layout}",borderBottom:"none",paddingTop:"8px",marginTop:"16px"}),children:I(Ay,{filterModels:i,addFilters:l,filters:o,removeFilter:s,getModel:d,isFetching:b})}),I("div",{className:Rt({border:"{borderWidths.md} solid {colors.border.layout}",paddingTop:"8px"}),children:I(Cl.Provider,{value:{sortInstance:n,setSortInstance:r},children:I(qy,{hasLinkedBankAccount:x,filterState:e,transactions:f,columns:t})})}),I(Ny,{})]})})})}return"zero state"}const Yx=e=>I(of,{children:I(Kx,{...e})}),_x=Dt(Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),ea);function Zx({children:e}){return I("div",{className:_x,children:e})}const Gx=jt(null,Rt({display:"flex",backgroundColor:"surface.intent.action.discrete",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),Ro),Qx=()=>Ai();function Xx({Icon:e=Wl,handleClose:t=Qx}={}){return I("button",{...Gx,onClick:t,type:"button",children:I(Yc,{Component:e,...Gx})})}const Jx=Rt({display:"flex",flexDirection:"column"});function $x({task:e}){return I("div",{className:Jx,children:I(Vb,{task:e})})}const ek=Rt({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),tk=Rt({width:"80px",height:"12px"}),nk=Rt({width:"150px",height:"16px"}),rk=Rt({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),ak=Rt({userSelect:"none",cursor:"pointer"});function ok(){return N("div",{className:rk,children:[N("div",{className:ak,children:[N("div",{className:ek,children:[I(Ya,{styles:nk}),I(Ya,{styles:tk})]}),N("div",{className:ek,children:[I(Ya,{styles:nk}),I(Ya,{styles:tk})]})]}),I("div",{className:ak,children:N("div",{className:ek,children:[I(Ya,{styles:nk}),I(Ya,{styles:tk})]})})]})}const ik=Rt.raw({"&::before":{content:{base:"''",sm:"none"},position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function lk({children:e,stylists:t,shouldUseButtonDiscreteStyles:n=!1}){const r=gb(),a=n||r?ns:hl;return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:e=>I(a,{extraClassNames:[ik],popupTriggerProps:e,children:I(Lo,{Component:Ly,stylists:t})})}),I(Gl,{children:e})]})}const sk=Io(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),p.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),ck=Rt({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),dk=Rt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),uk=Rt({display:"flex",flexDirection:"column",gap:"12px"}),hk=Rt({display:"flex",flexDirection:"row",gap:"10px"}),pk=Rt({display:"flex",flexDirection:"column",gap:"10px"}),gk=({acknowledged:e,setAcknowledged:t})=>N("div",{className:uk,children:[I(kl,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),N("div",{className:hk,children:[I(Xm,{checked:e,onClick:()=>t(!e)}),I(kl,{wrap:"wrap",children:"I understand."})]})]});function mk({bankAccounts:e}){const{apiPartnerName:t}=C(Eo),n=e.reduce((e,t)=>{const n=bn(t.tranStartDate||""),r=bn(e.tranStartDate||"");return n&&r&&gn(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=Ud();return kg({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,a;Cd({title:"Start Date Updated",body:N("div",{className:pk,children:[I(kl,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),I(kl,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:cd,type:md}]}),n((r=e,a=t.value.tranStartDate,r.map(e=>({id:qi(e.id),tranStartDate:a,duplicateBankAccountIds:[]}))))}})})(e,n),a=Ul(),o=()=>{a.close()},[i,l]=f(!1),{query:{data:s}}=ed(),c=s?.data?.find(t=>t.id===(e[0]?.integration?.id??""))?.apiInstitutionName||"bank",d=bn(e.reduce((e,t)=>{const n=bn(t.tranMinStartDate||""),r=bn(e.tranMinStartDate||"");return n&&r&&gn(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${yd(e[0]?.name,e[0]?.mask)} account dating back to ${wn(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${wn(d)}.`;return N("form",{className:ck,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),a.close()},children:[I(ba,{children:"Set Bank Transaction Start Date"}),I(kl,{wrap:"wrap",children:u}),I(kl,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),I(r.AppField,{name:"tranStartDate",children:e=>I(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),I(r.Subscribe,{selector:e=>e,children:e=>{const t=bn(e.values.tranStartDate||""),r=bn(n),a=t&&r&&gn(t,r);return N(S,{children:[e.isDirty&&a&&I(gk,{acknowledged:i,setAcknowledged:l}),N("div",{className:dk,children:[I(Eg,{showIcon:!1,onClick:o}),I(Xd,{showIcon:!1,textContent:"Confirm",disabled:!!a&&!i})]})]})}})]})}function vk({bankAccounts:e}){return N(Bl,{placement:"right-start",modal:!0,children:[I(Vl,{children:e=>N(bh,{...e,children:[I(Yc,{Component:sk}),I(ba,{children:"Edit Start Date"})]})}),I(cy,{children:I(hy,{children:I(gy,{width:"sm",children:I(mk,{bankAccounts:e})})})})]})}const Ck=Io(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M7.49998 14.4245C11.3242 14.4245 14.4244 11.3244 14.4244 7.50011C14.4244 3.67585 11.3242 0.575684 7.49998 0.575684C3.67573 0.575684 0.575562 3.67585 0.575562 7.50011C0.575562 11.3244 3.67573 14.4245 7.49998 14.4245Z",strokeMiterlimit:10}),p.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),bk=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),p.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),fk=Rt({display:"flex",flexDirection:"column",gap:"16px"}),yk=jt(null,Rt({color:"brand.danger"}));function xk({integration:e,accounts:t}){const{mutate:n}=am(),r=Ul(),{linkPlaid:a,loading:o,hasOnPlaidLinkOverride:i}=lm(),{query:{data:l}}=(s=e.id,$c({},{select:e=>{return{...e,data:(t=e.data,n=s,t?.find(e=>e.id===n))};var t,n}}));var s;const c=l?.data,{query:{data:d}}=Fh(e.id),u=d?.data,h="PLAID"===e.apiName,p="UNIT"===e.apiName;return N(uh,{children:[h&&!o&&N(bh,{onClick:()=>(a({plaidEvent:Yg,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r.close()),children:[I(Yc,{Component:$i}),I(ba,{children:"Add Account"})]}),h&&u&&I(vk,{bankAccounts:u}),t.length>0&&N(bh,{onClick:()=>Vg({plaidItemAccounts:t}),children:[I(Yc,{Component:bk}),I(ba,{children:"Merge Accounts"})]}),!p&&N(bh,{onClick:()=>(async()=>{const t=await(async e=>Cd({title:"Remove Institution",body:I("div",{className:fk,children:I(kl,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:ld,label:"Cancel"},{key:sd,label:"Remove",type:vd}]}))(e.apiInstitutionName);var o;r.close(),t===sd&&(h&&i?a({plaidEvent:_g,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(o=e.id,n({id:o})))})(),children:[I(Yc,{stylists:[yk],Component:Ck}),I(ba,{stylists:[yk],children:"Delete Connection"})]})]})}const kk=Rt({userSelect:"none"});function Tk({children:e}){return I("div",{className:kk,children:e})}const wk=Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"16px 12px 16px 16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"});function Ek({children:e}){return I("div",{className:wk,children:e})}const Ak=jt(Bt.badge,Sv),Ik=jt(null,na),Sk=jt(null,Ro),Nk=jt(Bt["neutral-badge"],Pv),Pk=jt(Bt["highlight-badge"],Mv),Rk=jt(Bt["success-badge"],Lv),Mk=jt(Bt["warning-badge"],Fv),Dk=jt(Bt["critical-badge"],Uv);function Lk({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:a}){let o;switch(e){case"critical":o=Dk;break;case"warning":o=Mk;break;case"neutral":o=Nk;break;case"success":o=Rk;break;case"highlight":o=Pk}const i=Zt([Ak,Ik,o,Sk]);return I("button",{...i,onClick:n,disabled:r,...a,children:t})}function Ok({plaidItem:e}){const t=Bb(e);return N(Lk,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(Tr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),Ub(t))},disabled:Sn(t),children:[I(Yc,{Component:Jd}),I(ya,{children:"Fix Bank Error"}),I(Lo,{Component:No})]})}const Fk=Ot({base:{padding:"16px 16px 16px 24px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}}),Bk=Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"14px",overflow:"hidden"});function Uk({bankAccountId:e,name:t,mask:n,syncText:r,active:a,integration:o}){const i="PLAID"===o?.apiName,l=Dt(Fk({active:a}),Ro);return N("button",{className:l,onClick:t=>{t.stopPropagation(),Ei("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!a,children:[N("div",{className:Bk,children:[I(Yc,i?{Component:lv}:{Component:Dp}),I(Op,{accountName:t,accountNo:n,syncText:r,active:a})]}),a&&I(Yc,{Component:No})]})}const Vk={QBO:"QuickBooks Online",XERO:"Xero",STRIPE:"Stripe",SHOPIFY:"Shopify",SQUARE:"Square",RUTTER:"Rutter",UBER:"Uber",MOOV:"Moov",QUALPAY:"Qualpay",BENCH:"Bench",WAVE:"Wave",MANUAL_ENTRY:"Manual Entry",CSV_IMPORT:"CSV Import",PARTNER_IMPLEMENTATION:"Partner Implementation",FRESHBOOKS:"FreshBooks",FRESHBOOKS2:"FreshBooks"};function Wk(e){const{apiPartnerName:t,unitIntegrationBankName:n}=C(Eo);return"UNIT"===e?n??t??"Unit":Vk[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const Hk=Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"12px"}),qk=Rt({display:"flex",flexDirection:"column",gap:"4px"}),jk=Rt({display:"flex",alignItems:"center",gap:"8px"}),zk=jt(null,Rt({color:"brand.primary.weak"})),Kk=Rt({overflow:"hidden"}),Yk=e=>{const t=e.find(e=>e.isSupported&&e.lastSyncedDate);if(t&&t.lastSyncedDate)return`Last synced ${Tn(t.lastSyncedDate)}`},_k=e=>{let t;return t=e.isSupported?e.lastSyncedDate?void 0:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function Zk({integration:e,isCompact:t=!1}){const{query:{data:n}}=Fh(e.id),r=n?.data,a="PLAID"===e.apiName,o=Bp(a?e.apiInstitutionId??void 0:void 0),i=Wk(e.apiName);return l=r,Array.isArray(l)&&l.length>0?N(Tk,{children:[N(Ek,{children:[N("div",{className:Hk,children:[I("img",{src:o,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}),N("div",{className:qk,children:[I(kl,{children:e.apiInstitutionName??i}),I(ya,{children:Yk(r)})]})]}),N("div",{className:jk,children:[a&&Nn(e.apiErrorCode)&&I(Ok,{plaidItem:e}),I(lk,{stylists:[zk],shouldUseButtonDiscreteStyles:t,children:I(xk,{integration:e,accounts:r})})]})]}),I("div",{className:Kk,children:r.map(t=>I(Uk,{bankAccountId:t.id,mask:t.mask,name:t.name,syncText:_k(t),active:t.isSupported,integration:e},t.id))})]}):null;var l}const Gk=Rt({objectFit:"contain"});function Qk(e,t,n){const r=({size:n=24})=>I("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:Gk});return r.displayName=t,r}const Xk=Qk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1BYqFVTahLqg0JYSriExARInsXGwncSJPb7N7Uz/v/+3vnX2OR7HpiB1Zc5ea32X/3fZ31577X1O3Ctj7ba3/c3tvcmJ+0u/3LdWyr5SevO9Xs9SdGulV3r9mK9FV+CvVRlNpKK/Oh90xiX1hLa2JiTJpBx9VzaxJRjYFS/lm9uiS8I445gNowkPB4kj3dOl9A+pf7A3WH3gwN+++/GhlEOJ6e23f3h6sHf3R3sTvff31ZQcmR0GipR97PcZyukhL5OD0aQ351CyIgCBiX46yNh8ywWuaXloulKuzXbCO2NCbngdG135HBOTlYZwySLRAwXwie+fWP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tyt5lOV5gILQ9wCZACTv6g+S6Qk6vY4W9O4EGWS3Ke8AqN/uXE9Qfv14zHufxzn8ivo+j6OdesI7jgzVf+N8wWRPvE90+TeQA5/oAilAAjWssDytrQm2g4Hf98v42E9wT8In87zPBDKEn02Y0wmZAdg6AAAAAElFTkSuQmCC","Uber")};function rT(e){return nT[e]??Dp}const aT=Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"12px"}),oT=Rt({display:"flex",flexDirection:"column",gap:"4px"}),iT=jt(null,Rt({color:"brand.danger"})),lT=Rt({display:"flex",flexDirection:"column",gap:"16px"}),sT=({integration:e})=>{const{mutate:t}=am(),n=Ul(),r=Wk(e.apiName);return I(uh,{children:N(bh,{onClick:()=>(async()=>{const a=await(async e=>Cd({title:"Remove Institution",body:I("div",{className:lT,children:I(kl,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:ld,label:"Cancel"},{key:sd,label:"Remove",type:vd}]}))(r);n.close(),a===sd&&t({id:String(e.id)})})(),children:[I(Yc,{stylists:[iT],Component:Ck}),I(ba,{stylists:[iT],children:"Delete Connection"})]})})};function cT({integration:e,isCompact:t}){const n=Wk(e.apiName),r=function(e){if(e)return`Last synced ${Tn(e)}`}(e.lastSyncedDate),a=rT(e.apiName);return I(Tk,{children:N(Ek,{children:[I(Zx,{children:N("div",{className:aT,children:[I(Ls,{Component:a}),N("div",{className:oT,children:[I(kl,{wrap:"wrap",children:e.apiUsername?`${n} (${e.apiUsername})`:n}),r&&I(ya,{intent:"normal",children:r})]})]})}),I(lk,{shouldUseButtonDiscreteStyles:t,children:I(sT,{integration:e})})]})})}const dT=Rt({display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:"16px 12px",marginBottom:"8px"}),uT=Rt.raw({color:"typography.base.weak"}),hT=Rt({overflow:"hidden"});function pT({manualBankAccounts:e,isCompact:t=!1}){const n=gb(),r=t||n?ns:hl;return N(Tk,{children:[N("div",{className:dT,children:[I(kl,{extraClassNames:[uT],children:"Manually Tracked Accounts"}),I(r,{onClick:()=>Ei("BankAccountForm"),active:!1,children:I(Lo,{Component:$i})})]}),I("div",{className:hT,children:e.map(e=>I(Uk,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const gT=Dt(Rt(al,{backgroundColor:"surface.foreground",minWidth:"100%",justifyContent:"start",marginBottom:"5px",padding:"16px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"}),Po),mT=Rt({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),vT=Rt({display:"flex",alignItems:"center",gap:"8px"}),CT=Rt({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",gap:"4px"});function bT(){const{linkPlaid:e,loading:t}=sm();return I("button",{className:gT,disabled:t,onClick:()=>{Tr("Add New Connection button pressed"),e({plaidEvent:Kg,message:"Add New Connection button pressed"})},children:N("div",{className:mT,children:[N("div",{className:vT,children:[I(Ls,{stylists:[jt(null,Rt({width:"20px",height:"20px"}))],Component:Dp}),N("div",{className:CT,children:[I(kl,{children:"Connect your bank"}),I(ya,{children:"Find your banking institution with Plaid"})]})]}),I(Yc,{Component:No})]})})}const fT=Rt({paddingInline:"16px",paddingBottom:"8px"}),yT=Rt.raw({color:"typography.base.weak",fontWeight:"label"});function xT({title:e,children:t}){return N("div",{children:[I("div",{className:fT,children:I(kl,{extraClassNames:[yT],children:e})}),t]})}const kT=Rt({minWidth:"100%",height:"45px"});function TT(){return N(S,{children:[I(Ya,{styles:kT}),I(Ya,{styles:kT}),I(Ya,{styles:kT})]})}const wT=Dt(Rt(al,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Po),ET=Rt({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),AT=Rt({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),IT=Rt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function ST({integration:e}){const{linkPlaid:t,loading:n}=lm(),r=Bp(e.apiInstitutionId??void 0),a="PLAID"===e.apiName,o=rT(e.apiName),i=Wk(e.apiName);return I("button",{className:wT,disabled:n||!a,onClick:()=>{Tr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:Yg,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:N("span",{className:ET,children:[N("div",{className:AT,children:[r?I("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):I(Ls,{Component:o}),I(kl,{children:e.apiInstitutionName??i??void 0})]}),a&&N("div",{className:IT,children:[I(Lo,{Component:Kc}),I(kl,{children:"Relink"})]})]})})}const NT=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},p.createElement("g",{fill:"none",fillRule:"nonzero"},p.createElement("path",{fill:"#95BF47",d:"M48.024 12.24a.567.567 0 0 0-.536-.495c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69c-.357-.36-1.073-.27-1.341-.18-.045 0-.716.225-1.878.585-1.118-3.285-3.086-6.255-6.529-6.255h-.313C27.768.585 26.517 0 25.487 0c-8.048 0-11.894 10.125-13.1 15.255-3.13.99-5.367 1.665-5.635 1.755-1.744.54-1.789.585-2.012 2.25C4.56 20.52 0 56.07 0 56.07l35.549 6.705L54.82 58.59c0-.045-6.752-46.035-6.797-46.35zm-14.443-3.6c-.894.27-1.922.585-2.996.945V8.91c0-1.98-.268-3.6-.715-4.905 1.789.27 2.951 2.295 3.711 4.635zm-5.947-4.185c.492 1.26.805 3.015.805 5.445v.36c-1.967.63-4.07 1.26-6.215 1.935 1.207-4.635 3.487-6.885 5.41-7.74zm-2.37-2.295c.358 0 .716.135 1.029.36-2.594 1.215-5.321 4.275-6.484 10.44-1.7.54-3.354 1.035-4.919 1.53 1.342-4.68 4.606-12.33 10.374-12.33z"}),p.createElement("path",{fill:"#5E8E3E",d:"M47.488 11.7c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69a.716.716 0 0 0-.492-.225l-2.683 55.35 19.273-4.185s-6.752-46.035-6.797-46.35a.776.776 0 0 0-.581-.54z"}),p.createElement("path",{fill:"#FFF",d:"M29.02 22.41l-2.37 7.11S24.55 28.395 22 28.395c-3.756 0-3.935 2.385-3.935 2.97 0 3.24 8.407 4.5 8.407 12.105 0 5.985-3.757 9.855-8.854 9.855-6.126 0-9.211-3.825-9.211-3.825l1.654-5.445s3.22 2.79 5.902 2.79c1.789 0 2.504-1.395 2.504-2.43 0-4.23-6.886-4.41-6.886-11.385 0-5.85 4.159-11.52 12.61-11.52 3.22-.045 4.83.9 4.83.9z"}),p.createElement("path",{fill:"#000",d:"M77.835 35.263c-1.938-1.032-2.93-1.93-2.93-3.141 0-1.526 1.398-2.513 3.56-2.513 2.524 0 4.777 1.032 4.777 1.032L85 25.256S83.378 24 78.6 24c-6.669 0-11.31 3.814-11.31 9.154 0 3.051 2.163 5.34 5.047 7 2.343 1.301 3.154 2.243 3.154 3.634 0 1.436-1.171 2.603-3.334 2.603-3.2 0-6.264-1.66-6.264-1.66L64 50.115S66.794 52 71.526 52c6.85 0 11.807-3.365 11.807-9.423-.045-3.32-2.524-5.61-5.498-7.314zM103.897 24.304c-3.316 0-5.925 1.62-7.914 4.053l-.089-.045L98.768 13h-7.472L84 52h7.473l2.476-13.33c.972-5.044 3.537-8.152 5.925-8.152 1.68 0 2.343 1.171 2.343 2.838 0 1.035-.088 2.341-.31 3.377L99.078 52h7.473l2.919-15.762c.31-1.666.53-3.648.53-4.999.045-4.368-2.166-6.935-6.102-6.935zM127.92 24C118.943 24 113 32.23 113 41.4c0 5.859 3.565 10.6 10.255 10.6C132.058 52 138 43.994 138 34.6c.044-5.456-3.081-10.6-10.08-10.6zm-3.653 22.185c-2.552 0-3.609-2.191-3.609-4.965 0-4.338 2.201-11.405 6.25-11.405 2.641 0 3.521 2.326 3.521 4.562 0 4.652-2.244 11.808-6.162 11.808zM157.168 24c-5.102 0-8.01 4.489-8.01 4.489h-.09l.447-4.045h-6.713c-.313 2.712-.94 6.89-1.521 10L136 62h7.563l2.104-11.156h.179s1.566.978 4.43.978c8.906 0 14.724-9.066 14.724-18.222 0-5.067-2.282-9.6-7.832-9.6zm-7.25 22.133c-1.969 0-3.133-1.11-3.133-1.11L148.04 38c.895-4.711 3.356-7.822 5.996-7.822 2.328 0 3.044 2.133 3.044 4.133 0 4.889-2.91 11.822-7.16 11.822zM176.287 14A4.25 4.25 0 0 0 172 18.284c0 2.186 1.414 3.716 3.536 3.716h.088c2.343 0 4.332-1.574 4.376-4.284 0-2.186-1.459-3.716-3.713-3.716zM166 52h7.736L179 25h-7.782zM198.487 25.574h-5.453l.277-1.276c.462-2.642 2.034-4.965 4.668-4.965 1.387 0 2.496.41 2.496.41l1.525-6.06S200.66 13 197.748 13c-2.773 0-5.546.774-7.672 2.551-2.681 2.233-3.929 5.467-4.53 8.747l-.23 1.276h-3.652l-1.156 5.831h3.652L180 53h7.81l4.16-21.595h5.408l1.11-5.831z"}),p.createElement("path",{fill:"#000",d:"M216.005 25s-4.788 11.928-6.912 18.45h-.09c-.135-2.1-1.897-18.45-1.897-18.45h-8.04l4.607 24.615c.09.536.045.894-.18 1.251-.904 1.698-2.395 3.35-4.157 4.557-1.445 1.027-3.071 1.697-4.336 2.144L197.123 64c1.536-.313 4.788-1.608 7.498-4.11 3.479-3.216 6.731-8.22 10.029-15.01L224 25h-7.995z"}))),PT=Dt(Rt(al,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Po),RT=Rt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),MT=Rt({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),DT=Rt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),LT=Rt({border:"{borderWidths.lg} solid ",borderColor:"border.layout.strong",outline:"none",backgroundColor:"surface.foreground",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",padding:"12px 16px",borderRadius:"md",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"}}),OT=Rt({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function FT(){const e=Ul(),{mutateAsync:t}=em(),[n,r]=f("");return N("div",{className:MT,children:[I(ba,{children:"Enter your shop name"}),I("div",{className:OT,children:I(NT,{})}),I(kl,{children:"Please enter the name of your shop below."}),I("input",{className:LT,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),N("div",{className:DT,children:[I(Eg,{showIcon:!1,onClick:()=>{e.close()}}),I(id,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.close()},children:I(ba,{children:"Connect"})})]})]})}function BT(){const e=rT("SHOPIFY")??Kc;return N(Bl,{placement:"bottom",modal:!0,children:[I(Vl,{children:t=>N("button",{className:PT,...t,children:[N("div",{className:RT,children:[I(Ls,{Component:e}),I(kl,{children:"Shopify"})]}),I(Yc,{Component:No})]})}),I(cy,{children:I(hy,{children:I(gy,{width:"sm",children:I(FT,{})})})})]})}const UT=Dt(Rt(al,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),Po),VT=Rt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function WT({apiName:e}){const{mutateAsync:t}=em(),n=Wk(e);if("SHOPIFY"===e)return I(BT,{});const r=rT(e)??Kc;return N("button",{className:UT,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[N("div",{className:VT,children:[I(Ls,{Component:r}),I(kl,{children:n})]}),I(Yc,{Component:No})]})}const HT=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function qT(e){return HT.includes(e)}const jT=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],zT=Rt({display:"flex",flexDirection:"column",paddingTop:"16px",gap:"16px",overflowY:"auto",height:"100%",backgroundColor:"surface.background"}),KT=Rt({display:"flex",flexDirection:"column",borderTop:"{borderWidths.md} solid {colors.border.layout.weak}"});function YT(){const{query:{data:e},isFilling:t}=Xb(),n=e?.multiAccountIntegrations,r=e?.integrations,a=Nn(n)&&n.length>0||Nn(r)&&r.length>0,o=function({connectedIntegrations:e}){const t=C(Eo),n=ze(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(qT),a=e?.map(e=>e.apiName)||[];let o=r??jT;return t&&(o=o.filter(e=>{switch(e){case"GUSTO":return t.hasPayroll;case"SHOPIFY":return t.hasShopify;case"SQUARE":return t.hasSquare;case"STRIPE":return t.useStripeInvoicePaymentProcessing;default:return!0}})),o=o.filter(e=>!a.includes(e)),o}({connectedIntegrations:r});return N("div",{className:zT,children:[(t||a)&&I(xT,{title:"Already Connected",children:t?I(TT,{}):N(S,{children:[n?.map(e=>I(ST,{integration:e},e.id)),r?.map(e=>I(ST,{integration:e},e.id))]})}),I(xT,{title:"Available Banks",children:I(bT,{})}),o&&o.length>0&&I(xT,{title:"Integrations",children:I("div",{className:KT,children:o.map(e=>I(WT,{apiName:e},e))})})]})}const _T=Rt({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}),ZT=Rt({marginTop:"16px"}),GT=Rt.raw({color:"typography.base.weak",fontWeight:"label",paddingInline:"16px",marginBottom:"8px"});function QT({isCompact:e,showPlaidItems:t,showNewConnectionContent:n,multiAccountIntegrations:r,integrations:a,manualBankAccounts:o}){return n?I(YT,{}):t?N(S,{children:[N("div",{className:ZT,children:[I(kl,{extraClassNames:[GT],children:"Connected Accounts"}),r?.map(t=>I(Zk,{integration:t,isCompact:e},t.id)),a?.map(t=>I(cT,{integration:t,isCompact:e},t.id))]}),o&&o.length>0&&I(pT,{manualBankAccounts:o,isCompact:e})]}):o&&o.length>0?I(pT,{manualBankAccounts:o}):N("div",{className:_T,children:[I(Ls,{Component:Dp}),I(ba,{wrap:"wrap",textAlign:"center",children:"If you prefer to manually input your transactions as opposed to having them automatically tracked, you can add your Manually Tracked Bank Account(s) here."})]})}const XT=Rt.raw({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}),JT=jt(null,Rt({color:"typography.base.weak"})),$T=jt(Bt["drawer-header"],Rt({padding:"10px 12px 10px 15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"},XT)),ew=Rt({display:"flex",gap:"8px"}),tw=Rt({display:"flex",flexDirection:"column",gap:"16px",height:"100%"}),nw=Ot({base:{overflowY:"auto",height:{base:"100%",sm:"fit-content"},scrollbar:"hidden"},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),rw=Rt({padding:"20px 16px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.foreground",width:"100%"}),aw=Rt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"16px",margin:"16px"}),ow=jt(null,Rt({minWidth:"100%",padding:"16px",border:"1px solid {colors.border.intent.primary}"})),iw=Ot({base:{},variants:{refreshLoading:{true:{animation:"spin 1s linear infinite"},false:{animation:"none"}}}});function lw({inOverlay:e,showCloseButton:t=!1,onPlaidLink:n,hideManualBanks:r}){const a=gb()||e;lm();const{query:{data:o},isFilling:i}=Xb(),l=o?.multiAccountIntegrations,s=o?.integrations,{query:{data:c}}=Ad({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>Wd(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:Lh(e?.data)};var t}}),{mutate:d,isPending:u}=nm(),h=c?c.manualAccounts:null,p=l&&s?l.length+s.length:0,g=l?.find(e=>e.apiErrorCode),m=g&&Ec(g,!1),v=ze(e=>e.externalOptions.banksAndIntegrations),C=v?.integrations,b=r??(void 0!==C&&!C.includes("MANUAL_ENTRY")),f=ze(e=>e.banksAndIntegrationsSelectedTab),y=b||"connected"===f.value,x=0===p&&y,k=y?"Add New Connection":"Add New Account",T=()=>{Ei(y?"NewConnection":"BankAccountForm")},w=a?ns:hl;return N(Qg,{onPlaidLink:n,children:[N("div",{...$T,children:[N(Zx,{children:[t&&I(Xx,{}),a?I(ba,{children:"Banks & Integrations"}):I(Xt,{stylists:[JT],children:"Banks & Integrations"})]}),N("div",{className:ew,children:[0!==p&&N(w,{onClick:()=>d(),active:!1,disabled:u,children:[I(Yc,{Component:Kc,stylists:[jt(null,iw({refreshLoading:u}))]}),!a&&I(kl,{children:"Sync Accounts"})]}),N(w,{onClick:()=>T(),active:!1,children:[I(Yc,{Component:$i}),!a&&I(kl,{children:"Add New Connection"})]})]})]}),m&&I("div",{className:aw,children:I($x,{task:m})}),i?I(ok,{}):N(S,{children:[I("div",{className:nw({height:x?"fill":void 0,background:x?"foreground":void 0}),children:I("div",{className:tw,children:I(QT,{isCompact:a,showPlaidItems:y,showNewConnectionContent:x,multiAccountIntegrations:l,integrations:s,manualBankAccounts:h})})}),a&&!(y&&x)&&I("div",{className:rw,children:N(hl,{stylists:[ow],onClick:()=>T(),disabled:y&&!1,children:[I(Yc,{Component:$i}),I(ba,{children:k})]})})]})]})}const sw=Rt({display:"flex",justifyContent:"center"}),cw=Rt({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1150px",border:"{borderWidths.md} solid {colors.border.layout.weak}",borderRadius:"lg",backgroundColor:"surface.foreground",marginBottom:"42px"});function dw({onPlaidLink:e,hideManualBanks:t}){return I(of,{children:I("div",{className:sw,children:I("div",{className:cw,children:I(lw,{showCloseButton:!1,onPlaidLink:e,hideManualBanks:t,inOverlay:!1})})})})}const uw=we("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),hw={queryClient:Bn,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await uw).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await uw).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await uw).delete("queryClient",e)}(e)}}}(),maxAge:Fn,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function pw({children:e}){return I(Ee,{client:Bn,persistOptions:hw,children:e})}const gw=Rt({position:"absolute",top:0,left:0,width:{base:0,sm:"100dvw"},height:{base:0,sm:"100dvh"},minWidth:{base:0,sm:"100dvw"},minHeight:{base:0,sm:"100dvh"},maxHeight:{base:0,sm:"100dvh"},maxWidth:{base:0,sm:"100dvw"},overflow:"hidden",backgroundColor:"overlay"}),mw=Rt({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100dvw",height:"100dvh",minWidth:"100dvw",minHeight:"100dvh",maxHeight:"100dvh",maxWidth:"100dvw",overflow:"hidden"}),vw=jt(null,Bt.component,mw);function Cw({children:e}){const t=g(null),n=g(null);return N(pe,{lockScroll:!0,children:[I("div",{className:gw}),I("div",{onMouseDown:e=>{n.current=e.target},onClick:e=>{const r=n.current===t.current,a=e.target===t.current;r&&a&&(n.current=null,ze.getState().requestCloseAllDrawers())},ref:t,...vw,children:e})]})}const bw=v({drawerHistory:[]});function fw({children:e}){const t=ze(e=>e.drawerHistory),n=m(()=>({drawerHistory:t}),[t]),r=t.length>0;return I(bw.Provider,{value:n,children:r&&I(Cw,{children:e})})}const yw=v({isActive:!0,isInHistory:!0});function xw({Component:e,name:t}){const{drawerHistory:n}=C(bw),r=n.at(-1);if(void 0===r)return null;const a=n.find(e=>void 0!==e[t]),o=void 0!==r[t],i=void 0!==a;return a&&a[t]?I(yw.Provider,{value:{isActive:o,isInHistory:i},children:I(e,{...a[t].routeProps})}):void 0}const kw=Ot({base:{position:"absolute",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},display:"flex",_focus:{outline:"none"}},variants:{shouldDisplay:{true:{},false:{display:"none"}},animationVariant:{slideInRight:{animation:"slideIn.right"},slideInUp:{animation:"slideIn.up"},slideOutRight:{animation:"slideOut.right"},slideOutDown:{animation:"slideOut.down"},none:{}}},defaultVariants:{shouldDisplay:!0,animationVariant:"none"}});function Tw({children:e}){const t=g(null),{isActive:n,isInHistory:r}=C(yw),{animationState:a,handleAnimationEnd:o,shouldDisplay:i}=function({isActive:e,isInHistory:t,focusRef:n}){const r=g(!1),a=g(!1),[o,i]=f("none"),l=ze(e=>e.closingDrawerCount),s=l>0,c=e&&s,d=e||s||t;A(()=>{e&&t&&!a.current&&!s&&i("opening"),r.current=e,a.current=t},[e,t,s]),A(()=>{c&&"closing"!==o&&i("closing")},[c,o]);const u=y(e=>{("slide-out-right"===e.animationName||"slide-out-down"===e.animationName)&&(l>1?ze.getState().confirmCloseAllDrawers():ze.getState().confirmCloseDrawer()),i("none")},[l]);return x(()=>{e&&!s&&n.current?.focus()},[e,s,n]),{animationState:o,handleAnimationEnd:u,shouldDisplay:d}}({isActive:n,isInHistory:r,focusRef:t});return I("div",{ref:t,tabIndex:-1,className:kw({shouldDisplay:i,animationVariant:/* @__PURE__ */function(e){return"none"===e?"none":"opening"===e?"slideInRight":"slideOutRight"}(a)}),onAnimationEnd:o,children:e})}const ww=jt(null,Rt({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"}));function Ew({children:e}){return I("div",{tabIndex:-1,...ww,children:e})}const Aw=Ot({base:{display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"},variants:{background:{foreground:{backgroundColor:"surface.foreground"}}}});function Iw({background:e,children:t}){return I("div",{className:Aw({background:e}),children:t})}const Sw=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function Nw(e){return void 0!==Sw[e]}function Pw(e){return Sw[e]}const Rw=Io(e=>p.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,...e},p.createElement("defs",null,p.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),p.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"}),p.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),Mw=Rt({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function Dw({cldrShortName:e}){return I("div",{className:Mw,children:Pw(e)})}const Lw=Ot({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),Ow=Rt({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"});function Fw({reactions:e,type:t,handleClick:n}){return I("div",{className:Ow,children:e.map((e,r)=>I("button",{className:Lw({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:I(Dw,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const Bw=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:bo(n)};return await Lr(o)},Uw=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:a}=e,o={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:a},accessToken:t,endpointManager:bo(n)};return await async function(e){return Jg(e)}(o)};function Vw(e,t,n){return An(ji({id:e}),t,n)}async function Ww(e){const t=ji({id:e});return Tr("mutation successful, invalidating messages queries"),Bn.invalidateQueries({queryKey:t}).catch(e=>wr({error:e,severity:"error"}))}function Hw(e,t,n){const r=[...e];return r[n]=t,r}const qw=Rt({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),jw=Object.keys(Sw).filter(Nw).map(e=>({emojiCode:e,authorInfo:[]}));function zw({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:a,setReactionIsOpen:o}){const{userId:i}=C(Eo),{mutate:l}=function(e){const{userId:t,userEmail:n}=C(Eo);return Rd({mutationFn:Bw,onMutateFn:({data:r,accessToken:a,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a,userEmail:o}){const i=Vw(n,t,r);await Bn.cancelQueries({queryKey:i});const l=Bn.getQueryData(i);return Bn.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:Hw(t,(r=t[n],i=e,l=a,s=o,{...r,reactions:[...r.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),n);var r,i,l,s}),{oldMessages:l}}({data:r,accessToken:a,conversationId:e,environment:o,userId:t,userEmail:n})},onSettled:()=>Ww(e)})}(e);return N(Bl,{placement:"top-end",open:a,onOpenChange:o,blockInteraction:!0,children:[I(Vl,{children:e=>I("button",{className:qw,...e,children:I(Yc,{Component:Rw})})}),I(Gl,{type:"reaction",children:I(Fw,{reactions:jw,type:n,handleClick:e=>{r.some(t=>{const n=t.emojiCode===e,r=t.authorInfo.some(e=>e.userId===i);return n&&r})||(l({id:t,emojiCode:e}),o(!1))}})})]})}const Kw=Ot({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function Yw({reactions:e,type:t,handleClick:n}){const r=Kw({type:t});return I("div",{className:r,children:I(Fw,{reactions:e,handleClick:n,type:t})})}const _w=Ot({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),Zw=Ot({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"}}}}),Gw=Rt({position:"relative",display:"flex",flexDirection:"column"});function Qw({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:a=[]}){const o=g(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=f(!1),[r,a]=f(!1);return x(()=>{if(null===o.current||!i||s)return;const e=o.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,o=e,s=r,l=n]),{isHover:t,reactionIsOpen:r,setIsHover:n,setReactionIsOpen:a};var o,i,l,s}(o),{mutate:d}=function(e){const{userId:t}=C(Eo);return Rd({mutationFn:Uw,onMutateFn:({data:n,accessToken:r,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:a}){const o=Vw(n,t,r);await Bn.cancelQueries({queryKey:o});const i=Bn.getQueryData(o);return Bn.setQueryData(o,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return Sn(r)||0===r.reactions.length?t:Hw(t,function(e,t,n){const r=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===n));return{...e,reactions:r}}(r,e.emojiCode,a),n)}),{oldMessages:i}}({data:n,accessToken:r,conversationId:e,environment:a,userId:t})},onSettled:()=>Ww(e)})}(e),u=n?"sent":"received",h=a.filter(e=>Nw(e.emojiCode)),p=h.length>0;return N("div",{className:_w({type:u,hasReactionsOnMessage:p}),ref:o,onMouseEnter:()=>"received"===u&&l(!0),children:[N("div",{className:Gw,children:[I("div",{className:Zw({type:u}),children:r}),p&&I(Yw,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&I(zw,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const Xw=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.1641 9.87903V14.125H0.835876V9.87903",strokeMiterlimit:10}),p.createElement("path",{d:"M7.49988 10.4883V0.1875",strokeMiterlimit:10}),p.createElement("path",{d:"M11.7395 6.85162L7.4999 11.0913L3.26025 6.85162",strokeMiterlimit:10})),"Download"),Jw=Ot({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}}}}),$w=Rt({position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"12px",borderRadius:"md",borderWidth:1,borderStyle:"solid",borderColor:"border.layout",backgroundColor:"surface.foreground",flexShrink:1}),eE=Rt({display:"flex",flexDirection:"column",gap:"4px",flex:1,minWidth:0}),tE=Rt({textDecoration:"none",color:"inherit",cursor:"pointer"});function nE({sentByCurrentUser:e,attachment:t}){const{fileName:n,fileSize:r,url:a}=t,o=gb();return I("div",{className:Jw({type:e?"sent":"received"}),children:I("div",{onClick:async()=>{if(o)window.open(a,"_self","noopener,noreferrer");else try{if(a){const e=await fetch(a),t=await e.blob(),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=n??"attachment",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}}catch(e){await wr({error:new Error("error while downloading attachment"),severity:"error",extraData:{error:e}}),window.open(a,"_blank","noopener,noreferrer")}},className:tE,children:N("div",{className:$w,children:[N("div",{className:eE,children:[I(kl,{children:n}),I(ya,{children:`${r}`})]}),I(Yc,{Component:Xw})]})})})}const rE=jt(null,Rt({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function aE({children:e}){return I("div",{...rE,children:e})}const oE=jt(null,Rt({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),iE=Rt({minHeight:1,width:"100%"}),lE=T(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},a){const o=g(null);t&&r?.current?.focus();const i=y(()=>{t&&Nn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){x(()=>{const r=e.current;if(null!==r){let e=r.scrollTop,a=Date.now();const o=()=>{if(t){const{scrollVelocity:t,currentScrollTop:o,currentTime:i}=function(e,t,n){const r=e.scrollTop,a=Date.now(),o=Math.abs(r-t),i=a-n;return{scrollVelocity:i>0?o/i:0,currentScrollTop:r,currentTime:a}}(r,e,a);t>5&&n(),e=o,a=i}};return r.addEventListener("scroll",o),()=>{r.removeEventListener("scroll",o)}}},[t,n,e])}(o,t,i),N("div",{tabIndex:-1,...oE,ref:o,children:[I("div",{className:iE,ref:a}),e]})}),sE=Object.freeze({message:{text:"",attachments:[]}});function cE(e){const t=0==e?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,t)).toFixed(2)+" "+["B","kB","MB","GB","TB"][t]}const dE=Rt({display:"flex",flex:"1 1 0",flexDirection:"row",justifyContent:"space-between",backgroundColor:"surface.foreground",borderWidth:"1px",borderStyle:"solid",borderColor:"border.layout",padding:"8px 16px",marginBottom:"8px"}),uE=Rt({display:"flex",flexDirection:"row",gap:"8px"}),hE=Rt({display:"grid",flexDirection:"column"});function pE({attachment:e,onRemove:t}){const n=(r=e).isPending?{text:"Uploading...",accent:"active"}:null===r.id?{text:"Failed to upload. Try uploading again.",intent:"danger"}:{text:cE(r.size)};var r;return N("div",{className:dE,children:[N("div",{className:uE,children:[I(Yc,{Component:ds}),N("div",{className:hE,children:[I(kl,{children:e.name}),I(ya,{intent:n.intent,accent:n.accent,children:n.text})]})]}),!e.isPending&&I(ns,{onClick:()=>t(e),children:I(Lo,{Component:Wl})})]})}const gE=Rt({width:"100%"});function mE({conversationId:e,addMessage:t,blockSubmit:n,isMobile:r,scrollRef:a,setActiveKeyboard:o,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:kg({defaultValues:t??sE,onSubmit:t=>{ju.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=g(null),d=y(e=>{s.setFieldValue("message",t=>({...t,attachments:[...t.attachments,...e.map(e=>({localId:e.localId,name:e.name,size:e.size,id:null,isPending:!0}))]}))},[s]),u=y(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.map(t=>e.find(e=>e.localId===t.localId)||t)}))},[s]),{mutate:h}=Rd({mutationFn:Vu,onSuccess:async()=>Bn.invalidateQueries({queryKey:["files/attachments"]})}),p=y(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.filter(t=>t.localId!==e.localId)})),null!==e.id&&h({id:e.id})},[s,h]);return I("form",{className:gE,ref:c,onKeyDown:e=>function(e,t,n,r){if(!r&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!n)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,n,r),onSubmit:e=>{if(!n)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:I(s.Subscribe,{selector:e=>e.values.message.attachments,children:e=>N(S,{children:[e.map(e=>I(pE,{attachment:e,onRemove:p},e.localId)),I(s.AppField,{name:"message",children:t=>I(t.MessageAreaInput,{blockSubmit:n,scrollRef:a,setActiveKeyboard:o,ref:i,onFileSelect:d,onUploadComplete:u,hideFileUpload:e.length>=5})})]})})})}function vE(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text??"",reactions:[],attachments:[]}}async function CE(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return Tr("mutation successful, invalidating messages queries"),Promise.all([Bn.invalidateQueries({queryKey:e}),Bn.invalidateQueries({queryKey:t}),Bn.invalidateQueries({queryKey:n})]).catch(e=>wr({error:e,severity:"error"}))}const bE=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>di({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),fE=async({data:e,accessToken:t,environment:n})=>di({data:{data:[e]},accessToken:t,environment:n}),yE=Rt({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),xE=Rt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),kE=Rt({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),TE="Marked As Resolved";function wE({resolver:e}){const t=e?`${e} ${TE}`:TE;return N("div",{className:xE,children:[I("div",{className:yE}),I("div",{className:kE,children:t}),I("div",{className:yE})]})}const EE=Ot({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function AE({width:e="md",height:t="md"}){return I(Ya,{styles:EE({width:e,height:t})})}const IE=Rt({display:"flex",flexDirection:"row-reverse"});function SE(){return N(S,{children:[I(AE,{width:"lg",height:"lg"}),I("div",{className:IE,children:I(AE,{width:"md",height:"lg"})}),I("div",{className:IE,children:I(AE,{width:"lg",height:"xl"})}),I(AE,{width:"md",height:"lg"})]})}const NE=Rt({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function PE({isConversationLoading:e,isFilling:t,message:n}){return e?n?I(aE,{children:I(Qw,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):null:!e&&t?I(aE,{children:I(SE,{})}):N("div",{className:NE,children:[I(ba,{textAlign:"center",wrap:"wrap",children:"Send your bookkeeper a message"}),I(kl,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const RE=jt(null,Rt({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",flexDirection:"column",position:"relative",backgroundColor:"surface.background",borderTop:"{borderWidths.lg} solid",borderTopColor:"border.layout",padding:"12px 15px"}));function ME({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:a=!1,attachedEntityId:o,defaultValues:i}){const{userId:l}=C(Eo),{mutate:s}=function(){const{userId:e}=C(Eo);return Rd({mutationFn:Yi,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const a=An(ji({id:e.conversationId}),t,n);await Bn.cancelQueries({queryKey:a});const o=Bn.getQueryData(a);return Bn.setQueryData(a,t=>[vE(e,r),...t]),{oldMessages:o}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:CE})}(),{query:{data:c},isFilling:d}=function(e){const t=Nn(e);return Wn({queryKey:ji({id:e??""}),queryFn:Ki,select:zi,enabled:t})}(e),{mutate:u,isPending:h,variables:p}=(T=t,w=o,Rd({mutationFn:fE,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(Sn(e)||Sn(t))return;T(t);const n=["conversations"],r=["banks/transactions",{}],a=["summaries",{}];let o=async()=>{},i=async()=>{};if(Nn(w)){const e={id:w};Wi(w,Vi.BANK_TRANSACTION)?o=async()=>{const t=Di(e);return await Bn.invalidateQueries({queryKey:t})}:Wi(w,Vi.FINANCIAL_SUMMARY)&&(i=async()=>await Bn.invalidateQueries({queryKey:a}))}return Tr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([Bn.invalidateQueries({queryKey:n}),Bn.invalidateQueries({queryKey:r}),o(),i()]).catch(e=>wr({error:e,severity:"error"}))}})),{mutate:m}=Rd({mutationFn:bE,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return Tr("mutation successful, invalidating conversations queries"),Promise.all([Bn.invalidateQueries({queryKey:e}),Bn.invalidateQueries({queryKey:t})]).catch(e=>wr({error:e,severity:"error"}))}}),[v,b]=f(!1),y=g(null),k=g(null);var T,w;x(()=>{n&&r&&e&&m({id:e,readStatus:"READ"})},[n,r,e,m]),x(()=>{Bu(k)},[c,k]);const E=Sn(e)||Sn(c)||d;return N(S,{children:[E?I(lE,{ref:k,inputRef:y,activeKeyboard:v,setActiveKeyboard:b,children:I(PE,{isConversationLoading:h,isFilling:d,message:p?.message?.text})}):N(lE,{ref:k,activeKeyboard:v,setActiveKeyboard:b,inputRef:y,children:[n&&I(wE,{resolver:"Conversation"}),c.map((t,n)=>{const r=t[0].author.userId===l;return I(aE,{children:t.map(t=>N(S,{children:[t.attachments.filter(e=>!Sn(e)).map(e=>I(nE,{sentByCurrentUser:r,attachment:e},e?.id)),t.text&&I(Qw,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id)]}))},n)})]}),I("div",{...RE,children:I(mE,{scrollRef:k,inputRef:y,conversationId:e,blockSubmit:h,isMobile:a,addMessage:({value:t})=>{const{text:n,attachments:r}=t.message,a=n.trim(),i=r.filter(e=>null!==e.id&&!e.isPending),l=i.map(e=>`att_${e.id}`),c=a.length>0,d=l.length>0;if(c||d)if(Sn(e)){let e="";c?e=a:d&&(e=i[0]?.name);const t=(h=a,p=e.slice(0,40),g=l,{subject:p,status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...Nn(m=o)&&{attachedEntityId:m},message:{text:h,...g.length>0&&{attachmentIds:g}}});u(t)}else s({conversationId:e,text:a,...d&&{attachmentIds:l}});var h,p,g,m},setActiveKeyboard:b,defaultValues:i})})]})}const DE=jt(Bt["drawer-header"],Rt({padding:"10px 25px 10px 15px"},XT));function LE({hideDivider:e=!1,children:t}){return N(S,{children:[I("div",{...DE,children:t}),!e&&I(Hp,{alignment:"horizontal",color:"normal"})]})}function OE({conversationId:e,attachedEntityId:t}){const[n,r]=f(e),{query:{data:a}}=ci(n),o="CLOSED"===a?.resolutionStatus;return N(Iw,{children:[I(LE,{}),I(ME,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t})]})}const FE=jt(Bt["form-body"],Rt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",minWidth:{base:0,sm:"512px"}}));function BE({children:e}){return I("div",{...FE,children:e})}function UE({active:e,icon:t,onClick:n,ariaLabel:r,popupTriggerProps:a}){return I(ns,{ariaLabel:r,onClick:n,active:e,popupTriggerProps:a,children:I(Ls,{Component:t})})}function VE({activeTab:e,onClick:t,popupTriggerProps:n}){return I(UE,{active:"conversation"===e,onClick:()=>t("conversation"),icon:$s,ariaLabel:"conversation-tab",popupTriggerProps:n})}const WE=Rt({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"});function HE({conversationId:e,attachedEntityId:t}){const n=Ul(),[r,a]=f(e),{query:{data:o}}=ci(r),i="CLOSED"===o?.resolutionStatus;return I(cy,{children:N("div",{className:WE,children:[I(LE,{children:N(Zx,{children:[I(Xx,{Icon:So,handleClose:()=>n.setOpen(!1)}),I(ba,{children:"Back"})]})}),I(ME,{conversationId:r,setConversationId:a,isResolved:i,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})})}const qE=jt(null,Rt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),jE=jt(null,Rt({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),zE=Rt({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),KE=e=>{su(e),cu(e)},YE=({children:e,onSubmit:t,Header:n,initialTab:r,conversationId:a,transactionId:o})=>{const i=gb(),[l,s]=f(r??null),c=e=>s(e===l?null:e);return I(Tw,{children:N("div",{...qE,children:[I(Iw,{children:N("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:KE,...jE,children:[n,I(BE,{children:e})]})}),null!==l&&I("div",{className:zE}),"conversation"===l&&I(OE,{conversationId:a,attachedEntityId:o}),I(Ew,{children:i?N(Bl,{children:[I(Vl,{children:e=>I(VE,{onClick:c,activeTab:l,popupTriggerProps:e})}),I(HE,{conversationId:a,attachedEntityId:o})]}):I(VE,{onClick:c,activeTab:l})})]})})},_E=jt(null,Rt({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function ZE({transaction:e,bankAccount:t}){const n=e?e.description:"",r=Sn(t)||Sn(e)?"":((e,t)=>{const n="BANK_TRANSFER"===t.type,r=Hd(t.amount);return`${n?`${r} `:""}${yd(e.name,e.mask)}`})(t,e);return N("div",{..._E,children:[I(ba,{wrap:"wrap",children:n}),t&&I(ya,{children:r})]})}const GE=h.object({id:h.string(),type:h.enum(Object.values(Rf)),reviewStatus:h.enum(Object.values(gC)),amount:h.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:h.string("Required").refine(e=>(function(e,t){const n=$t(e.getFullYear(),e.getMonth(),e.getDate()),r=$t(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||hn(new Date(e),/* @__PURE__ */new Date))&&gn(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),customer:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),frequency:h.union([h.object({name:h.string(),value:h.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),h.undefined()]),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()})),bankAccount:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}),notes:h.string().nullable()}),QE=GE.extend({children:h.array(h.object({amount:h.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()}))})),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"})}),XE=GE.extend({id:h.string(),type:h.literal(Object.values(Rf)),description:h.string(),displayName:h.string(),iconUrl:h.string().optional(),status:h.literal(Object.values(Lf)),reviewStatus:h.literal(Object.values(gC)),apiName:h.literal(Object.values({PLAID:"PLAID",UNIT:"UNIT",STRIPE:"STRIPE",SHOPIFY:"SHOPIFY",SQUARE:"SQUARE",RUTTER:"RUTTER",UBER:"UBER",MOOV:"MOOV",QUALPAY:"QUALPAY",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",QBO:"QBO",XERO:"XERO",BENCH:"BENCH",WAVE:"WAVE"})),apiSourceId:h.string().nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),customer:h.object({id:h.string(),name:h.string().optional(),email:h.string().optional()}).nullable(),vendor:h.object({id:h.string(),name:h.string().optional()}).nullable(),invoice:h.object({id:h.string(),name:h.string(),date:h.string(),lineItems:h.array(h.object({id:h.string(),amount:h.number()}))}).nullable(),bill:h.object({id:h.string(),name:h.string().optional()}).nullable(),payroll:h.object({id:h.string(),date:h.string().optional(),checkDate:h.string().optional(),description:h.string().optional()}).nullable(),apiItemId:h.string().nullable()});XE.extend({});const JE=QE.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);s(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),$E=QE.extend({reconciliationMatch:h.object({id:h.string(),description:h.string().optional(),amount:h.number().optional(),date:h.string().optional(),apiInstitutionId:h.string().nullable().optional(),apiName:h.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(e=>{const t=e.reconciliationMatch?.amount,n=e.amount;return!!Sn(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["reconciliationMatch"],when:e=>$E.pick({amount:!0,reconciliationMatch:!0}).safeParse(e.value).success});XE.extend({});const eA=QE.extend({});XE.extend({});const tA=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],nA=["FEDERAL","STATE","SALES"],rA=[{value:"FEDERAL",label:"Federal/Self-Employed Income Tax"},{value:"STATE",label:"State Income Tax"},{value:"SALES",label:"Sales Tax"}];function aA(e){if(!Sn(e))return rA.find(t=>t.value===e)?.label}const oA=h.object({tax:h.object({paymentInfo:h.object({region:h.enum(nA,{message:`Tax region must be one of: ${nA.join(", ")}`}),quarter:h.enum(["Q1","Q2","Q3","Q4"]).optional(),year:h.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${nA.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),iA=h.intersection(oA,QE);h.intersection(oA,XE);const lA={id:"",type:"EXPENSE",reviewStatus:"USER_REVIEW_REQUIRED",amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:Ni[0],notes:null,classSegments:[],children:[],reconciliationMatch:{id:"",description:"",amount:0,date:"",apiInstitutionId:"",apiName:void 0},tax:{paymentInfo:null}};function sA(e){const{mutate:t}=nC(),{query:{data:n}}=Vh(),r=e?{id:(a=e).id,type:a.type,reviewStatus:a.reviewStatus,amount:eh(a.amount),category:a.category,date:a.date,vendor:a.vendor,customer:a.customer,frequency:a.frequency,bankAccount:a.bankAccount,glAccount:a.glAccount,notes:a.notes,classSegments:a.classSegments,children:a.children.map(e=>({amount:eh(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),reconciliationMatch:a.reconciliationMatch,tax:a.tax}:lA;var a;return kg({defaultValues:r,validators:{onBlur:QE,onSubmit:({value:e})=>{const t=function(e){switch(e){case"EXPENSE":return JE;case"BANK_TRANSFER":return $E;case"REVENUE":return eA;case"TAX_PAYMENT":return iA;default:return}}(e.type);if(!t)return;const n=t.safeParse(e);if(!n.success){const e={};for(const t of n.error.issues){const n=t.path.join(".");e[n]||(e[n]={message:t.message})}return{fields:e}}}},onSubmit:r=>{if(!e)return;const a=function({payload:e,expenseCategories:t}){if("EXPENSE"===e.type){const n=t.find(t=>t.id===e.categoryId)?.accountId;return Sn(n)?e:{...e,glAccountId:Hi({id:n,prefix:"GL_ACCOUNT"})}}return e}({payload:function(e,t){const n={id:e,type:t.type,amount:t.amount?th(t.amount):0,date:t.date,bankAccountId:t.bankAccount.id,frequency:t.frequency?.value,notes:t.notes,classSegmentIds:t.classSegments.map(e=>e.id),children:t.children.map(e=>({amount:e.amount?th(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:t.classSegments.map(e=>e.id)}))};switch(t.type){case"EXPENSE":return{...n,vendorId:t.vendor?.id,customerId:t.customer?.id,categoryId:t.category?.id};case"REVENUE":return{...n,customerId:t.customer?.id,glAccountId:t.glAccount?.id};case"BANK_TRANSFER":return{...n,glAccountId:t.glAccount?.id,matchingBankTransactionId:t.reconciliationMatch?.id,reviewStatus:t.reviewStatus};case"TAX_PAYMENT":return{...n,tax:t.tax};default:return n}}(e.id,r.value),expenseCategories:n?.data??[]});t(a),r.formApi.reset(r.value,{keepDefaultValues:!0})},onSubmitInvalid:()=>{}})}function cA({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const a=Ul();return N(bh,{onClick:()=>{r&&a.close(),t()},children:[n&&I(Yc,{Component:n}),I(ba,{children:e})]})}function dA({transaction:e}){const{mutate:t}=tC(),n=()=>t(Ff([e]));return I(cA,{onClick:()=>{return e=n,void Cd({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:ld,label:"Cancel"},{key:sd,label:"Delete",type:vd}]}).then(t=>{t===sd&&e()});var e},children:"Delete"})}function uA({transaction:e}){const{mutate:t}=tC();return I(cA,{onClick:()=>{t([e].map(e=>({id:e.id,status:Lf.ACTIVE})))},children:"Restore"})}const hA=Tg({defaultValues:lA,render:function({form:e}){return I(cA,{onClick:()=>{or()},closeOnClick:!0,children:"Attach Bill(s)"})}}),pA=Tg({defaultValues:lA,render:function({form:e}){return I(cA,{onClick:()=>{or()},closeOnClick:!0,children:"Attach Payroll"})}}),gA=Tg({defaultValues:lA,render:function({form:e}){return I(cA,{onClick:()=>{or()},Icon:yb,closeOnClick:!0,children:"Attach Invoice(s)"})}}),mA=Ni.filter(e=>"ONE_TIME"!=e.value);function vA({onClick:e}){const t=Ul();return I(tp,{triggerChildren:I(ap,{displayLabel:"Make recurring"}),popupChildren:I(xg,{frequencies:mA,onClick:n=>{e(n),t.close()}})})}const CA=Tg({defaultValues:lA,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:n}){const r=ze(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),a=Ne(),o=!Sn(n)&&nh(n)&&"EXPENSE"===n.type;return N(LE,{children:[N(Zx,{children:[I(Xx,{}),I(ba,{children:t}),I(lk,{shouldUseButtonDiscreteStyles:!0,children:N(uh,{children:[n?.status===Lf.ACTIVE&&I(dA,{transaction:n}),n?.status===Lf.INACTIVE&&I(uA,{transaction:n}),r&&N(S,{children:["EXPENSE"===n?.type&&I(hA,{form:e}),"EXPENSE"===n?.type&&I(pA,{form:e}),"REVENUE"===n?.type&&I(gA,{form:e})]}),o&&I(e.Subscribe,{selector:e=>e.values.frequency,children:t=>{return a&&!(null!=(n=t)&&"ONE_TIME"!=n.value)&&I(vA,{onClick:t=>e.setFieldValue("frequency",t)});var n}})]})})]}),I(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:I(e.SaveButton,{})})]})}}),bA=[{value:"EXPENSE",label:"Expense"},{value:"REVENUE",label:"Income"},{value:"TAX_PAYMENT",label:"Tax Pmt"},{value:"BANK_TRANSFER",label:"Transfer"}],fA=Ot({base:{display:"flex",flexDirection:"column",position:"fixed",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",width:{base:"100%",sm:"562px"},minWidth:{base:"100%",sm:"fit-content"},backgroundColor:"surface.background"},variants:{status:{unmounted:{},initial:{animation:"slideIn.right"},open:{animation:"slideIn.right"},close:{animation:"slideOut.right"}}},defaultVariants:{status:"unmounted"}}),yA=Rt({display:"flex",padding:"16px 16px 45px 16px",flexDirection:"column",alignItems:"center",gap:"16px",flex:"1 1 0",alignSelf:"stretch",overflowY:"auto",width:"100%"});function xA({children:e,title:t}){const n=Ul(),{isMounted:r,status:a}=function(e){const{isMounted:t,status:n}=ve(e,{duration:300});return{isMounted:t,status:n}}(n.context),o=y(e=>{e.stopPropagation()},[]);return r?I(cy,{fadeIn:!1,forceMount:!0,children:N("div",{className:fA({status:a}),onAnimationEnd:o,children:[I(LE,{children:N(Zx,{children:[I(Xx,{Icon:So,handleClose:n.close}),I(ba,{children:t})]})}),I("div",{className:yA,children:e})]})}):null}const kA=Rt({display:"flex",alignItems:"center",gap:"9px",flex:"1 0 0"});function TA({text:e,handleClick:t,iconUrl:n,RightIcon:r,popupTriggerChildrenProps:a}){return I(hl,{onClick:t,stylists:[Ll],popupTriggerProps:a,children:N("div",{className:kA,children:[N("div",{className:kA,children:[n&&I("img",{src:n,alt:void 0,width:"15px",height:"15px"}),I(ba,{wrap:"wrap",children:e})]}),r&&I(Yc,{Component:r})]})})}const wA=Rt({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function EA({children:e}){return I("div",{className:wA,children:e})}const AA=Rt({padding:"0",height:{sm:"35px",base:"51px"},cursor:"default",border:0});function IA(){return I(Ya,{styles:Dt(Dl,AA)})}const SA=Rt({width:"70px",height:"24px"}),NA=Rt({display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"100%",gap:"16px"});function PA(){return N("div",{className:NA,children:[I(Ya,{styles:SA}),N(EA,{children:[I(IA,{}),I(IA,{}),I(IA,{})]}),I(Ya,{styles:SA}),N(EA,{children:[I(IA,{}),I(IA,{}),I(IA,{})]})]})}function RA({title:e,category:t,onClick:n,currentCategory:r}){return N(Bl,{children:[I(Vl,{children:e=>I(TA,{text:t.name??"",iconUrl:t.iconUrl,RightIcon:No,popupTriggerChildrenProps:e},t.id)}),I(xA,{title:e,children:I(_A,{listLabel:t.name??"",onClick:n,nestedCategories:t.children??[],type:"EXPENSE",currentCategory:r})})]})}function MA({onClick:e,showSuggestedCategories:t,listLabel:n,categories:r,isFilling:a,currentCategory:o}){const i=Pe();return a?I(PA,{}):N(EA,{children:[i&&t&&I(ba,{children:"Suggested"}),I(ba,{children:n}),I("div",{children:r?.map(t=>t.hasChilds?I(RA,{title:"All Categories",category:t,onClick:e,currentCategory:o},t.id):I(TA,{text:t.name??"",iconUrl:t.iconUrl,handleClick:()=>e(t),RightIcon:o?.id===t.id?yC:void 0},t.id))})]})}function DA(e){const t={};for(const{parent:n,child:r}of e){const e=n.id;n.id===r.id?t[e]={parent:n,children:[]}:t[e]?t[e].children.push(r):t[e]={parent:n,children:[r]}}return t}const LA=Rt({paddingTop:"50px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function OA({singularSearchCTANoun:e,pluralNounNotFound:t,showSearchCTA:n}){return N("div",{className:LA,children:[I(Yc,{Component:Ly}),I(ba,{wrap:"wrap",children:`No ${t} found`}),n&&I(ya,{wrap:"wrap",children:`Try searching for a different ${e}`})]})}const FA=Rt({display:"flex",flexDirection:"column",gap:"16px"}),BA=Rt({display:"flex",flexDirection:"column",gap:"8px"});function UA({searchTerm:e,onClick:t,categories:n,isFilling:r,currentCategory:a}){const o=m(()=>Le(n),[n]),i=m(()=>qh(o),[o]),l=m(()=>new Te(i??[],Zh),[i]),s=m(()=>i?DA(Qh(l.search(e),i)):{},[i,e,l]);return r?I(PA,{}):0===Object.keys(s).length?I(OA,{singularSearchCTANoun:"category",pluralNounNotFound:"categories",showSearchCTA:!0}):I(EA,{children:I("div",{className:FA,children:Object.entries(s).map(([e,{parent:n,children:r}])=>{const o=r.length>0;return N("div",{className:BA,children:[o&&I(ba,{children:n.name}),I("div",{children:o?r.map(e=>I(TA,{text:e.name??"",handleClick:()=>t(e),iconUrl:e.iconUrl,RightIcon:a?.id===e.id?yC:void 0},e.id)):I(TA,{text:n.name??"",handleClick:()=>t(n),iconUrl:n.iconUrl,RightIcon:a?.id===n.id?yC:void 0},e)})]},e)})})})}const VA=Rt({display:"flex",flexDirection:"column",justifyContent:"start",gap:"8px",width:"100%"}),WA=Rt({display:"flex",padding:"16px",flexDirection:"row",alignItems:"center",gap:"8px",flex:"1 0 0",borderRadius:"sm",border:"1px solid {colors.border.layout}",backgroundColor:"surface.foreground",maxHeight:"49px",minWidth:"fit-content"}),HA=Dt(Rt({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",border:"none",outline:"none",_placeholder:{color:"typography.label.sub"}}),Gt({label:"strongLabel"})),qA=jt(null,Rt({padding:0,outline:"none",border:"none",backgroundColor:"transparent"}));function jA({searchTerm:e,setSearchTerm:t,placeholder:n}){return N("div",{className:VA,children:[I(ba,{children:"Search"}),N("div",{className:WA,children:[I(Yc,{Component:_f}),I("input",{type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:HA}),Mn(e)&&I(hl,{stylists:[qA],onClick:()=>t(""),children:I(Yc,{Component:Wl})})]})]})}function zA({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o}){const[i,l]=f("");return I(hh,{searchTerm:i,setSearchTerm:l,onClick:t=>{e?.(t)},placeholder:t,SearchInput:jA,SearchList:n,DefaultList:r,extraProps:a,listLength:o})}const KA="Search expense categories...",YA=[];function _A({listLabel:e="All Expense Categories",onClick:t,showSuggestedCategories:n,nestedCategories:r,currentCategory:a}){const{query:{data:o,isFetched:i},isFilling:l}=Wh(),s=r??o?.data??YA,c=Ul();return I(zA,{placeholder:KA,onClick:e=>{t(e),c.close()},SearchList:UA,DefaultList:MA,listLength:s.length,extraProps:{categories:s,listLabel:e,isFetched:!!Sn(r)&&i,isFilling:!!Sn(r)&&l,showSuggestedCategories:n,currentCategory:a}})}function ZA({title:e,glAccount:t,onClick:n,currentGlAccount:r}){return N(Bl,{children:[I(Vl,{children:e=>I(TA,{text:t.name,RightIcon:No,popupTriggerChildrenProps:e},t.id)}),I(xA,{title:e,children:I(tI,{headerLabel:e,listLabel:t.name,nestedGlAccounts:t.children,parentAccount:t,onClick:n,type:"REVENUE",currentGlAccount:r})})]})}function GA({onClick:e,showSuggestedCategories:t,glAccounts:n,listLabel:r,isFilling:a,currentGlAccount:o}){const i=Pe(),l=kp([...n],xp);return a?I(PA,{}):N(EA,{children:[i&&t&&I(ba,{children:"Suggested"}),I(ba,{children:r}),I("div",{children:l?.map(t=>t.hasChilds?I(ZA,{glAccount:t,title:"All Categories",onClick:e,currentGlAccount:o},t.id):I(TA,{text:t.name,handleClick:()=>e(t),RightIcon:o?.id===t.id?yC:void 0},t.id))})]})}const QA=Rt({display:"flex",flexDirection:"column",gap:"16px"}),XA=Rt({display:"flex",flexDirection:"column",gap:"8px"});function JA({searchTerm:e,onClick:t,glAccounts:n,isFilling:r,parentAccount:a,currentGlAccount:o}){const i=m(()=>n.flatMap(e=>[e,...e.children]),[n]),l=m(()=>a?[a,...i]:i,[a,i]),s=kp(i,xp),c=m(()=>new Te(s,qv),[s]),d=m(()=>DA(zv(c.search(e),l)),[l,e,c]);return r?I(PA,{}):0===Object.keys(d).length?I(OA,{singularSearchCTANoun:"category",pluralNounNotFound:"income categories",showSearchCTA:!0}):I(EA,{children:I("div",{className:QA,children:Object.entries(d).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return N("div",{className:XA,children:[a&&I(ba,{children:n.name}),I("div",{children:a?r.map(e=>I(TA,{text:e.name,handleClick:()=>t(e),RightIcon:o?.id===e.id?yC:void 0},e.id)):I(TA,{text:n.name,handleClick:()=>t(n),RightIcon:o?.id===n.id?yC:void 0},e)})]},e)})})})}const $A="Search income categories...",eI=[];function tI({listLabel:e="All Income Categories",onClick:t,showSuggestedCategories:n,nestedGlAccounts:r,parentAccount:a,currentGlAccount:o}){const{query:{data:i,isFetched:l},isFilling:s}=gp(),c=r??i??eI,d=Ul();return I(zA,{placeholder:$A,onClick:e=>{t(e),d.close()},SearchList:JA,DefaultList:GA,listLength:c.length,extraProps:{glAccounts:c,listLabel:e,isFetched:l,isFilling:s,showSuggestedCategories:n,parentAccount:a,currentGlAccount:o}})}function nI({onClick:e,showSuggestedCategories:t,currentRegion:n}){const r=Pe(),a=Ul();return N(EA,{children:[r&&t&&I(ba,{children:"Suggested"}),I(ba,{children:"All Tax Categories"}),I("div",{children:rA.map(t=>I(TA,{text:t.label,handleClick:()=>(e(t.value),void a.close()),RightIcon:n===t.value?yC:void 0},t.value))})]})}function rI({onClick:e,onNeedsMatchClick:t,showSuggestedCategories:n,bankTransfers:r,holdingAccount:a,listLabel:o,isFetched:i,isFilling:l,currentTransfer:s}){const c=Pe(),d=!l&&i&&0===r.length;return l?I(PA,{}):N(EA,{children:[a&&I(TA,{text:"Needs Match",handleClick:t}),c&&n&&I(ba,{children:"Suggested"}),!d&&N(S,{children:[I(ba,{children:o}),I("div",{children:r?.map(t=>I(TA,{text:rh(t),handleClick:()=>e(t),RightIcon:s?.id===t.id?yC:void 0},t.id))})]})]})}const aI={keys:[{name:"description"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function oI({searchTerm:e,onClick:t,bankTransfers:n,isFilling:r,currentTransfer:a}){const o=m(()=>new Te(n??[],aI),[n]),i=m(()=>n?o.search(e).map(e=>e.item):[],[n,e,o]);return r?I(PA,{}):0===i.length?I(OA,{singularSearchCTANoun:"matching bank transaction",pluralNounNotFound:"matching bank transactions",showSearchCTA:!0}):I(EA,{children:I("div",{children:i.map(e=>I(TA,{text:rh(e),handleClick:()=>t(e),RightIcon:a?.id===e.id?yC:void 0},e.id))})})}const iI=[];function lI({listLabel:e="All Matching Bank Transactions",onClick:t,showSuggestedCategories:n,transactionId:r,transactionAmount:a,transactionDate:o,currentTransfer:i}){const{query:{data:l,isFetched:s},isFilling:c}=Oi(function(e,t,n){const r=bn(n);if(!r)throw new Error(`Invalid date string: ${n}`);return{filter:{status:{in:["ACTIVE"]},type:{in:["BANK_TRANSFER",t>0?"EXPENSE":"REVENUE"]},amount:{equal:-t},date:{greaterThanEqual:fn(En(r,-3)),lessThanEqual:fn(En(r,3))},bankAccount:{id:{notIn:[e]}},reconciliationMatch:{id:{equal:null}}}}}(r,a,o)),d=l?.data??iI,{query:{data:u}}=pp({select:e=>e.find(e=>"CLEARING_ACCOUNT"===e.assetType)}),h=Ul();return I(zA,{placeholder:"Search matching bank transfers...",onClick:e=>{t({transfer:e}),h.close()},SearchList:oI,DefaultList:rI,listLength:d.length??0,extraProps:{listLabel:e,bankTransfers:d,isFetched:s,isFilling:c,holdingAccount:u,showSuggestedCategories:n,transactionDate:o,onNeedsMatchClick:()=>{u&&t({glAccount:u}),h.close()},currentTransfer:i}})}const sI=Tg({defaultValues:lA,props:{},render:function({form:e,...t}){const{transactionType:n,onExpenseClick:r,onRevenueClick:a,onTaxPaymentClick:o,onBankTransferClick:i,transaction:l}=t;switch(n){case"EXPENSE":return I(e.Subscribe,{selector:e=>e.values.category,children:e=>I(_A,{...t,type:"EXPENSE",onClick:r,currentCategory:e})});case"REVENUE":return I(e.Subscribe,{selector:e=>e.values.glAccount,children:e=>I(tI,{...t,type:"REVENUE",onClick:a,currentGlAccount:e})});case"TAX_PAYMENT":return I(e.Subscribe,{selector:e=>e.values.tax?.paymentInfo?.region,children:e=>I(nI,{...t,type:"TAX_PAYMENT",onClick:o,currentRegion:e})});case"BANK_TRANSFER":return I(e.Subscribe,{selector:e=>e.values.reconciliationMatch,children:n=>I(lI,{...t,type:"BANK_TRANSFER",onClick:i,transaction:l,transactionId:l?.id??e.store.state.values.id,transactionAmount:l?.amount??0,transactionDate:l?.date??e.store.state.values.date,currentTransfer:n})})}}}),cI=Tg({defaultValues:lA,props:{},render:function({form:e,...t}){const{headerLabel:n="Back",initialType:r}=t,[a,o]=f(r);return N(xA,{title:n,children:[I(Ip,{rows:1,cols:4,options:bA,handleClick:e=>o(e.value),selected:(i=a,bA.find(e=>e.value===i))}),I(sI,{form:e,transactionType:a,onExpenseClick:t=>{e.setFieldValue("category",t),e.setFieldValue("type","EXPENSE")},onRevenueClick:t=>{e.setFieldValue("glAccount",t),e.setFieldValue("type","REVENUE")},onTaxPaymentClick:t=>{e.setFieldValue("tax.paymentInfo.region",t),e.setFieldValue("type","TAX_PAYMENT")},onBankTransferClick:({transfer:t,glAccount:n})=>{Nn(t)&&e.setFieldValue("reconciliationMatch",t),Nn(n)&&(e.setFieldValue("glAccount",n),e.setFieldValue("reviewStatus","RECONCILIATION_AWAITING")),e.setFieldValue("type","BANK_TRANSFER")},...t})]});var i}}),dI=Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),uI=Rt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}),hI=Tg({defaultValues:lA,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(e.AppField,{name:"category",children:e=>I(vu,{label:"Category",popupTriggerProps:t,children:N("button",{className:dI,type:"button",children:[N("div",{className:uI,children:[e.store.state.value&&I("img",{src:e.store.state.value.iconUrl,alt:void 0,width:"15px",height:"15px"}),I(ba,{wrap:"wrap",children:e.store.state.value?.name||"Uncategorized"})]}),I(Yc,{Component:No})]})})})}),I(cI,{initialType:"EXPENSE",form:e,transaction:t})]})}}),pI=Tg({defaultValues:lA,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const r=Ne();return N(S,{children:[I(e.AppField,{name:"vendor",children:e=>I(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:n})}),I(e.AppField,{name:"customer",children:e=>I(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:n})}),I(e.Subscribe,{selector:e=>e.values.frequency,children:a=>{return r&&n&&(o=t.type,void 0!==(i=a)&&"ONE_TIME"!==i.value&&"EXPENSE"===o)&&I(e.AppField,{name:"frequency",children:e=>I(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})});var o,i}}),I(hI,{form:e,transaction:t}),n&&I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})})]})}}),gI=Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),mI=Rt({display:"flex",gap:"8px",alignItems:"center"}),vI=Tg({defaultValues:lA,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(e.AppField,{name:"glAccount",children:e=>{const n=e.state.value;return I(vu,{label:"Account",popupTriggerProps:t,children:N("button",{className:gI,type:"button",children:[N("div",{className:mI,children:[I("img",{src:n.iconUrl,alt:void 0,width:"15px",height:"15px"}),I(ba,{children:n.name})]}),I(Yc,{Component:No})]})})}})}),I(cI,{initialType:"REVENUE",form:e,transaction:t})]})}}),CI=Tg({defaultValues:lA,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return N(S,{children:[I(e.AppField,{name:"customer",children:e=>I(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),I(vI,{form:e,transaction:t}),n&&I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})})]})}}),bI=jt(null,Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"})),fI=jt(null,Rt({color:"typography.base.weak"})),yI=Tg({defaultValues:lA,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(e.AppField,{name:"reconciliationMatch",children:e=>{const n=e.state.value,r=n?rh(n):"Select",a=n?[]:[fI];return I(vu,{label:"Matching Bank Transfer",popupTriggerProps:t,children:N("button",{...bI,children:[I(ba,{stylists:a,children:r}),I(Yc,{Component:No,stylists:a})]})})}})}),I(cI,{initialType:"BANK_TRANSFER",form:e,transaction:t})]})}}),xI=Tg({defaultValues:lA,props:{transaction:{}},render:function({form:e,transaction:t}){return N(S,{children:[I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})}),I(e.AppField,{name:"glAccount",children:e=>I(e.BankGlAccountField,{transaction:t})}),I(yI,{form:e,transaction:t})]})}}),kI=Rt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",height:{sm:"39px",base:"17px"},padding:0,cursor:"pointer"}),TI=Tg({defaultValues:lA,props:{},render:function({form:e,transaction:t}){return N(Bl,{placement:"bottom-start",children:[I(Vl,{children:t=>I(e.AppField,{name:"tax.paymentInfo.region",children:e=>I(vu,{label:"Category",popupTriggerProps:t,children:N("button",{className:kI,type:"button",children:[I(ba,{children:aA(e.state.value)??"Select region..."}),I(Yc,{Component:No})]})})})}),I(cI,{initialType:"TAX_PAYMENT",form:e,transaction:t})]})}}),wI=Tg({defaultValues:lA,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return N(S,{children:[I(TI,{form:e,transaction:t}),I(e.AppField,{name:"tax.paymentInfo.quarter",children:e=>I(e.ButtonGroupField,{label:"Quarter",options:tA})}),I(e.AppField,{name:"tax.paymentInfo.year",children:e=>I(e.GenericSelectorField,{label:"Year",options:un({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),n&&I(e.AppField,{name:"bankAccount",children:e=>I(e.ManualBankAccountField,{transaction:t})})]})}}),EI=Rt({display:"flex",flexDirection:"column",gap:"8px"}),AI=Tg({defaultValues:lA,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const{startPrefetch:r,cancelPrefetch:a}=zh();return I("div",{className:EI,onMouseEnter:r,onMouseLeave:a,children:I(e.Subscribe,{selector:e=>e.values.type,children:r=>{switch(r){case"EXPENSE":return I(pI,{form:e,transaction:t,isManual:n});case"REVENUE":return I(CI,{form:e,transaction:t,isManual:n});case"BANK_TRANSFER":return I(xI,{form:e,transaction:t});case"TAX_PAYMENT":return I(wI,{form:e,transaction:t,isManual:n});default:return null}}})})}}),II={EXPENSE:"Expense",REVENUE:"Income",BANK_TRANSFER:"Bank Transfer",TAX_PAYMENT:"Tax Payment",INVOICE_PAYMENT:"Invoice Payment",PAYOUT:"Payout",PAYROLL_PAYMENT:"Payroll Payment",BILL_PAYMENT:"Bill Payment",LOAN_PAYMENT:"Loan Payment"};function SI({transaction:e,form:t,bankAccount:n,isManual:r,conversationId:a,transactionId:o,initialTab:i,currentType:l}){const s=I(CA,{form:t,transaction:e,title:II[l]});return N(YE,{onSubmit:t.handleSubmit,Header:s,initialTab:i,conversationId:a,transactionId:o,children:[e.description&&I(ZE,{transaction:e,bankAccount:n}),I(t.AppField,{name:"amount",children:e=>I(r?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),I(t.AppField,{name:"date",children:e=>I(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:r})}),I(AI,{form:t,transaction:e,isManual:r}),I(t.AppField,{name:"notes",children:e=>I(e.TextAreaInput,{label:"Note"})}),I(t.AppField,{name:"type",children:()=>null})]})}function NI({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=function({transactionId:e}){const{query:{data:t,isFetching:n},isFilling:r}=Bi({id:e});return{transaction:t,form:sA(t),bankAccount:Ph(t?.bankAccount.id??""),isManual:!Sn(t)&&nh(t),isLoading:r||n&&!t}}({transactionId:e});if(i||!n)return null;const l=n?.conversation?.id??null;return I(r.Subscribe,{selector:e=>e.values.type,children:i=>I(SI,{transaction:n,form:r,bankAccount:a,isManual:o,conversationId:l,transactionId:e,initialTab:t,currentType:i})})}function PI({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=Bi({id:e});return x(()=>{!r&&Sn(n)&&Ai()},[n,r]),Sn(n)?null:I(NI,{transactionId:e,initialTab:t})}const RI={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},MI=(e={})=>{const t=kt(RI,e);return RI.transform(t,xt)},DI=e=>Rt(MI(e));DI.raw=MI;const LI={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},OI=(e={})=>{const t=kt(LI,e);return LI.transform(t,xt)},FI=e=>Rt(OI(e));function BI({subject:e,children:t}){return N(LE,{children:[N(Zx,{children:[I(Xx,{}),I(ba,{children:e})]}),I("div",{className:FI({alignItems:"center",gap:15}),children:t})]})}function UI({conversationId:e,defaultValues:t}){const[n,r]=f(e),{query:{data:a}}=ci(n),o="CLOSED"===a?.resolutionStatus;return I(Tw,{children:N(Iw,{children:[I(BI,{subject:a?.subject??"Conversation"}),I(ME,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,defaultValues:t})]})})}FI.raw=OI;const VI=Io(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_18201_5557)"},p.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_18201_5557"},p.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function WI({onClick:e,active:t}){return I(hl,{type:"button",onClick:e,active:t,children:I(Yc,{Component:VI})})}const HI=Rt({display:"flex",flexDirection:"column"});function qI({label:e,data:t,isFilling:n,shimmerWidth:r}){return N("div",{className:HI,children:[I(ya,{children:e}),n?I(AE,{width:r}):I(ba,{wrap:"wrap",children:t??""})]})}function jI({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=Bi({id:e}),a=Ph(n?.bankAccount.id??"");if(Sn(n))return null;const o=DI({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return N("div",{"data-open":t,className:o,children:[N("div",{className:FI({justifyContent:"space-between"}),children:[I(qI,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),I(qI,{label:"Amount",data:va(eh(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),I(qI,{label:"Bank Account",data:yd(a?.name??"",a?.mask??""),isFilling:r,shimmerWidth:"lg"}),I(qI,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function zI({conversationId:e,transactionId:t}){const[n,r]=f(e),[a,o]=f(!0),{query:{data:i}}=ci(n),l="CLOSED"===i?.resolutionStatus;return I(Tw,{children:N(Iw,{children:[I(BI,{subject:i?.subject??"Conversation",children:Nn(t)&&I(WI,{onClick:()=>o(!a),active:a},"infoButton")}),Nn(t)&&I(jI,{transactionId:t,isOpen:a}),I(ME,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function KI(){const e=ze(e=>e.drawerHistory).length>1;return I(Tw,{children:N(Iw,{background:"foreground",children:[I(LE,{children:N(Zx,{children:[I(Xx,e?{Icon:So}:{}),I(ba,{children:"Add New Connection"})]})}),I(YT,{})]})})}function YI(){return I(LE,{children:N(Zx,{children:[I(Xx,{}),I(ba,{children:"Financial Summary"})]})})}const _I=Rt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),ZI=Gt.raw({body:"default"}),GI=Rt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},ZI);function QI({summaryText:e}){return I("div",{className:_I,children:I("div",{className:GI,children:e})})}const XI=Rt({display:"flex",flexDirection:"column",overflow:"auto"});function JI({summary:e}){return N("div",{className:XI,children:[I(YI,{}),I(QI,{summaryText:e})]})}const $I=Rt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function eS({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return Wn({queryKey:Gi({id:e}),queryFn:Xi})}({id:e});return I(Tw,{children:N("div",{className:$I,children:[I(Iw,{children:I(JI,{summary:n?.summary})}),I(Hp,{}),I(OE,{conversationId:t??null,attachedEntityId:e})]})})}function tS(){return I(Tw,{children:I(Iw,{children:I(lw,{showCloseButton:!0,inOverlay:!0})})})}const nS=h.object({id:h.string(),name:h.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:h.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),type:h.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),rS={mergeDestination:Kp,selectedAccount:null};const aS=Rt({display:"flex",flexDirection:"column",gap:"20px"}),oS=Rt({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),iS=Rt.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),lS=Rt(iS,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),sS=Rt(iS,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),cS=Rt(iS,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),dS=Rt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),uS=Rt({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),hS=Rt({width:"100%",display:"flex",justifyContent:"flex-start"}),pS=Rt({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),gS=Rt({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),mS=e=>{su(e),cu(e)};function vS({account:e}){const t=Ul(),n=function(e,t){const{mutateAsync:n}=Bd();return kg({defaultValues:rS,onSubmit:async r=>{if(await zd()===sd&&Nn(e)&&Nn(r.value.selectedAccount)){const l=(a=e,o=r.value.mergeDestination,i=r.value.selectedAccount,o===Kp?{...qd(i),duplicateBankAccountIds:[qi(a.id)]}:{...qd(a),duplicateBankAccountIds:[qi(i.id)]});try{await n(l),t.close(),r.value.mergeDestination===Kp&&Ai()}catch{await Kd()}}var a,o,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:a}=Ad();if(!(r&&r.data||a))return null;const o=r?.data?.filter(t=>t.glAccountId&&t.isSupported&&t.id!==e?.id&&t.integration?.id!==e?.integration?.id);return N("form",{className:aS,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:mS,children:[I(ba,{children:"Merge Accounts"}),I("div",{className:oS,children:I(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>N(S,{children:[N("div",{className:lS,children:[I("div",{className:hS,children:I(ba,{children:"Duplicate Account"})}),t===Kp?I(Vp,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):I(n.AppField,{name:"selectedAccount",children:n=>I(_p,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:Zp(t,e,n.state.value)})})]}),N("div",{className:sS,children:[I("div",{className:pS,children:I(ba,{children:"Into"})}),I(n.AppField,{name:"mergeDestination",children:e=>I("div",{className:uS,children:I(hl,{onClick:()=>e.handleChange(e.state.value===Kp?zp:Kp),children:I(Yc,{Component:No})})})})]}),N("div",{className:cS,children:[I("div",{className:gS,children:I(ba,{children:"Destination Account"})}),t===Kp?I(n.AppField,{name:"selectedAccount",children:n=>I(_p,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:Zp(t,e,n.state.value)})}):I(Vp,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),N("div",{className:dS,children:[I(Eg,{showIcon:!1,onClick:()=>{t.close()}}),I(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>I(Xd,{disabled:Sn(e),showIcon:!1,textContent:"Merge"})})]})]})}function CS({bankAccount:e}){return I(uh,{children:N(Bl,{placement:"right-start",modal:!0,children:[I(Vl,{children:e=>N(bh,{...e,children:[I(Yc,{Component:bk}),I(ba,{children:"Merge Account"})]})}),I(cy,{children:I(hy,{children:I(gy,{children:I(vS,{account:e})})})})]})})}const bS=Rt({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"left",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discrete"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discrete.hover"}}}),fS=({tranStartDate:e})=>N(S,{children:[I(ya,{children:"Start Date"}),Mn(e)?I(ba,{children:`${wn(bn(e))}`}):I(ba,{children:"Set Start Date"})]});function yS({bankAccount:e}){return N(Bl,{placement:"right-start",modal:!0,children:[I(Vl,{children:t=>I("button",{className:Dt(bS,Ro),...t,type:"button",children:I(fS,{tranStartDate:e.tranStartDate})})}),I(cy,{children:I(hy,{children:I(gy,{width:"sm",children:I(mk,{bankAccounts:[e]})})})})]})}const xS=e=>["accounting/manualJournalEntry",e.id],kS=async e=>{const t=e.queryKey,n=t[2].accessToken,r=t[2].environment,a={path:"/accounting/manualJournalEntry?id={id}",pathParams:{id:t[1]},accessToken:n,environment:r};return await $o(a)};function TS({id:e}){return Wn({queryKey:xS({id:String(qi(e))}),queryFn:kS,enabled:Nn(e)})}const wS=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/accounting/manualJournalEntry",bodyParams:{manualJournalEntry:e},accessToken:t,endpointManager:Wr(n)};return await Or(r)})({data:e,accessToken:t,environment:n});const ES=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:Wr(n)};return await Or(r)},AS=h.object({amount:h.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:h.string("Required")}),IS=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===qi(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},SS=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=TS({id:t??null}),r=function(){const{query:{data:e}}=mp();return kp(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:a}=Rd({mutationFn:ES,onSuccess:async()=>{Tr("beginning balance mutation successful, invalidating bank account queries");try{return Bn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}}});const{mutate:o}=Rd({onSuccess:async()=>{Tr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([Bn.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),Bn.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&wr({error:e,severity:"error"})}},mutationFn:wS}),i=Ul(),l=((e,t)=>{const n=IS(e,t);return{amount:Nn(e.beginningBalanceData.journalEntry?.id)?n:"",date:Nn(t?.date)?t.date:""}})(e,n);return kg({defaultValues:l,validators:{onBlur:AS},onSubmit:l=>{if(i.close(),Sn(t)||Sn(n))a({bankAccountId:qi(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,a)=>{if(Sn(e.id))return null;const o={...e,id:e.id},i=a.map(e=>qi(e.id));let l=0;return o.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===qi(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),Sn(l)?null:(o.transactions?.forEach(e=>{i.includes(e.glAccountId)&&(e.drAmount?e.drAmount=Number(e.drAmount)-l:e.crAmount&&(e.crAmount=Number(e.crAmount)-l))}),o.date=fn(t)??o.date,o)})(n,bn(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);Nn(t)&&o(t)}}})},NS=Rt({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),PS=Rt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function RS({bankAccount:e}){const t=SS(e),n=Ul(),r=()=>{n.close()};return N("form",{className:NS,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[I(ba,{children:"Set Beginning Balance"}),I(t.AppField,{name:"date",children:e=>I(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),I(t.AppField,{name:"amount",children:e=>I(e.EditableAmountField,{label:"Beginning Balance Amount"})}),I(t.Subscribe,{selector:e=>e,children:e=>N("div",{className:PS,children:[I(Eg,{showIcon:!1,onClick:r}),I(Xd,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const MS=Ot({base:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"right",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discrete"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discrete.hover"}}},variants:{layout:{left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}}}}),DS=Rt({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function LS({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:a="left"}){const o=Dt(MS({layout:a}),Ro),i=Dt(MS({layout:"right"}),Ro),l=r&&wn(r);return N(Bl,{placement:"right-start",modal:!0,children:[I(Vl,{children:e=>N("div",{className:DS,children:[N("button",{className:o,...e,type:"button",children:[I(ya,{children:"Beginning Balance"}),I(ba,{children:Nn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&N("button",{className:i,...e,type:"button",children:[I(ya,{children:"Migration Date"}),I(ba,{children:l})]})]})}),I(cy,{children:I(hy,{children:I(gy,{width:"sm",children:I(RS,{bankAccount:e})})})})]})}const OS=Ot({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function FS({bankAccount:e,showStartDate:t}){const{query:{data:n}}=TS({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=IS(e,n),a=Nn(n?.date)?bn(n?.date):null,o=Nn(e.tranStartDate)?bn(e.tranStartDate):null,i=Nn(a)&&Nn(o)&&!hn(a,o),l=i?"left":t?"right":"left";return N("div",{className:OS({layout:i?"stacked":"inline"}),children:[t&&I(yS,{bankAccount:e}),I(LS,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:a})]})}const BS=Rt({marginTop:"15px",marginBottom:"15px"}),US={id:"",name:"",mask:"",type:void 0};const VS=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],WS=e=>{su(e),cu(e)};function HS({bankAccountId:e}){const t=Ph(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:US,[r,a]=f(n),o=function(e,t){const{mutate:n}=Bd(),{mutateAsync:r}=Fd({mutationFn:Dd}),a=Mn(String(e.id));return kg({defaultValues:e,validators:{onBlur:nS},onSubmit:async e=>{if(a)n(qd(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const n=await r((o=e.value,{apiAccountName:o.name,apiAccountNo:o.mask,apiAccountType:o.type||"DEPOSITORY",duplicateBankAccountIds:[]})),a={id:Hi({id:n?.dataObject?.id,prefix:"BANK_ACCOUNT"}),name:n?.dataObject?.apiAccountName??"",mask:n?.dataObject?.apiAccountNo??"",type:e.value.type};t(a),e.formApi.reset(a,{keepDefaultValues:!0})}var o},onSubmitInvalid:()=>{}})}(r,a),i=!t||Vd(t.apiName),l=!!t&&Wd(t.apiName),s=yd(r?.name??"",r?.mask??""),c=Mn(s)?s:"New Bank Account",d=l&&Nn(t?.tranStartDate),u=Nn(t)&&(d||!0);return I(Tw,{children:I(Iw,{children:N("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:WS,children:[N(LE,{children:[N(Zx,{children:[I(Xx,{Icon:So}),I(ba,{children:c}),Nn(t)&&I(lk,{shouldUseButtonDiscreteStyles:!0,children:I(CS,{bankAccount:t})})]}),I(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:I(o.SaveButton,{})})]}),N(BE,{children:[I(o.AppField,{name:"name",children:e=>I(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),I(o.AppField,{name:"mask",children:e=>I(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),I(o.AppField,{name:"type",children:e=>I(e.GenericSelectorField,{label:"Account Type",options:VS,disabled:!i})}),u&&N(S,{children:[I("div",{className:BS,children:I(Hp,{alignment:"horizontal"})}),I(FS,{bankAccount:t,showStartDate:d})]})]})]})})})}function qS(){return N(fw,{children:[I(xw,{name:"BankTransactionFormRouter",Component:PI}),I(xw,{name:"Conversation",Component:UI}),I(xw,{name:"MobileConversation",Component:zI}),I(xw,{name:"FinancialSummary",Component:eS}),I(xw,{name:"BanksAndIntegrations",Component:tS}),I(xw,{name:"BankAccountForm",Component:HS}),I(xw,{name:"NewConnection",Component:KI})]})}const jS=({environment:e,children:t})=>I(Un.Provider,{value:e,children:t});function zS({children:e}){const{query:{data:t}}=uf(),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?Hi({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName,clientId:t?.clientId,useStripeInvoicePaymentProcessing:t?.useStripeInvoicePaymentProcessing,hasPayroll:t?.hasPayroll,hasShopify:t?.hasShopify,hasSquare:t?.hasSquare,unitIntegrationBankName:t?.unitIntegrationBankName??null};return I(Eo.Provider,{value:n,children:e})}const KS=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const YS="SSE connection failed with status";function _S({companyId:e,customerPartnerId:t,sseTypes:n}){const r=Vn();x(()=>{if(!t)return;const a=new AbortController,o=function(e,t,n,r){const a=new URL(`${o=e,Vr[o]}/sse/v1/subscribe`);var o;return a.searchParams.append("customerPartnerId",n),t.forEach(e=>a.searchParams.append("events",e)),r&&a.searchParams.append("companyId",r),a.toString()}(r,n,t,e);let i=0;return Ae(o,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${YS} ${e.status}`)}(e),onmessage:a=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:a,companyId:o}){switch(e){case KS.CONNECTED:return void Tr("SSE connection established",{env:n,customerPartnerId:a,companyId:o,sseTypes:JSON.stringify(Array.from(r))});case KS.ERROR:throw wr({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case KS.CACHE_BUST:return Tr("cache bust event received",{sseTypes:JSON.stringify(Array.from(r))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{Bn.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>wr({error:e,severity:"error"}))},500*Math.random()),Tr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void wr({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:a.event,data:a.data,env:r,sseTypes:n,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw wr({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(YS))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:a.signal}).catch(e=>wr({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[r,t,e,n])}const ZS=[KS.CACHE_BUST];function GS({children:e}){const{companyId:t,customerPartnerId:n}=C(Eo);return _S({companyId:t,customerPartnerId:n,sseTypes:ZS}),e}const QS="undefined"!=typeof window?A:x,XS="undefined"==typeof window;const JS=({children:e})=>{const{width:t,height:n}=function(e={}){let{initializeWithValue:t=!0}=e;XS&&(t=!1);const[n,r]=f(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),a=Yf(r,e.debounceDelay,{leading:!0});function o(){(e.debounceDelay?a:r)({width:window.innerWidth,height:window.innerHeight})}return function(e,t,n,r){const a=g(t);QS(()=>{a.current=t},[t]),x(()=>{const t=window;if(!t||!t.addEventListener)return;const n=e=>{a.current(e)};return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}},[e,void 0,r])}("resize",o),QS(()=>{o()},[]),n}({debounceDelay:150}),r={dimensions:{width:t,height:n}};return I(JC.Provider,{value:r,children:e})};function $S({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return x(()=>{var e,r;e=n,r=t,br.setProperties(xr),yr=r,fr=e},[n,t]),I(jS,{environment:t,children:I(pw,{children:I(Dn.Provider,{value:r,children:I(zS,{children:I(GS,{children:N(JS,{children:[I(Ce.ConfirmationRoot,{}),e,I(qS,{})]})})})})})})}export{dw as BanksAndIntegrations,lf as BusinessOwnerDashboard,$S as Tight,Yx as TransactionsDashboard,tt as useOptions};
|
|
1
|
+
import{create as e}from"zustand";import{devtools as t,persist as n}from"zustand/middleware";import"zustand/react/shallow";import{cloneDeep as r,entries as o,mapValues as a,isEqual as i,differenceBy as l,isEmpty as s,debounce as c}from"lodash-es";import{v4 as d}from"uuid";import*as u from"zod";import{z as h}from"zod";import*as p from"react";import{useRef as g,useMemo as m,createContext as v,useContext as b,Component as f,useState as y,useCallback as x,useEffect as T,createElement as k,forwardRef as w,useImperativeHandle as C,useReducer as A,useLayoutEffect as E,Fragment as I}from"react";import{jsx as S,Fragment as N,jsxs as R}from"react/jsx-runtime";import{QueryClient as P,useIsRestoring as D,useQuery as L,keepPreviousData as M,useMutation as O,useQueries as F}from"@tanstack/react-query";import B from"yocto-queue";import U from"big.js";import{ResponsiveContainer as V,BarChart as W,Legend as H,CartesianGrid as q,XAxis as j,YAxis as z,Tooltip as _,Bar as K,ReferenceLine as Y,Line as Z}from"recharts";import{flexRender as X,createColumnHelper as Q,useReactTable as G,getCoreRowModel as J,getExpandedRowModel as $}from"@tanstack/react-table";import{useFloatingNodeId as ee,useFloating as te,offset as ne,flip as re,shift as oe,size as ae,autoUpdate as ie,useClick as le,useDismiss as se,useRole as ce,useInteractions as de,useFloatingParentNodeId as ue,FloatingTree as he,FloatingNode as pe,useMergeRefs as ge,FloatingOverlay as me,FloatingPortal as ve,FloatingFocusManager as be}from"@floating-ui/react";import{ContextAwareConfirmation as fe,confirmable as ye}from"react-confirm";import{createFormHookContexts as xe,useStore as Te,createFormHook as ke}from"@tanstack/react-form";import{NumericFormat as we}from"react-number-format";import Ce from"fuse.js";import{AnimatePresence as Ae,motion as Ee}from"motion/react";import{openDB as Ie}from"idb";import{PersistQueryClientProvider as Se}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ne}from"@microsoft/fetch-event-source";function Re(e,t){return`${e.trim()}:${t.trim()}`}const Pe=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_ATTACH_TO_GLSOURCE:!1,FEATUREFLAG_FREQUENCY_SELECTOR:!1,FEATUREFLAG_SUGGESTED_CATEGORIES:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,Re("featureFlags","updateFlags"))});function De(){return Bt(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}function Le(){return Bt(e=>e.FEATUREFLAG_SUGGESTED_CATEGORIES)}let Me=null,Oe=!1;function Fe(){const e=document.querySelector("meta[name='viewport']");if(!e)return null;const t=Object.fromEntries((e.getAttribute("content")??"").split(",").map(e=>{const[t,n=""]=e.trim().split("=");return[t.trim(),n.trim()]}));return{meta:e,params:t}}function Be(e,t){e.setAttribute("content",Object.entries(t).map(([e,t])=>t?`${e}=${t}`:e).join(", "))}function Ue(){const e=Fe();if(!e)return;const{meta:t,params:n}=e;if(Oe)return t.remove(),Oe=!1,void(Me=null);Me?n["interactive-widget"]=Me:delete n["interactive-widget"],Me=null,Be(t,n)}const Ve="drawerNavigation",We=(e,t)=>({drawerHistory:[],closingQueue:[],openDrawer:(t,n={})=>e(e=>{const{replaceHistory:o,routeProps:a}=n,i={[t]:{routeProps:a}};if(o||0===e.drawerHistory.length)return 0===e.drawerHistory.length&&function(){let e=Fe();if(!e){const t=document.createElement("meta");t.name="viewport",document.head.appendChild(t),Oe=!0,e={meta:t,params:{}}}const{meta:t,params:n}=e;Me=n["interactive-widget"]??null,n["interactive-widget"]="resizes-content",Be(t,n)}(),{drawerHistory:[i]};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t}}},void 0,Re(Ve,"openDrawer")),closeDrawer:()=>{e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1)}},void 0,Re(Ve,"closeDrawer")),0===t().drawerHistory.length&&Ue()},closeAllDrawers:()=>{e(()=>({drawerHistory:[]}),void 0,Re(Ve,"closeAllDrawers")),Ue()},requestCloseDrawer:()=>e(e=>{if(0===e.drawerHistory.length)return{};const t=e.drawerHistory,n=t.length-1,r=t[n];return{drawerHistory:t.slice(0,n),closingQueue:[...e.closingQueue,r]}},void 0,Re(Ve,"requestCloseDrawer")),requestCloseAllDrawers:()=>e(e=>{if(0===e.drawerHistory.length)return{};const t=e.drawerHistory,n=t[t.length-1];return{drawerHistory:[],closingQueue:[...e.closingQueue,n]}},void 0,Re(Ve,"requestCloseAllDrawers")),confirmCloseDrawer:()=>{e(e=>({closingQueue:e.closingQueue.slice(1)}),void 0,Re(Ve,"confirmCloseDrawer")),0===t().drawerHistory.length&&Ue()}}),He=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Re("externalOptions","setOptions"))});function qe(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function je(e){return Array.isArray(e)&&e.length>0}function ze(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:d()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}const _e="search",Ke=ze({key:_e,name:"Search"});function Ye(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Ze(e,t,n){return new Date(e,t,n)}function Xe(e){const[t,n,r]=e.split("-");return Ze(Number(t),Number(n),Number(r))}function Qe(){return Ye(Ze(/* @__PURE__ */(new Date).getFullYear()+1,0,0))}function Ge(e,t){return Ye(Ze(t,e,1))}function Je(){const e=/* @__PURE__ */new Date;return Ye(Ze(e.getFullYear(),e.getMonth()+1,0))}function $e(e){const t=/* @__PURE__ */new Date;return Ye(Ze(t.getFullYear(),t.getMonth()-e,1))}function et(e){const t=e.getMonth(),n=t-t%3;return Ye(Ze(e.getFullYear(),n,1))}function tt(e){const t=e.getMonth(),n=t-t%3+3;return Ye(Ze(e.getFullYear(),n,0))}const nt={ALL_TIME:"ALL_TIME",THIS_MONTH:"THIS_MONTH",LAST_MONTH:"LAST_MONTH",LAST_3_MONTHS:"LAST_3_MONTHS",LAST_12_MONTHS:"LAST_12_MONTHS",THIS_QUARTER:"THIS_QUARTER",LAST_QUARTER:"LAST_QUARTER",THIS_YEAR:"THIS_YEAR",LAST_YEAR:"LAST_YEAR"},rt={ALL_TIME:"All Time",THIS_MONTH:"This Month",LAST_MONTH:"Last Month",LAST_3_MONTHS:"Last 3 Months",LAST_12_MONTHS:"Last 12 Months",THIS_QUARTER:"This Quarter",LAST_QUARTER:"Last Quarter",THIS_YEAR:"This Year",LAST_YEAR:"Last Year"},ot=e=>Object.values(nt).includes(e),at={[nt.ALL_TIME]:()=>"",[nt.THIS_MONTH]:()=>function(){const e=/* @__PURE__ */new Date;return Ge(e.getMonth(),e.getFullYear())}(),[nt.LAST_YEAR]:()=>Ye(Ze(/* @__PURE__ */(new Date).getFullYear()-1,0,1)),[nt.LAST_MONTH]:()=>$e(1),[nt.LAST_12_MONTHS]:()=>function(){const e=/* @__PURE__ */new Date;return Ye(Ze(e.getFullYear(),e.getMonth()-11,1))}(),[nt.THIS_YEAR]:()=>Ye(Ze(/* @__PURE__ */(new Date).getFullYear(),0,1)),[nt.LAST_3_MONTHS]:()=>$e(2),[nt.LAST_QUARTER]:()=>function(){const e=/* @__PURE__ */new Date;return et(Ze(e.getFullYear(),e.getMonth()-3,1))}(),[nt.THIS_QUARTER]:()=>et(/* @__PURE__ */new Date)},it=e=>at[e](),lt={[nt.ALL_TIME]:()=>"",[nt.THIS_MONTH]:()=>Je(),[nt.LAST_YEAR]:()=>Ye(Ze(/* @__PURE__ */(new Date).getFullYear(),0,0)),[nt.LAST_MONTH]:()=>function(){const e=/* @__PURE__ */new Date;return Ye(Ze(e.getFullYear(),e.getMonth(),0))}(),[nt.LAST_12_MONTHS]:()=>Je(),[nt.THIS_YEAR]:()=>Qe(),[nt.LAST_3_MONTHS]:()=>Je(),[nt.LAST_QUARTER]:()=>function(){const e=/* @__PURE__ */new Date;return tt(Ze(e.getFullYear(),e.getMonth()-3,1))}(),[nt.THIS_QUARTER]:()=>tt(/* @__PURE__ */new Date)},st=e=>lt[e](),ct=e=>{return ot(e)?{beginDate:it(e),endDate:st(e)}:function(e){if("object"!=typeof e)return!1;const t=e;return"string"==typeof t.beginDate&&"string"==typeof t.endDate}(e)?e:{beginDate:Ye((t=e).beginDate),endDate:Ye(t.endDate)};var t},dt=["SUN","MON","TUE","WED","THU","FRI","SAT"],ut=["January","February","March","April","May","June","July","August","September","October","November","December"];function ht({yearsBack:e=10,startYear:t}){const n=t??/* @__PURE__ */(new Date).getFullYear(),r=[n];for(let o=n-1;o>=n-e;o--)r.push(o);return r}function pt(e,t){return e.toDateString()===t.toDateString()}function gt(e){return pt(e,/* @__PURE__ */new Date)}function mt(e,t){const n=Ze(e.getFullYear(),e.getMonth(),e.getDate()),r=Ze(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function vt(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function bt(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=Ze(n,e-1,t);return!(r.getFullYear()!==n||r.getMonth()!==e-1||r.getDate()!==t)}function ft(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,n,r,o]=t,a=parseInt(n,10),i=parseInt(r,10),l=parseInt(o,10);return bt(a,i,l)?Ze(l,a-1,i):null}function yt(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})/);if(!t)return null;const[,n,r,o]=t,a=parseInt(n,10),i=parseInt(r,10),l=parseInt(o,10);return bt(i,l,a)?Ze(a,i-1,l):null}function xt(e){if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getDate()).padStart(2,"0");return`${t}-${String(e.getMonth()+1).padStart(2,"0")}-${n}`}function Tt(e,t){return mt(e,t)?t:e}function kt(e,t){return mt(t,e)?t:e}const wt=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"},r=e.toLocaleString("default",n);let o=r;if(t.abbreviateYear){const e=r.length-2;o=r.slice(0,e)+"'"+r.slice(e)}return o},Ct=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return gt(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):wt(t,{abbreviateMonth:!0,abbreviateYear:!1})},At=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function Et(e,t){return Ze(e.getFullYear(),e.getMonth(),e.getDate()+t)}const It="date",St=Object.values(nt).map(e=>{return{name:rt[t=e],value:{date:{name:rt[t],value:t}}};var t}),Nt=ze({key:It,name:"Date",possibleValues:()=>({values:St}),singleSelect:!0,hideInFilterListOnDesktop:!0}),Rt="transactionsDashFilters";function Pt(e){if(0===e.length)return e;const t=function(e,t){if(0===e.length)return-1;let n=e.length-1;for(;n>-1;){if(t(e[n]))return n;n--}return-1}(e,e=>e.modelKey===_e);return-1===t?e:e.filter((e,n)=>n===t||e.modelKey!==_e)}const Dt=Nt.createFilter({name:rt[nt.LAST_12_MONTHS],value:{date:{name:rt[nt.LAST_12_MONTHS],value:nt.LAST_12_MONTHS}}}),Lt=e=>({transactionsDashFilters:[Dt],hasInitializedTransactionFilters:!1,addTransactionsDashFilters:t=>e(e=>{const n=t.find(e=>e.modelKey===It);let r=e.transactionsDashFilters;void 0!==n&&(r=function(e){const t=e.findIndex(e=>e.modelKey===It);return-1!==t?qe(e,t):e}(r));const o=Pt([...r,...t]);return{...e,transactionsDashFilters:o}},void 0,Re(Rt,"addFilter")),removeTransactionsDashFilter:t=>e(e=>{const n=e.transactionsDashFilters[t],r=n&&n.modelKey===It?function(e,t){const n=[...e];return n[t]=Dt,n}(e.transactionsDashFilters,t):qe(e.transactionsDashFilters,t);return{...e,transactionsDashFilters:r}},void 0,Re(Rt,"removeFilter")),setTransactionsDashFilters:t=>e(e=>{const n=t.some(e=>e.modelKey===It);let r=t;return n||(r=[...t,Dt]),{...e,transactionsDashFilters:Pt(r)}},void 0,Re(Rt,"setFilters")),initializeDefaultFilters:({userRole:t,hasNonReconciledTransactions:n})=>e(e=>{if(e.hasInitializedTransactionFilters)return e;const r=[];return"OWNER"===t&&n&&r.push({modelKey:"reviewStatus",id:d(),name:"Needs Review",value:{reviewStatus:{name:"Needs Review",value:{in:["USER_REVIEW_REQUIRED"]}}}}),r.push(Dt),{...e,transactionsDashFilters:r,hasInitializedTransactionFilters:!0}},void 0,Re(Rt,"initializeDefaultFilters"))}),Mt={label:"Connected Accounts",value:"connected"},Ot="banksAndIntegrationsState",Ft=e=>({banksAndIntegrationsSelectedTab:Mt,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Re(Ot,"setBanksAndIntegrationsSelectedTab")),toggleExpandedIntegration:(t,n)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||n&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,Re(Ot,"toggleExpandedIntegration"))}),Bt=e()(t(n((...e)=>({...Pe(...e),...We(...e),...He(...e),...Lt(...e),...Ft(...e)}),{name:"tight-featureflag-storage",partialize:e=>{const t=Object.entries(e).filter(([e])=>e.startsWith("FEATUREFLAG"));return Object.fromEntries(t)}}),{name:"globalStore",store:"globalStore",enabled:!1})),Ut={SELECT:"select",EXPAND:"expand"},Vt={...Ut,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},Wt=[Vt.COMMENTS,Vt.DATE,Vt.DESCRIPTION,Vt.AMOUNT,Vt.CATEGORY,Vt.CLASS_SEGMENT,Vt.REVIEW_STATUS],Ht=u.object({pageSize:u.optional(u.int32().positive()),columns:u.optional(u.array(u.enum(Wt)))}),qt=u.optional(u.string().trim()),jt=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,zt=u.optional(u.array(u.string().trim())),_t=u.object({integrations:u.optional(u.array(u.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"]))),useOnPlaidLink:u.optional(u.boolean()),hideManualBanks:u.optional(u.boolean())}),Kt={transactionsDashboard:e=>{const t=Ht.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=qt.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=zt.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>jt.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=_t.safeParse(e);return t.success?t.data:void 0}},Yt=(e,t)=>{if(void 0!==Kt[e])return(0,Kt[e])(t)};function Zt(e){const t=g(!1),n=Bt(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of o(e)){const e=Yt(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const a=Bt(e=>e.externalOptions);return{options:m(()=>r(a),[a]),setOptions:n}}function Xt(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function Qt(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function Gt(e){return String.fromCharCode(e+(e>25?39:97))}function Jt(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Gt(t%52)+n;return Gt(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var $t=/\s*!(important)?/i;function en(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var tn=e=>{const t=/* @__PURE__ */new Map;return(...n)=>{const r=JSON.stringify(n);if(t.has(r))return t.get(r);const o=e(...n);return t.set(r,o),o}},nn=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function rn(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(nn.has(n))return;const r=e[n],o=t[n];Xt(r)&&Xt(o)?e[n]=rn(r,o):e[n]=o}),e):e,{})}var on=e=>null!=e;function an(e,t,n={}){const{stop:r,getKey:o}=n;return function e(n,a=[]){if("object"==typeof(i=n)&&null!==i){const i={};for(const[l,s]of Object.entries(n)){const c=o?.(l,s)??l,d=[...a,c];if(r?.(n,d))return t(n,a);const u=e(s,d);on(u)&&(i[c]=u)}return i}var i;return t(n,a)}(e)}function ln(e,t,n=!0){const{utility:r,conditions:o}=t,{hasShorthand:a,resolveShorthand:i}=r;return an(e,e=>{return Array.isArray(e)?(t=e,n=o.breakpoints.keys,t.reduce((e,t,r)=>{const o=n[r];return null!=t&&(e[o]=t),e},{})):e;var t,n},{stop:e=>Array.isArray(e),getKey:n?e=>a?i(e):e:void 0})}var sn={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},cn=/([A-Z])/g,dn=/^ms-/,un=tn(e=>e.startsWith("--")?e:e.replace(cn,"-$1").replace(dn,"-ms-").toLowerCase()),hn=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),pn=`(?:${"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("|")})`,gn=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${pn}$`),mn={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):Xt(e)?an(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&hn.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&gn.test(e)},vn=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,Qt(t))};const bn=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,_supportHover,_notDisabled,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(",")),fn=/^@|&|&$/;function yn(e){return bn.has(e)||fn.test(e)}const xn=/^_/,Tn=/&|@/,kn=/* @__PURE__ */new Map;"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,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,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,WebkitTextFillColor:wktf-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(e=>{const[t,n]=e.split(":");kn.set(t,n)});const wn={conditions:{shift:function(e){return e.sort((e,t)=>{const n=yn(e),r=yn(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>bn.has(e)?e.replace(xn,""):Tn.test(e)?`[${en(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${kn.get(e)||un(e)}_${en(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Cn=function(e){const{utility:t,hash:n,conditions:r=sn}=e,o=e=>[t.prefix,e].filter(Boolean).join("-");return tn(({base:a,...i}={})=>{const l=ln(Object.assign(i,a),e),s=/* @__PURE__ */new Set;return an(l,(e,a)=>{if(null==e)return;const i="string"==typeof(u=e)&&$t.test(u),[l,...c]=r.shift(a),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace($t,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,a)=>{let i;if(n){const n=[...r.finalize(e),a];i=o(t.toHash(n,Jt))}else i=[...r.finalize(e),o(a)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(wn),An=(...e)=>Cn(En(...e));An.raw=(...e)=>En(...e);const{mergeCss:En}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>Xt(e)&&Object.keys(Qt(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>ln(t,e))}return{mergeCss:tn(function(...e){return rn(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(wn);function In(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Sn=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Nn(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:o}=Sn(e),a=e=>({...r,...Qt(e)});function i(e={}){const r=a(e);let i={...t};for(const[t,o]of Object.entries(r))n[t]?.[o]&&(i=En(i,n[t][o]));const l=function(e,t){let n={};return e.forEach(e=>{Object.entries(e).every(([e,n])=>"css"===e||(Array.isArray(n)?n:[n]).some(n=>t[e]===n))&&(n=En(n,e.css))}),n}(o,r);return En(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(tn(function(e){return An(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const a=Sn(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(n));return Nn({base:En(t,a.base),variants:Object.fromEntries(i.map(e=>[e,En(n[e],a.variants[e])])),defaultVariants:rn(r,a.defaultVariants),compoundVariants:[...o,...a.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),o=e=>{const t={};for(let r=0;r<e.length;r++){const o=e[r];n[o]&&(Object.defineProperty(t,o,n[o]),delete n[o])}return t};return t.map(e=>o(Array.isArray(e)?e:r.filter(e))).concat(o(r))}(e,l)},getVariantProps:a})}var Rn,Pn=((Rn=Pn||{}).component="component",Rn["dashboard-placeholder-table"]="dashboard-placeholder-table",Rn["dashboard-header"]="dashboard-header",Rn["dashboard-table"]="dashboard-table",Rn["dashboard-table-body"]="dashboard-table-body",Rn["dashboard-table-cell"]="dashboard-table-cell",Rn["dashboard-table-column-header"]="dashboard-table-column-header",Rn["dashboard-table-header"]="dashboard-table-header",Rn.label="label",Rn.popup="popup",Rn["popup-sort-row"]="popup-sort-row",Rn["progress-bar"]="progress-bar",Rn["progress-bar-fill"]="progress-bar-fill",Rn.summation="summation",Rn["table-parent-row"]="table-parent-row",Rn["table-row"]="table-row",Rn["table-sub-row"]="table-sub-row",Rn.tile="tile",Rn["tile-bar-label"]="tile-bar-label",Rn["tile-bar-label-outer"]="tile-bar-label-outer",Rn["tile-body"]="tile-body",Rn["tile-filter-button"]="tile-filter-button",Rn["tile-filter-list"]="tile-filter-list",Rn["tile-filter-row"]="tile-filter-row",Rn["tile-header"]="tile-header",Rn["tile-title"]="tile-title",Rn.title="title",Rn["business-owner-dashboard"]="business-owner-dashboard",Rn["business-owner-dashboard-header"]="business-owner-dashboard-header",Rn["business-owner-table"]="business-owner-table",Rn["transaction-type-label"]="transaction-type-label",Rn["transaction-date-cell-container"]="transaction-date-cell-container",Rn["selector-row"]="selector-row",Rn["popup-list"]="popup-list",Rn.badge="badge",Rn["badge-chip"]="badge-chip",Rn["date-cell"]="date-cell",Rn["expander-cell"]="expander-cell",Rn["vertical-divider"]="vertical-divider",Rn["horizontal-divider"]="horizontal-divider",Rn["table-cell-divider"]="table-cell-divider",Rn["checkbox-input"]="checkbox-input",Rn["bulk-select"]="bulk-select",Rn["button-base"]="button-base",Rn["button-discreet-small"]="button-discreet-small",Rn["button-primary"]="button-primary",Rn["button-secondary"]="button-secondary",Rn["button-tertiary"]="button-tertiary",Rn["button-danger"]="button-danger",Rn["button-warning"]="button-warning",Rn["button-action"]="button-action",Rn["button-table-header"]="button-table-header",Rn["button-inline"]="button-inline",Rn["small-square-button"]="small-square-button",Rn.card="card",Rn["card-button"]="card-button",Rn["card-button-icon"]="card-button-icon",Rn["pagination-button"]="pagination-button",Rn.text="text",Rn["cell-button"]="cell-button",Rn["selector-button"]="selector-button",Rn["review-status-selector-button"]="review-status-selector-button",Rn["review-status-dropdown-arrow"]="review-status-dropdown-arrow",Rn["financial-summary-layout"]="financial-summary-layout",Rn["financial-summary-chatbox"]="financial-summary-chatbox",Rn["financial-summary-chatbox-header"]="financial-summary-chatbox-header",Rn["month-picker"]="month-picker",Rn["month-picker-left-button"]="month-picker-left-button",Rn["month-picker-right-button"]="month-picker-right-button",Rn["month-picker-label"]="month-picker-label",Rn["filter-bar"]="filter-bar",Rn["filter-search-bar"]="filter-search-bar",Rn["filter-pill"]="filter-pill",Rn["discreet-form-input"]="discreet-form-input",Rn["editable-form-input"]="editable-form-input",Rn["category-text"]="category-text",Rn["amount-input-container"]="amount-input-container",Rn["amount-input"]="amount-input",Rn["modal-popup"]="modal-popup",Rn["drawer-header"]="drawer-header",Rn["drawer-header-border"]="drawer-header-border",Rn["form-body"]="form-body",Rn.body="body",Rn.heading="heading",Rn["sub-label"]="sub-label",Rn["strong-label"]="strong-label",Rn["strong-sub-label"]="strong-sub-label",Rn["metric-xl"]="metric-xl",Rn["metric-md"]="metric-md",Rn["large-icon"]="large-icon",Rn["medium-icon"]="medium-icon",Rn["small-icon"]="small-icon",Rn["tiny-icon"]="tiny-icon",Rn["x-large-icon"]="x-large-icon",Rn["xx-large-icon"]="xx-large-icon",Rn["card-header"]="card-header",Rn.icon="icon",Rn["neutral-badge"]="neutral-badge",Rn["highlight-badge"]="highlight-badge",Rn["success-badge"]="success-badge",Rn["warning-badge"]="warning-badge",Rn["critical-badge"]="critical-badge",Rn["button-group"]="button-group",Rn["alert-dialog"]="alert-dialog",Rn["alert-header"]="alert-header",Rn["emphasis-label"]="emphasis-label",Rn["profit-loss-graph"]="profit-loss-graph",Rn.banner="banner",Rn["banner-high"]="banner-high",Rn["banner-medium"]="banner-medium",Rn["banner-low"]="banner-low",Rn["banner-urgent"]="banner-urgent",Rn["banner-default"]="banner-default",Rn["banner-button"]="banner-button",Rn["banner-button-text"]="banner-button-text",Rn["banner-button-icon"]="banner-button-icon",Rn["banner-icon"]="banner-icon",Rn["banner-title"]="banner-title",Rn["empty-dashboard-layout"]="empty-dashboard-layout",Rn["zero-state-layout"]="zero-state-layout",Rn["emphasis-sub-label"]="emphasis-sub-label",Rn["nav-button"]="nav-button",Rn["bar-transactions-positive"]="bar-transactions-positive",Rn["bar-transactions-negative"]="bar-transactions-negative",Rn["message-sent"]="message-sent",Rn["message-received"]="message-received",Rn);const Dn="Tight-",Ln=e=>`${Dn}${e}`;function Mn(e){return e in Pn}function On(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Dn&&r in Pn}function Fn(e){return!Mn(e)&&!On(e)}const Bn=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Ln(e)),t.forEach(e=>{void 0!==e&&(Fn(e)?r.push(e):Mn(e)&&n.push(Ln(e)))}),{className:In(...n,...r)}},Un=Bn(Pn["business-owner-dashboard-header"],An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"80px",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function Vn({children:e}){return S("div",{...Un,children:e})}function Wn(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(On(t)&&e.push(t),e),[])],[])}function Hn(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Fn(t)&&e.push(t),e),[])],[])}function qn(e){const t=Array.isArray(e)?e:[e];return{className:In(...Wn(t),...Hn(t))}}const jn=Nn({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{xl:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{xl:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{xl:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{xl:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontSize:"lg",fontWeight:"sm",lineHeight:"18px",xl:{fontWeight:"label.strong",fontSize:"label.strong",lineHeight:"16px"},fontFamily:"label",color:"typography.label.strong",letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{xl:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{xl:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:{xl:"heading",base:"lg"},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"}}}}),zn=Bn(Pn.heading,jn({heading:"default"}));function _n({children:e,stylists:t=[]}){const n=qn([zn,...t]);return S("div",{...n,children:e})}function Kn(e,t,n){return[...e,{accessToken:t,environment:n}]}function Yn(e,t){return[...e,t]}const Zn=e=>null==e,Xn=e=>!Zn(e);function Qn(e){return""===e.trim()}function Gn(e){return Zn(e)||Qn(e)}function Jn(e){return!Gn(e)}const $n=v({activeToken:void 0,accountantToken:void 0});function er(){const{activeToken:e}=b($n);return e}const tr=()=>{throw new Error("No access token provided")},nr=72e5,rr=new P({defaultOptions:{queries:{gcTime:nr,staleTime:3e4,refetchInterval:6e4}}}),or=v("SANDBOX");function ar(){return b(or)}function ir({queryKey:e,queryFn:t,...n}){const r=er(),o=ar(),a=Jn(r),i=Kn(e,r??"",o),l=D(),s=L({...n,queryKey:i,queryFn:a?t:tr,placeholderData:n.keepPreviousDataPlaceholder?M:void 0,...a?{}:{retry:!1,staleTime:1/0}},rr);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class lr{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:n,payloadVersion:r}){const o=/* @__PURE__ */(new Date).toISOString(),a=JSON.stringify({apiKey:e,payloadVersion:r,notifier:n,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":r,"Bugsnag-Sent-At":o},referrerPolicy:"no-referrer",body:a})}}const sr=Symbol("Circular"),cr=Symbol("AccessError");function dr(e,t,n){return ur({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function ur({key:e,value:t,replacer:n,seen:r,depthLimit:o=1/0,depth:a,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(r.includes(s)&&(s=sr),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=hr(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(a>o||i+1>l)return"[...]";if(r.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=hr(()=>s[i]);e.push(ur({key:i,value:t,replacer:n,seen:r,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=hr(()=>s[c]);e[c]=ur({key:c,value:d,replacer:n,seen:r,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function hr(e){try{return e()}catch{return cr}}const pr=Object.prototype.toString,gr=Object.getPrototypeOf;function mr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const vr=/^\s*at .*(\S+:\d+|\(native\))/m,br=/^(eval@)?(\[native code])?$/;function fr(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const n=t[2]?parseInt(t[2],10):void 0,r=t[3]?parseInt(t[3],10):void 0;return[t[1],n,r]}function yr(e,t){const n=xr(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&mr(n.metadata)&&(r={...r,[n.name]:n.metadata});const o=[Tr(n)];return o.push(...Cr(n).map(e=>Tr(e,{backtrace:!1}))),{exceptions:o,metadata:r}}function xr(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===pr.call(t))return!0;t=gr(t)}return!1}(e))return e;let n=function(e){if(!mr(e))return null;const t=t=>{const n=e[t];if("string"==typeof n&&e[t.length])return n},n=t("name")||t("errorClass"),r=t("message")||t("errorMessage");if(!n||!r)return null;const o=new Error(r);return o.name=n,o}(e);if(n)return n;switch(typeof n){case"string":case"number":case"boolean":return new Error(String(e));default:return n=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),n.name="InvalidError",n}}function Tr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:kr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function kr(e,{backtrace:t}){const n=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return n?function(e){return(e.match(vr)?e.split("\n").filter(e=>!!e.match(vr)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=fr(n?n[1]:r.pop()||"(no location)"),a=r.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0],lineNumber:o[1],columnNumber:o[2],method:a}}):(t=e,t.split("\n").filter(e=>!e.match(br)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=fr(e.replace(t,""));return{file:o[0],lineNumber:o[1],columnNumber:o[2],method:r}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let n=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";n=n.replace(/\?.*$/,"").replace(/#.*$/,"");let r=t.method||"(unknown function)";return r=/^global code$/i.test(r)?"global code":r,e.concat([{file:n,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:r}])},[]);var t}(n):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<wr;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const wr=20;function Cr(e){const t=e;if(t.cause){const e=xr(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Cr(e))}return[]}function Ar(...e){console.log}function Er(...e){console.error}const Ir={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let Sr=Date.now();const Nr=()=>{Sr=Date.now()},Rr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-Sr,!0}),{reset:Nr})},Pr=[["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\)$/]],Dr=[["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/]],Lr=(Mr=function(e){const t=""!==(n=e)&&Pr.reduce((e,[t,r])=>{if(e)return e;const o=r.exec(n);return!!o&&[t,o]},!1);var n;if(!t)return{};const[r,o]=t,a=function(e){for(const[t,n,r]of Dr)if(r.exec(e))return{osName:t,osVersion:n};return null}(e),i="iOS"===a?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:r,browserVersion:o[1],osName:a?.osName,osVersion:a?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...Mr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var Mr;class Or{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new B}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class Fr extends f{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:n,metadata:r}=yr(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let n="";for(let r=0,o=t.length;r<o;r++)t[r].length&&(n+=`${n.length?"\n":""}${t[r]}`);return n}(t.componentStack));const{onError:o,client:a}=this.props;a.notifyEvent({exceptions:n,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...r,react:t},onError:o},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return S(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return S(N,{children:this.props.children})}}const Br={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>S(Fr,{client:e,onError:t,FallbackComponent:n,children:r})})},Ur=new class{breadcrumbs=[];config;delivery=new lr(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return Er(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const n of this.config.plugins||[])this.plugins.push({name:n.name||"unknown",plugin:n.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:n,metadata:r}=yr(e,"notify");let o,a,i=r;return"function"==typeof t?o=t:(a=t.severity,t.metadata&&(i={...r,...t.metadata})),this.notifyEvent({exceptions:n,metadata:i,severity:a,onError:o},e)}leaveBreadcrumb(e,t,n){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:n||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:r=25}=this.config;this.breadcrumbs.length>r&&this.breadcrumbs.splice(0,this.breadcrumbs.length-r)}async notifyEvent({exceptions:e,unhandled:t,severity:n,severityReason:r,metadata:o,onError:a},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:n||"warning",severityReason:r,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:o||{}},c=[...this.errorCallbacks];a&&c.push(a);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=dr(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={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:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){Er()}}getUser(){return this.config?.user||{}}setUser(e,t,n){this.config&&(this.config.user={id:e,email:t,name:n})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let Vr="",Wr="";const Hr="prod",qr=Ur.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"6.1.0",appType:"browser",releaseStage:Hr,plugins:[Rr,Lr,Ir,(()=>{const e=new Or(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),Br]}),jr=(e,t)=>{try{Ur.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?zr({error:n,severity:"error"}):zr({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},zr=async e=>{try{await Ur.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:Vr,environment:Wr}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await zr({error:t,severity:"error"}):await zr({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},_r=qr.getPlugin("react"),Kr=_r?.BugsnagErrorBoundary,Yr=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,Zr=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},Xr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},Qr={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function Gr(e){const t=(({accessToken:e,extraHeaders:t})=>{const n={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...a(t,e=>`${e}`),...n}:n})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?Qr:{}}});return{url:(n=e.endpointManager.getUrl(e.path),r=e.pathParams,void 0!==r&&Object.entries(r).forEach(([e,t])=>{n=n.replace(`{${e}}`,t)}),n),headers:t};var n,r}async function Jr({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:o,url:a}){const i=Zr({extraHeaders:t,authorization:e});jr("HTTP POST Request",{url:a,accessToken:e});try{const e=await fetch(a,{method:r,headers:i,credentials:"include",body:JSON.stringify(o)});return jr("HTTP POST Response",{url:a,status:e.status,statusText:e.statusText}),Xr(e)}catch(l){return Promise.reject(l)}}async function $r(e){const{url:t,headers:n}=Gr(e);return Jr({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function eo(e){return $r(e)}async function to(e){return $r(e)}const no=(e,t)=>({getUrl:t=>((e,t)=>{let n=t;for(;n.length>0&&"/"===n.charAt(0);)n=n.slice(1);return`${e}/${n}`})(e,t),baseUrl:e,apiVersion:t}),ro={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest",DEVELOPMENT_RC:"https://dev.hurdlr.com/rest",SANDBOX_RC:"https://sandbox.hurdlr.com/rest",PRODUCTION_RC:"https://prod.hurdlr.com/rest"},oo={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080",DEVELOPMENT_RC:"https://qa.dev.tight.com",SANDBOX_RC:"https://qa.sandbox.tight.com",PRODUCTION_RC:"https://qa.prod.tight.com"},ao={...oo,LOCAL:"http://localhost:8082"};function io(e){return no(`${t=e,ro[t]}/v5`,"v5");var t}const lo=({filter:e,grouping:t,accountingMethod:n})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t},accountingMethod:n}],so=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,o=t[2].environment,a={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...ct(n.filter),...n.grouping&&{grouping:n.grouping},accountingMethod:n.accountingMethod},accessToken:r,endpointManager:io(o)};return await to(a)};function co({filter:e,grouping:t,select:n,accountingMethod:r}){return ir({queryKey:lo({filter:e,grouping:t,accountingMethod:r}),queryFn:so,select:n})}const uo="noDataHeight";function ho(e){const t=yt(e??"");return null!==t?wt(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}function po(e){const t=ho(e.period?.beginDate),n=e.netIncome??0,{profit:r,remainingIncome:o,loss:a,remainingExpenses:i}=function(e,t,n){const r=e>0?e:0,o=e<0?e:0;return{profit:r,remainingIncome:void 0!==t?U(t).minus(r).toNumber():0,loss:o,remainingExpenses:void 0!==n?U(n).plus(o).toNumber():0}}(n,e.income?.total,e.expenses?.total);return{month:{month:t,income:o,expenses:-i,profit:r,loss:a,netIncome:n,hasNoData:/* @__PURE__ */function(e,t,n){return 0===e&&0===t&&0===n}(n,o,i)},netIncome:n}}function go(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(Zn(n))return t;for(const i of n){const{month:e,netIncome:n}=po(i);t.total=U(n).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:r,domainMax:o}=n.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[r,o],t.hasAnyData=t.months.some(e=>!e.hasNoData);const a=function(e,t){const n=t-e;return n>0?.03*n:3}(r,o);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:a}:e),t}const mo=Bn(Pn["tile-header"],An({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function vo({title:e}){return S("div",{...mo,children:S(_n,{children:e})})}const bo=Bn(Pn["tile-body"],An({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}",borderBottomRadius:"lg",borderTop:"hidden"}));function fo({children:e}){return S("div",{...bo,children:e})}const yo=Nn({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative",borderRadius:"lg"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function xo({children:e,type:t,isSample:n=!1}){const r=Bn(Pn.tile,yo({type:t,isSample:n}));return S("div",{...r,children:e})}const To=An({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),ko=An.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),wo=An({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),Co=Bn(Pn.text,An({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To);function Ao({children:e}){return S("div",{...Co,children:e})}const Eo=Bn(Pn["metric-xl"],jn({metric:"xl"}));function Io(e){return S("div",{...Eo,children:e.children})}const So=Bn(Pn.summation,An({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function No({title:e,label:t}){return R("div",{...So,children:[S(Io,{children:e}),S(Ao,{children:t})]})}const Ro=Bn(null,An({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function Po({children:e}){return S("div",{...Ro,children:e})}const Do=(e,t=0)=>{const n=Math.abs(e);let r;if(t<=0)r=Math.round(n);else{const e=n.toFixed(t);r=parseFloat(e)}return Math.sign(e)*r},Lo=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),Mo=1e9;function Oo(e,{cents:t="default",condense:n=!1,dollarSign:r=!1,signage:o="default"}={}){const a="string"==typeof e?parseFloat(e):e;if(Number.isNaN(a))return"";let i;const l=Math.abs(a);let s;if(n&&l>99999){s=Math.sign(a)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),n=Math.round(l/t),r=n*t;let o,c=n/1e3;l<Mo&&c>=1e3&&(c/=1e3),r>=Mo?o="B":r>=1e6?o="M":(c=Math.round(c),o="K"),i=`${Lo(c,0,1)}${o}`}else{let e;const n=2,r=0;let o,l;"floor"===t?(o=r,l=r,c=a,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(o=r,l=r,e=Do(a,o)):"always"===t?(o=n,l=n,e=Do(a,o)):"default"===t&&Math.abs(a)>=1e3?(o=r,l=r,e=Do(a,o)):(o=n,e=Do(a,o),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=Lo(d,l,o)}var c,d;let u=i;const h=r?"$":"";return void 0===o||"off"===o?u=i:"parens"===o?u=`${h}${s?`(${i})`:i}`:"always"===o?u=`${s?"-":"+"}${h}${i}`:"default"===o&&(u=`${s?"-":""}${h}${i}`),u}function Fo(e){return Oo(e,{condense:!0,dollarSign:!0})}function Bo(e){return Oo(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const Uo=Nn({variants:{wrap:{ellipsis:ko,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function Vo({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(Gn(n))return null;const o=qn([Bn(Pn["strong-label"],Pn.text,jn({label:"strongLabel"}),Uo({wrap:e,textAlign:t})),...r]);return S("div",{title:"ellipsis"===e?n:void 0,...o,children:n})}const Wo=Nn({base:{fontWeight:"label.sub",fontSize:"md",fontFamily:"label",lineHeight:"16px",letterSpacing:"0.66px",fontStyle:"normal",xl:{lineHeight:"14px",fontSize:"label.sub"}},variants:{intent:{weak:{color:"typography.base.weak"},normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:ko,wrap:{whiteSpace:"normal",overflowWrap:"break-word"},wrapTwice:{ellipsisTextRaw:ko,whiteSpace:"normal",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical"}}}});function Ho({intent:e,wrap:t="ellipsis",children:n,accent:r}){const o=void 0===e&&void 0===r?"normal":e,a=Bn(Pn["sub-label"],Pn.text,Wo({intent:o,wrap:t,accent:r}),To);return Gn(n)?null:S("div",{...a,children:n})}const qo=Bn(null,An({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"}));function jo({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===uo)return null;let n=t[0].value??0;return"expenses"===t[0].dataKey?n+=t[0].payload.loss:"income"===t[0].dataKey&&(n+=t[0].payload.profit),R("div",{...qo,children:[S(Vo,{children:t[0].name??""}),S(Ho,{children:Fo(Number(n))})]})}const zo={"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.blue200":{value:"#EDFAFC",variable:"var(--Tight-colors-blue200)"},"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.green200":{value:"#DBF9EA",variable:"var(--Tight-colors-green200)"},"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.yellow200":{value:"#FFF3C3",variable:"var(--Tight-colors-yellow200)"},"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.red200":{value:"#FFCBCB",variable:"var(--Tight-colors-red200)"},"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:"12px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"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:"1px",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)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(0, 0, 0, 0.05), 0px 4px 12px 0px rgba(0, 0, 0, 0.15) ",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.opaque":{value:"var(--Tight-colors-blue200)",variable:"var(--Tight-colors-brand-action-opaque)"},"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.opaque":{value:"var(--Tight-colors-green200)",variable:"var(--Tight-colors-brand-success-opaque)"},"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.opaque":{value:"var(--Tight-colors-yellow200)",variable:"var(--Tight-colors-brand-warning-opaque)"},"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.opaque":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-brand-danger-opaque)"},"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.discreet":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discreet)"},"colors.surface.intent.action.discreet.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discreet-hover)"},"colors.surface.intent.action.discreet.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discreet-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.surface.intent.danger.weak":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger-weak)"},"colors.surface.intent.danger.opaque":{value:"var(--Tight-colors-brand-danger-opaque)",variable:"var(--Tight-colors-surface-intent-danger-opaque)"},"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-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",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.accent.action":{value:"var(--Tight-colors-brand-action-strongest)",variable:"var(--Tight-colors-typography-accent-action)"},"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-weak)",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.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"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-green200)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.positive.strong":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive-strong)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red200)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.money.negative.strong":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative-strong)"},"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.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"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-2xl)",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.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",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-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",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.opaque":{value:"var(--Tight-colors-colorPalette-action-opaque)",variable:"var(--Tight-colors-colorPalette-action-opaque)"},"colors.colorPalette.opaque":{value:"var(--Tight-colors-colorPalette-opaque)",variable:"var(--Tight-colors-colorPalette-opaque)"},"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.opaque":{value:"var(--Tight-colors-colorPalette-success-opaque)",variable:"var(--Tight-colors-colorPalette-success-opaque)"},"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.opaque":{value:"var(--Tight-colors-colorPalette-warning-opaque)",variable:"var(--Tight-colors-colorPalette-warning-opaque)"},"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.opaque":{value:"var(--Tight-colors-colorPalette-danger-opaque)",variable:"var(--Tight-colors-colorPalette-danger-opaque)"},"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.discreet":{value:"var(--Tight-colors-colorPalette-intent-action-discreet)",variable:"var(--Tight-colors-colorPalette-intent-action-discreet)"},"colors.colorPalette.action.discreet":{value:"var(--Tight-colors-colorPalette-action-discreet)",variable:"var(--Tight-colors-colorPalette-action-discreet)"},"colors.colorPalette.discreet":{value:"var(--Tight-colors-colorPalette-discreet)",variable:"var(--Tight-colors-colorPalette-discreet)"},"colors.colorPalette.intent.action.discreet.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discreet-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discreet-hover)"},"colors.colorPalette.action.discreet.hover":{value:"var(--Tight-colors-colorPalette-action-discreet-hover)",variable:"var(--Tight-colors-colorPalette-action-discreet-hover)"},"colors.colorPalette.discreet.hover":{value:"var(--Tight-colors-colorPalette-discreet-hover)",variable:"var(--Tight-colors-colorPalette-discreet-hover)"},"colors.colorPalette.intent.action.discreet.active":{value:"var(--Tight-colors-colorPalette-intent-action-discreet-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discreet-active)"},"colors.colorPalette.action.discreet.active":{value:"var(--Tight-colors-colorPalette-action-discreet-active)",variable:"var(--Tight-colors-colorPalette-action-discreet-active)"},"colors.colorPalette.discreet.active":{value:"var(--Tight-colors-colorPalette-discreet-active)",variable:"var(--Tight-colors-colorPalette-discreet-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.intent.danger.weak":{value:"var(--Tight-colors-colorPalette-intent-danger-weak)",variable:"var(--Tight-colors-colorPalette-intent-danger-weak)"},"colors.colorPalette.intent.danger.opaque":{value:"var(--Tight-colors-colorPalette-intent-danger-opaque)",variable:"var(--Tight-colors-colorPalette-intent-danger-opaque)"},"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.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"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.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"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.positive.strong":{value:"var(--Tight-colors-colorPalette-positive-strong)",variable:"var(--Tight-colors-colorPalette-positive-strong)"},"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)"},"colors.colorPalette.negative.strong":{value:"var(--Tight-colors-colorPalette-negative-strong)",variable:"var(--Tight-colors-colorPalette-negative-strong)"}};function _o(e,t){return zo[e]?.value||t}_o.var=function(e,t){return zo[e]?.variable||t};const Ko=Bn(null,An({borderRadius:"50%",flexShrink:0})),Yo=Bn(null,An({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),Zo=_o.var("colors.surface.foreground.disabled");function Xo({color:e=Zo,diameter:t=17,label:n}){return R("div",{...Yo,"data-testid":"bullet-row",children:[S("div",{...Ko,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&S(Ho,{children:n})]})}const Qo=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function Go({payload:e}){return void 0===e?null:S("div",{...Qo,children:e.map((e,t)=>"none"!==e.type&&S(Xo,{color:e.color,label:e.value,diameter:17},t))})}const Jo={right:20,left:20},$o=["income","profit","expenses","loss"],ea=e=>$o.findIndex(t=>t===e.dataKey),ta={paddingBottom:"20px",marginLeft:"-20px"},na={stackId:"stack",isAnimationActive:!1},ra=Bn(Pn["profit-loss-graph"],An({"& .recharts-surface":{outline:"none"}})),oa=_o.var("colors.money"),aa=_o.var("colors.border.layout"),ia=_o.var("colors.border.layout.strong"),la={fill:_o.var("colors.typography.base"),fontSize:_o.var("fontSizes.metric.sm")},sa={profit:_o.var("colors.money.positive.strong"),income:_o.var("colors.money.positive.weak"),loss:_o.var("colors.money.negative.strong"),expenses:_o.var("colors.money.negative.weak")},ca=[0,100],da=["auto","auto"];function ua({data:e}){const[t,n]=y(!0);if(void 0===e)return null;const r=e.hasAnyData?da:ca;return S(V,{width:"100%",height:"100%",...ra,children:R(W,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:Jo,children:[S(H,{verticalAlign:"top",itemSorter:ea,wrapperStyle:ta,content:({payload:e})=>S(Go,{payload:e})}),S(q,{strokeDasharray:"0",vertical:!1,stroke:aa}),S(j,{dataKey:"month",interval:0,tickLine:!1,stroke:aa,tick:la}),S(z,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:aa,tick:la,tickFormatter:e=>Fo(e)}),S(_,{content:({active:e,payload:t})=>S(jo,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),S(K,{name:"Profit",dataKey:"profit",fill:sa.profit,...na}),S(K,{name:"Income",dataKey:"income",fill:sa.income,...na}),S(K,{name:"Loss",dataKey:"loss",fill:sa.loss,...na}),S(K,{name:"Expenses",dataKey:"expenses",fill:sa.expenses,...na}),S(K,{dataKey:uo,fill:aa,legendType:"none",...na}),S(Y,{y:0,stroke:ia}),S(Z,{dataKey:"netIncome",fill:oa,stroke:oa,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const ha=An({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"});function pa({styles:e}){const t=In(ha,e);return S("div",{className:t,"data-testid":"shimmer-block"})}const ga=An({width:"40%",minHeight:65});function ma({children:e}){return R(N,{children:[S(pa,{styles:ga}),S(Po,{children:e})]})}const va=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),ba=An({width:"80px",height:"17px",marginBottom:"10px"}),fa=An({width:"100%",height:"100%"});function ya(){return R(N,{children:[R("div",{...va,children:[S(pa,{styles:ba}),S(pa,{styles:ba}),S(pa,{styles:ba}),S(pa,{styles:ba})]}),S(pa,{styles:fa})]})}const xa=Nn({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"},xl:{fontSize:"10em"}}}});function Ta({size:e}){const t=xa({size:e});return S("div",{className:t,children:"Sample"})}const ka=20200,wa=5043,Ca=Object.freeze({income:ka,expenses:wa,netIncome:15157,absoluteSum:Math.abs(ka)+Math.abs(wa)}),Aa=Object.freeze({total:wa,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),Ea=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),Ia=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function Sa({filter:e=nt.LAST_12_MONTHS,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return co({filter:e,grouping:t,select:go})}({filter:e,grouping:"MONTHLY"}),o=t?function(){const e=[],t=/* @__PURE__ */new Date;let n=0,r=0,o=0;for(let a=11;a>=0;a--){const i=new Date(t.getFullYear(),t.getMonth()-a,1),l=wt(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=Ia[11-a],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),n+=c,r=Math.max(r,s.income),o=Math.max(o,s.expenses)}return{total:n,domain:[-o,r],months:e,hasAnyData:!0}}():n;return R(xo,{type:"chart",children:[S(vo,{title:"Profit + Loss"}),S(fo,{children:r?S(ma,{children:S(ya,{})}):R(N,{children:[S(No,{title:Fo(o?.total??0),label:"Profit"}),S(Po,{children:S(ua,{data:o})})]})}),t&&S(Ta,{size:"xl"})]})}const Na=Bn(null,An({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch",paddingLeft:{base:"16px",xl:0},paddingRight:{base:"16px",xl:0}}));function Ra({children:e}){return S("div",{...Na,children:e})}const Pa="conversations-section",Da="transactions-section",La={MESSAGE_REVIEW:Pa,TRANSACTION_REVIEW:Da,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},Ma={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},Oa={resolutionStatus:{in:["OPEN"]}},Fa=[],Ba=[];function Ua(e){return no(`${t=e,oo[t]}`,"v6");var t}const Va={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},Wa={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},Ha={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:Wa.short.credentialsChanged,longMessage:Wa.long.relinkCredentials,buttonType:Va.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:Wa.short.credentialsChanged,longMessage:Wa.long.relinkCredentials,buttonType:Va.RELINK},INVALID_MFA:{shortMessage:Wa.short.credentialsChanged,longMessage:Wa.long.relinkCredentials,buttonType:Va.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:Wa.short.credentialsChanged,longMessage:Wa.long.invalidUpdatedUsername,buttonType:Va.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:Wa.short.accountLocked,longMessage:Wa.long.accountLocked,buttonType:Va.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:Wa.short.credentialsChanged,longMessage:Wa.long.relinkCredentials,buttonType:Va.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:Wa.short.supportChanged,longMessage:Wa.long.supportChanged,buttonType:Va.CHAT},USER_SETUP_REQUIRED:{shortMessage:Wa.short.updateNeeded,longMessage:Wa.long.updateNeeded,buttonType:Va.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:Wa.short.supportChanged,longMessage:Wa.long.mfaUpdateNeeded,buttonType:Va.OPEN_BANK},NO_ACCOUNTS:{shortMessage:Wa.short.noAccountsAvailable,longMessage:Wa.long.noAccountsUnlink,buttonType:Va.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:Wa.short.noAccountsAvailable,longMessage:Wa.long.noAccountsUnlink,buttonType:Va.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:Wa.short.connectionError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},ITEM_NOT_FOUND:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},PRODUCT_NOT_READY:{shortMessage:Wa.short.serverError,longMessage:Wa.long.productNotReady,buttonType:Va.CHAT},USER_PERMISSION_REVOKED:{shortMessage:Wa.short.connectionError,longMessage:Wa.long.permissionRevoked,buttonType:Va.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:Wa.short.temporarilyDown,longMessage:Wa.long.bankMaintenance,buttonType:Va.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:Wa.short.serverDown,longMessage:Wa.long.serverDown,buttonType:Va.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:Wa.short.temporarilyDown,longMessage:Wa.long.bankMaintenance,buttonType:Va.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:Wa.short.supportChanged,longMessage:Wa.long.supportChanged,buttonType:Va.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:Wa.short.connectionError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT},PLANNED_MAINTENANCE:{shortMessage:Wa.short.temporarilyDown,longMessage:Wa.long.bankConnectionMaintenance,buttonType:Va.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:Wa.short.requestError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:Wa.short.inputError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:Wa.short.volumeDown,longMessage:Wa.long.bankMaintenance,buttonType:Va.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:Wa.short.serverError,longMessage:Wa.long.connectionError,buttonType:Va.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:Wa.short.updateNeeded,longMessage:Wa.long.partnerCredsChange,buttonType:Va.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:Wa.short.credentialsExpiring,longMessage:Wa.long.credentialsExpiring,buttonType:Va.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:Wa.short.relinkNeeded,longMessage:Wa.long.relinkForStatements,buttonType:Va.RELINK}},DEFAULT:{DEFAULT:{shortMessage:Wa.short.connectionError,longMessage:Wa.long.connectionError,buttonType:Va.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:Wa.short.generic,longMessage:Wa.long.generic,buttonType:Va.CHAT}}};function qa({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return zr({error:new Error("No bank error provided. Should not get here"),severity:"error"}),Ha.DEFAULT.DEFAULT;const n=Ha[e];if(!n)return zr({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),Ha.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(zr({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),Ha.DEFAULT.DEFAULT)}const ja={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",shortDescription:"Link your bank to track every dollar",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function za(e,t=!0){const n=qa({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName??"unknown"}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:n?.shortMessage(e.apiInstitutionName??"your bank")||"",description:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!1,apiPartnerName:""})||"",shortDescription:t&&"RELINK"===n?.buttonType&&n?.longMessage({apiInstitutionName:e.apiInstitutionName??"your bank",isMobile:!0,apiPartnerName:""})||"",type:n?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}function _a(e,t){const n=er(),r=ar();return x(o=>{const a=Jn(n),i=a?{}:{retry:!1,staleTime:1/0};return rr.prefetchQuery({queryKey:Kn(e(o),n??"",r),queryFn:a?t:tr,...i})},[e,t,n,r])}const Ka=Object.freeze({}),Ya=Object.freeze({cursor:"FINAL_PAGE"});function Za({queryKey:e,queryFn:t,...n}){const[r,o]=y(Ka),a=g(e);i(a.current,e)||(a.current=e,o(Ka));const l=n.select,s=Xn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=Yn(e,r),d=ir({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=m(()=>{return e=d.query.data?.cursor,t=o,{getFirstPage:()=>t(Ka),getLastPage:()=>t(Ya),hasNextPage:Xn(e?.after),hasPreviousPage:Xn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=_a(x(t=>Yn(e,t),[e]),t),p=_a(x(t=>Yn(e,t),[e]),t);return T(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{zr({error:e,severity:"error"})}),e.before&&p({cursor:e.before}).catch(e=>{zr({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,p]),{...d,paginationControls:u}}function Xa({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const o=Kn(e,n,r);return rr.fetchQuery({queryKey:o,queryFn:t})}const Qa=e=>["integrations",e??{}],Ga=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ua(t[3].environment)},r=await eo(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Ja(e,t){return Za({...t,queryKey:Qa(e),queryFn:Ga})}function $a(e){return Ja({filter:{apiName:{equal:"PLAID"}}},e)}function ei(){return $a({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})})}function ti(){return Ja({filter:{status:{equal:"ACTIVE"}}},{select:e=>({multiAccountIntegrations:e.data?.filter(e=>["PLAID","UNIT"].includes(e.apiName))||[],integrations:e.data?.filter(e=>!["PLAID","UNIT"].includes(e.apiName))||[],cursor:e.cursor})})}function ni({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const o=Kn(e,n,r);return rr.prefetchQuery({queryKey:o,queryFn:t})}const ri=e=>["banks/accounts",e??{}],oi=async e=>{const t=e.queryKey,n=t[1],r=t[2].cursor,o=t[3].accessToken,a=t[3].environment,i={path:"/v6/banks/accounts/query",bodyParams:{...n,filter:{...n.filter,integration:{expand:!0}},cursor:r},accessToken:o,endpointManager:Ua(a)},l=await eo(i);return"SUCCESS"===l.result&&void 0!==l.data?{data:l.data,cursor:l.cursor}:{data:void 0,cursor:void 0}};function ai(e){const t=e?.params;return Za({queryKey:t?ri(t):["banks/accounts",{}],queryFn:oi,enabled:e?.enabled,select:e?.select})}function ii(e,t){return Xa({queryKey:Yn(["banks/accounts",{}],{}),queryFn:oi,accessToken:e,environment:t})}function li(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function si(e,t){return t?e?`${e} ${li(t)}`:li(t):e??""}const ci={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function di(e,t){return!Gn(e)&&e.startsWith(t)}function ui({id:e,prefix:t}){return void 0!==e?`${ci[t]}_${e}`:""}function hi(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const pi={EXPENSE:"EXPENSE",REVENUE:"REVENUE",TRANSFER_IN:"TRANSFER_IN",TRANSFER_OUT:"TRANSFER_OUT",TAX_EXPENSE:"TAX_EXPENSE",INVOICE_REVENUE:"INVOICE_REVENUE",PAYMENT_IN:"PAYMENT_IN",PAYMENT_OUT:"PAYMENT_OUT",PAYROLL_EXPENSE:"PAYROLL_EXPENSE",BILL_EXPENSE:"BILL_EXPENSE",LOAN_EXPENSE:"LOAN_EXPENSE",BANK_TRANSFER:"BANK_TRANSFER",LOAN_PAYMENT:"LOAN_PAYMENT",BILL_PAYMENT:"BILL_PAYMENT",PAYOUT:"PAYOUT",TAX_PAYMENT:"TAX_PAYMENT",INVOICE_PAYMENT:"INVOICE_PAYMENT"},gi={Expense:[{name:"Expense",value:pi.EXPENSE},{name:"Tax Expense",value:pi.TAX_EXPENSE},{name:"Payment Out",value:pi.PAYMENT_OUT},{name:"Bill Expense",value:pi.BILL_EXPENSE},{name:"Loan Expense",value:pi.LOAN_EXPENSE}],Income:[{name:"Income",value:pi.REVENUE},{name:"Invoice Revenue",value:pi.INVOICE_REVENUE},{name:"Payment In",value:pi.PAYMENT_IN}],Transfer:[{name:"Bank Transfer In",value:pi.TRANSFER_IN},{name:"Bank Transfer Out",value:pi.TRANSFER_OUT}]},mi={[pi.EXPENSE]:"Edit Expense",[pi.REVENUE]:"Edit Income",[pi.TRANSFER_IN]:"Edit Transfer",[pi.TRANSFER_OUT]:"Edit Transfer",[pi.TAX_EXPENSE]:"Edit Expense",[pi.INVOICE_REVENUE]:"Edit Income",[pi.PAYMENT_IN]:"Edit Income",[pi.PAYMENT_OUT]:"Edit Expense",[pi.PAYROLL_EXPENSE]:"Edit Expense",[pi.BILL_EXPENSE]:"Edit Expense",[pi.LOAN_EXPENSE]:"Edit Expense",[pi.BANK_TRANSFER]:"Edit Transfer",[pi.LOAN_PAYMENT]:"Edit Expense",[pi.BILL_PAYMENT]:"Edit Expense",[pi.PAYOUT]:"Edit Income",[pi.TAX_PAYMENT]:"Edit Expense",[pi.INVOICE_PAYMENT]:"Edit Income"},vi=e=>{switch(e){case"EXPENSE":case"PAYROLL_EXPENSE":case"BILL_EXPENSE":case"LOAN_EXPENSE":case"LOAN_PAYMENT":case"BILL_PAYMENT":return"EXPENSE_CATEGORY";case"TRANSFER_IN":case"TRANSFER_OUT":case"BANK_TRANSFER":return"TRANSFER";case"PAYMENT_IN":case"PAYMENT_OUT":case"PAYOUT":return"PAYMENT";default:return"GL_ACCOUNT"}},bi=e=>e===pi.TRANSFER_IN||e===pi.TRANSFER_OUT||e===pi.BANK_TRANSFER,fi=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,yi=e=>"PLAID"===e,xi=e=>e>0?"Deposited to":"Withdrawn from",Ti=e=>({id:hi(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),ki=(e,t)=>e?.find(e=>e.glAccountId===t),wi=e=>{const{query:t}=ai({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},Ci=e=>{if(Zn(e))return!1;const t=e.filter(e=>yi(e.apiName)&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||Xn(e.lastSyncedDate))},Ai=()=>{const e=ai({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function Ei(){return ai({select:e=>{return{...e,plaidItemAccountsReadyToSync:Ci(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>yi(e.apiName)))};var t}})}function Ii(e){return e?.filter(e=>fi(e.apiName)&&"ACTIVE"===e.status)}function Si(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function Ni(e){return ai({select:t=>({...t,data:Si(t?.data,e)})})}const Ri={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},Pi=e=>["tasks",e??{}],Di={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},Li={filter:{status:{in:["ACTIVE"]}}},Mi=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:Ua(t[2].environment)},o=await eo(r);return"SUCCESS"===o.result&&void 0!==o.data?{data:o.data}:{data:void 0}};function Oi(e,t){return ir({...e,queryKey:t?Pi(t):["tasks",{}],queryFn:Mi})}const Fi=(e,t)=>{const n=Zn(r=e)||Zn(r.data)?[]:[...r.data].sort((e,t)=>Di[e.priority]-Di[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n};const Bi=e=>{const t=La[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},Ui=v({}),Vi=Nn({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"}}}});function Wi(e,t,n){const r=({size:r=24,fill:o="transparent",stylists:a})=>{const{icons:i}=b(Ui),l=n?.styleIconKey?i?.[n.styleIconKey]:void 0,s=qn([Bn(null,Vi()),...a]);return l?S("img",{src:l,alt:t,width:r,height:r,style:{minHeight:r,minWidth:r},className:An({objectFit:"contain"})}):S(e,{...s,style:{minHeight:r,minWidth:r},width:r,height:r,fill:o})};return r.displayName=t,r}const Hi=Wi(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10,transform:"scale(-1, 1) translate(-13, 0)"})),"ArrowLeft"),qi=Wi(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10})),"ArrowRight"),ji=An({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),zi=An({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),_i=An({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});An({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}}),An({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}});const Ki=v({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Yi({Component:e,stylists:t}){return S(e,{stylists:[Bn(Pn["small-icon"],Pn.icon),...t??[]],size:12})}const Zi=Bn(Pn["pagination-button"],An({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{xl:"35px",base:"44px"},gap:0})),Xi=Bn(null,An({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discreet",padding:{xl:"4px",base:"12px"},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:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"}}),zi),Qi=Bn(null,An({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center",width:{xl:"100%",base:"44px"}})),Gi=Bn(null,An({height:{xl:"12px",base:"20px"},width:{xl:"12px",base:"20px"}}));function Ji(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=b(Ki);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return R("div",{...Zi,children:[S("div",{...Qi,children:S("button",{...Xi,onClick:r,disabled:!t,children:S(Yi,{Component:Hi,stylists:[Gi]})})}),S("div",{...Qi,children:S("button",{...Xi,onClick:n,disabled:!e,children:S(Yi,{Component:qi,stylists:[Gi]})})})]})}const $i=An({width:"100%",height:"50px"});function el(){return S(pa,{styles:$i})}const tl=Bn(Pn["dashboard-placeholder-table"],An({display:"flex",flexDirection:"column",gap:"4px"})),nl=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),rl=An({width:"100px",height:"20px"});function ol({numColumns:e=6}){return R("div",{...tl,children:[S("div",{...nl,children:Array.from({length:e},(e,t)=>S(pa,{styles:rl},t))}),S(el,{}),S(el,{}),S(el,{}),S(el,{}),S(el,{}),S(el,{})]})}async function al({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:o,cache:a}){const i=Zr({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let n=e;const r=null==(o=t)?"":Object.entries(o).map(([e,t])=>{let n;return n=Array.isArray(t)?t.map(t=>Yr(e,t)).join("&"):Yr(e,t),n}).join("&");var o;return""!==r&&(n+=`?${r}`),n})({url:o,params:r});jr("HTTP GET Request",{url:o,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:a});return jr("HTTP GET Response",{url:o,status:e.status,statusText:e.statusText}),Xr(e)}catch(s){return Promise.reject(s)}}async function il(e){const{url:t,headers:n}=Gr(e);return al({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function ll(e){return il({...e,endpointManager:Ua(e.environment)})}async function sl(e){return il({...e,endpointManager:io(e.environment)})}function cl({delay:e,callback:t}){const n=m(()=>function({delay:e,callback:t}){let n;const r=()=>{n&&(clearTimeout(n),n=void 0)};return{startCallback:o=>{r(),n=setTimeout(()=>{t(o)},e)},cancelCallback:()=>r()}}({delay:e,callback:t}),[e,t]);return T(()=>()=>{n.cancelCallback()},[n]),{startCallback:x(e=>{n.startCallback(e)},[n]),cancelCallback:x(()=>{n.cancelCallback()},[n])}}function dl({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=cl({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const ul={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"},hl={ASC:"ASC",DESC:"DESC"},pl=e=>["conversations",e??{}],gl=e=>["conversations","conversation",e],ml=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ua(t[3].environment)},r=await eo(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function vl(e){return Za({queryKey:e?pl(e):["conversations",{}],queryFn:ml})}const bl=async e=>{const t=e.queryKey,{id:n}=t[2],r={path:"/v6/conversations/{id}",pathParams:{id:n},accessToken:t[3].accessToken,environment:t[3].environment},o=await ll(r);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null};function fl(e){const t=Xn(e);return ir({queryKey:gl({id:e??""}),queryFn:bl,enabled:t})}const yl=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:Ua(n)};return await eo(r)};function xl(){return dl({prefetchFn:_a(gl,bl)})}function Tl(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function kl({header:e}){const t=Tl(e.column);return S("div",{...Bn(Pn["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:X(e.column.columnDef.header,e.getContext())})}const wl=Bn(Pn["dashboard-table-header"],An({display:"flex",flexDirection:"row",alignItems:"center"}));function Cl({headerGroups:e}){return S("div",{children:e.map(e=>k("div",{...wl,key:e.id},e.headers.map(e=>S(kl,{header:e},e.id))))})}const Al=Bn(Pn["dashboard-table-body"],An({display:"flex",flexDirection:"column"}));function El({children:e}){return S("div",{...Al,children:e})}function Il({cell:e,onCellClick:t}){const n=Tl(e.column),r=Bn(Pn["dashboard-table-cell"],An({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),o=Bn(null,An({display:"flex",flexDirection:"row",height:"100%"}));return S("div",{...o,style:n,onClick:()=>{t&&t(e)},children:S("div",{style:n,...r,children:X(e.column.columnDef.cell,e.getContext())})})}const Sl=Bn(Pn["table-sub-row"],An({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero",cursor:"pointer",_hover:{backgroundColor:"brand.action.opaque"}}));function Nl({rowData:e,onCellClick:t}){const n=e.getVisibleCells();return S("div",{...Sl,children:n.map(e=>S(Il,{cell:e,onCellClick:t,isChild:!0},e.id))})}const Rl=An({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),Pl=An({background:"surface.background"}),Dl=Bn(Pn["table-row"],An({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{base:"85px",xl:"60px"},minWidth:"fit-content",_hover:{backgroundColor:"brand.action.opaque"}}));function Ll({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:o}){const a=e.getIsExpanded(),i=Bn(Pn["table-parent-row"],Rl,e.index%2==0?Pl:void 0),l=e.getVisibleCells();return R("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[S("div",{...Dl,children:l.map(e=>S(Il,{cell:e,onCellClick:r},e.id))}),a&&S("div",{children:e.subRows.map(e=>S(Nl,{rowData:e,onCellClick:r,shouldDisplayDivider:o},e.id))})]})}const Ml=(e,t={})=>{Bt.getState().openDrawer(e,t)},Ol=()=>{Bt.getState().requestCloseDrawer()},Fl=()=>Bt(e=>e.drawerHistory),Bl=[{name:"One-Time Expense",value:"ONE_TIME"},{name:"Weekly Recurring Expense",value:"WEEKLY"},{name:"Monthly Recurring Expense",value:"MONTHLY"},{name:"Yearly Recurring Expense",value:"YEARLY"}],Ul={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},Vl={ASC:"ASC",DESC:"DESC"},Wl=e=>["banks/transactions",e??{}],Hl=e=>["banks/transactions",e.id],ql=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ua(t[3].environment)},r=await eo(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function jl(e,t){return Za({queryKey:Wl(e),queryFn:ql,...t})}const zl=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await ll(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function _l({id:e}){return ir({queryKey:Hl({id:e}),queryFn:zl})}function Kl(){return dl({prefetchFn:_a(Hl,zl)})}const Yl=e=>["conversations/messages",e];function Zl(e){if(Zn(e)||0===e.length)return null;const t=[[e[0]]];for(let n=1;n<e.length;n++){const r=e[n],o=t[t.length-1],a=o[0].author.userId;r.author.userId===a?o.push(r):t.push([r])}return t}const Xl=async e=>{const t=e.queryKey,{id:n}=t[1],r={path:"/v6/conversations/{id}/messages",pathParams:{id:n},accessToken:t[2].accessToken,environment:t[2].environment},o=await ll(r);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null},Ql=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:Ua(n),accessToken:t};return await eo(r)};function Gl(){return dl({prefetchFn:_a(Yl,Xl)})}const Jl=e=>["summaries",e??{}],$l=e=>["summaries",e.id],es=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:Ua(t[2].environment)},r=await eo(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const ts=async e=>{const t=e.queryKey,n={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},r=await ll(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function ns({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=xl(),{startPrefetch:o,cancelPrefetch:a}=Gl(),{startPrefetch:i,cancelPrefetch:l}=Kl(),{startPrefetch:s,cancelPrefetch:c}=dl({prefetchFn:_a($l,ts)}),d=x(()=>{Xn(e.original.attachedEntityId)&&di(e.original.attachedEntityId,ci.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):Xn(e.original.attachedEntityId)&&di(e.original.attachedEntityId,ci.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),o({id:e.original.id}),n({id:e.original.id})},[e.original.attachedEntityId,e.original.id,o,n,i,s]),u=x(()=>{Xn(e.original.attachedEntityId)&&di(e.original.attachedEntityId,ci.BANK_TRANSACTION)?l():Xn(e.original.attachedEntityId)&&di(e.original.attachedEntityId,ci.FINANCIAL_SUMMARY)&&c(),a(),r()},[l,c,r,a,e.original.attachedEntityId]);return S(Ll,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?Ml("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):Xn(t)?di(t,ci.BANK_TRANSACTION)?Ml("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):di(t,ci.FINANCIAL_SUMMARY)&&(r=e,o=t,Ml("FinancialSummary",{routeProps:{conversationId:r,summaryId:o}})):function(e){Ml("Conversation",{routeProps:{conversationId:e}})}(e);var r,o})(e.original.id,e.original.attachedEntityId,t)})}const rs=Wi(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),os=An({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:.6}}),as=An({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discreet",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discreet.hover",borderColor:"border.layout","& .Tight-text":{color:"typography.intent.secondary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discreet.active","& .Tight-text":{color:"typography.intent.secondary.active"}},"& .Tight-text":{color:"typography.intent.secondary"}}),is=An({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),ls=An({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),ss=An.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discreet",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discreet.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discreet.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),cs=Nn({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%",height:"100%"}}}}),ds={default:is,small:ls},us=e=>{const t=ds[e];return Bn(Pn["button-base"],t,os,ji)},hs=["default","small"],ps={default:{className:""},small:{className:""}};for(const oP of hs)ps[oP]=us(oP);const gs=w(function({children:e,stylists:t=[],type:n="button",onClick:r,disabled:o,size:a="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=qn([ps[a],Bn(null,cs({width:i})),...t]);return S("button",{ref:u,...h,type:n,onClick:r,disabled:o,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),ms=Bn(Pn["button-primary"],as),vs=w(function({children:e,active:t,stylists:n=[],width:r,...o},a){return S(gs,{ref:a,stylists:[ms,...n],active:t,width:r,...o,children:e})}),bs=()=>{Ml("Conversation",{routeProps:{conversationId:null}})},fs=Bn(Pn["small-square-button"],void 0),ys=An({width:{xl:"auto",base:"44px"},height:{xl:"auto",base:"44px"}});function xs(){return S("div",{className:ys,children:S(vs,{stylists:[fs],onClick:bs,width:"fill-parent",children:S(Yi,{Component:rs})})})}const Ts=Nn({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"16px",border:{base:"none",xl:"{borderWidths.lg} solid {colors.border.layout}"},borderRadius:{base:"zero",xl:"lg"}}}}});function ks({children:e,dashboard:t}){const n=Bn(Pn["dashboard-table"],Ts({dashboard:t}));return S("div",{...n,children:e})}const ws=v(null),Cs="mobile",As=Nn({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"},flexEnd:{alignItems:"flex-end"}}},defaultVariants:{alignVariant:"flexStart"}});function Es({children:e,alignVariant:t="flexStart"}){const n=Bn(null,As({alignVariant:t}));return S("div",{...n,children:e})}const Is=Nn({base:{fontWeight:"label",fontSize:"lg",fontFamily:"label",lineHeight:"18px",letterSpacing:"0.84px",maxWidth:"100%",xl:{lineHeight:"16px",fontSize:"label"}},variants:{intent:{weak:{color:"typography.base.weak"},default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:ko,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function Ss({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left",extraClassNames:o=[]}){const a=Bn(Pn.label,Pn.text,An(Is.raw({intent:t,wrap:n,alignment:r}),o));return Gn(e)?null:S("div",{title:"ellipsis"===n?e:void 0,...a,children:e})}const Ns={"sm-sm":Bn(Pn.text,An({fontSize:{xl:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To),"sm-med":Bn(Pn.text,An({fontSize:{xl:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To),"sm-lg":Bn(Pn.text,An({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To),"med-sm":Bn(Pn.text,An({fontSize:{xl:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To),"med-med":Bn(Pn.text,An({fontSize:{xl:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To),"med-lg":Bn(Pn.text,An({fontSize:{xl:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),To)};function Rs({children:e,size:t,weight:n,stylists:r=[]}){const o=qn([Ns[`${t}-${n}`],...r]);return S("div",{title:e,...o,children:e})}const Ps=Bn(Pn["emphasis-label"],An({lineHeight:"16px"}));function Ds({children:e}){return S(Rs,{size:"med",weight:"lg",stylists:[Ps],children:e})}function Ls({text:e,isRead:t}){return S(t?Ss:Ds,{children:e})}function Ms({date:e,isRead:t=!1}){const n=Ct(e);return S(Ls,{text:n,isRead:t})}const Os=Bn(Pn["strong-sub-label"],jn({label:"strongSubLabel"}));function Fs({children:e,stylists:t=[]}){return Gn(e)?null:S(Rs,{size:"sm",weight:"med",stylists:[Os,...t],children:e})}const Bs=v(null),Us=An({overflow:"auto",display:"flex",flexDirection:"column",width:"fit-content",minWidth:"150px",maxWidth:"325px",maxHeight:"314px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),Vs=An({display:"flex",alignItems:"center",gap:"9px",cursor:"pointer",borderRadius:"zero",width:"100%",padding:{sm:"10px",base:"16px"},border:"none",backgroundColor:"surface.foreground",minWidth:{base:"100%"},boxShadow:{sm:"none"},minHeight:{sm:"35px"},height:{sm:"fit-content"},flexShrink:{sm:0},textAlign:{sm:"start"},"&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discreet.hover"}}),Ws=Bn(Pn["selector-row"],Vs);function Hs(e,t,n){const[r,o]=y(e);return[t??r,n??o]}function qs({children:e}){return null===ue()?S(he,{children:e}):e}function js({children:e,modal:t=!1,initialOpen:n,placement:r,offsetPx:o,open:a,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:n=0,modal:r,open:o,onOpenChange:a,enableClickMiddleware:i=!0}={}){const[l,s]=y(),[c,d]=y(),[u,h]=Hs(e,o,a),p=ee(),g=te({placement:t,open:u,nodeId:p,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||h(e)},whileElementsMounted:ie,middleware:[ne(n),re({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),oe({padding:8}),ae({apply({availableHeight:e,elements:t}){let n=e;if(e<314){const t=37*Math.floor(e/37)-18.5;n=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${n}px`,overflowY:"auto"})},padding:8})]}),v=g.context,b=le(v,{enabled:i}),f=se(v,{bubbles:{escapeKey:!0}}),T=ce(v),k=de([b,f,T]),w=x(()=>h(!1),[h]);return m(()=>({open:u,setOpen:h,close:w,...k,...g,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,w,k,g,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:o,open:a,onOpenChange:i,enableClickMiddleware:s}),d=ue(),u=l&&null===d,h=c.nodeId;return S(qs,{children:S(pe,{id:h,children:S(Bs.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function zs(){const e=b(Bs);if(Zn(e))throw new Error("Popup components must be wrapped in <PopupManager />");return e}function _s({children:e}){const t=zs(),n=t.refs.setReference,r=t.open?"open":"closed",o={...t.getReferenceProps(),ref:n,"data-state":r};return S(N,{children:e(o)})}const Ks=Wi(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),p.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Ys({Component:e,stylists:t}){return S(e,{stylists:[Bn(Pn["tiny-icon"],Pn.icon),...t??[]],size:9})}const Zs=Wi(e=>p.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),p.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),Xs=Bn(null,An({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discreet.hover"},"&[data-active='true']":{backgroundColor:"surface.intent.action.discreet.active",borderColor:"border.intent.action.active"},"&:has(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),ji),Qs=Bn(null,An({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Gs=Bn(null,An({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"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),Js=Bn(null,An({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function $s({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const o=n||"open"===r?.["data-state"];return R("div",{...Xs,"data-active":o,children:[R("button",{...Qs,...r,children:[S(Fs,{children:t}),!o&&S("div",{...Js,children:S(Ys,{Component:Zs})})]}),o&&S("button",{...Gs,onClick:e,children:S(Ys,{Component:Ks})})]})}const ec=Nn({base:{borderColor:"border.layout",background:"surface.foreground",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"}}}});function tc({initialFocus:e=!0,style:t,ref:n,type:r,forceMount:o,...a}){const{context:i,blockInteraction:l,...s}=zs(),c=ge([s.refs.setFloating,n]),d=Bn(Pn.popup,ec({type:r}));return o||i.open?R(N,{children:[l&&S(me,{lockScroll:!0}),S(ve,{children:S(be,{context:i,modal:s.modal,initialFocus:e?void 0:-1,children:S("div",{ref:c,...d,style:{...s.floatingStyles,...t},...s.getFloatingProps(a),"aria-labelledby":s.labelId,"aria-describedby":s.descriptionId,children:a.children})})})]}):null}const nc=Bn(Pn["popup-sort-row"],An({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function rc({onClick:e,children:t,active:n}){return S("button",{onClick:e,...nc,children:S(Ho,{accent:n?"active":"action",children:t})})}const oc=Bn(null,An({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),ac=Bn(null,An({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function ic({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:o}){const a=zs(),i=e=>{r(e),a.close()},l=o?.orderBy===e&&"ASC"===o?.direction,s=o?.orderBy===e&&"DESC"===o?.direction;return R("div",{...oc,children:[S(Fs,{stylists:[ac],children:"Sort by:"}),S(rc,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),S(rc,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const lc=An.raw(ss,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function sc({extraClassNames:e,children:t,active:n,disabled:r,onClick:o,popupTriggerProps:a,ariaLabel:i,ariaExpanded:l}){const[s,c]=y(!1),d=Bn(Pn["button-discreet-small"],An(lc,e),ji),u=n??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(a?.["data-state"]);return S("button",{type:"button",...d,onClick:e=>{void 0===u&&c(!s),o&&o(e)},"data-active":u??s,disabled:r,...a,"aria-label":i,"aria-expanded":l,children:t})}const cc={minWidth:"140px"};function dc({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const o=b(ws);if(!o)return null;const{sortInstance:a,setSortInstance:i}=o,l=a?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S($s,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),S(tc,{style:cc,children:S(ic,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:a})})]}):S(sc,{disabled:!0,children:S(Fs,{children:e})})}const uc=Nn({base:{display:"flex",width:"100%"},variants:{align:{left:{justifyContent:"flex-start"},center:{justifyContent:"center"},right:{justifyContent:"flex-end"}},padding:{none:{},default:{},large:{}}},compoundVariants:[{align:"left",padding:"none",css:{paddingLeft:"0"}},{align:"left",padding:"default",css:{paddingLeft:"19px"}},{align:"left",padding:"large",css:{paddingLeft:"33px"}},{align:"right",padding:"none",css:{paddingRight:"0"}},{align:"right",padding:"default",css:{paddingRight:"19px"}},{align:"right",padding:"large",css:{paddingRight:"33px"}}],defaultVariants:{align:"left",padding:"default"}});function hc({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r,align:o="left",padding:a="default"}){return S("div",{className:uc({align:o,padding:a}),children:S(dc,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const pc="Oldest to Newest",gc="Newest to Oldest";const mc=v({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0,clientId:void 0,unitIntegrationBankName:null,supportedIntegrations:[]});function vc({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=b(mc);let o="";return e===r?o="Me":"OWNER"===n?o="Bookkeeper":"ACCOUNTANT"===n&&(o="User"),S(Ls,{text:o,isRead:t})}const bc=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M8.94389 13.9144L13.4056 8.12309C14.1306 7.18143 14.4519 5.9904 14.299 4.81186C14.1461 3.63332 13.5313 2.56376 12.59 1.83834C12.1329 1.45727 11.602 1.17479 11.0306 1.00865C10.4592 0.842499 9.85956 0.796265 9.26942 0.872849C8.67928 0.949432 8.11133 1.14718 7.60124 1.45368C7.09115 1.76017 6.64993 2.16881 6.30526 2.65392L1.26787 9.15798C-0.0274639 10.7069 0.993722 12.5848 2.14513 13.4895C2.76204 13.9899 3.55149 14.2266 4.34198 14.1484C5.13247 14.0701 5.86015 13.6831 6.36694 13.0714L11.3769 6.56732C11.531 6.3676 11.6442 6.13944 11.7101 5.89592C11.7759 5.6524 11.7931 5.39829 11.7606 5.14812C11.7282 4.89795 11.6467 4.65664 11.5209 4.43799C11.395 4.21934 11.2274 4.02764 11.0274 3.87386C10.6233 3.56441 10.1132 3.42748 9.60854 3.49297C9.10385 3.55846 8.6456 3.82107 8.33392 4.22339L4.10525 9.70627",strokeMiterlimit:10})),"Attachment"),fc=Bn(Pn.text,An({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),To);function yc({children:e,stylists:t=[]}){const n=qn([fc,...t]);return S("div",{...n,children:e})}const xc=Nn({base:{display:"flex",gap:8,border:"none",borderBottom:"1px solid",borderBottomColor:"border.layout.weak",borderRadius:0,padding:0,width:"100%",height:"100%",cursor:"pointer",alignItems:"stretch"},variants:{isRead:{true:{backgroundColor:"transparent"},false:{backgroundColor:"surface.background"}}}}),Tc=In(An({display:"flex",flex:1,flexDirection:"column",alignItems:"start",justifyContent:"center",gap:"4px",maxWidth:"100%",paddingTop:"16px",paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"}),To),kc=An({display:"flex",flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between",width:"100%"}),wc=An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end"}),Cc=An({display:"flex",alignItems:"center",gap:8}),Ac=An({display:"flex",alignItems:"center",gap:"4px",maxWidth:"100%"}),Ec=An({display:"flex",flexDirection:"row",alignItems:"center",gap:4,maxWidth:"100%"}),Ic=An({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4}),Sc=An({backgroundColor:"typography.base",borderRadius:9999,maxHeight:8,minHeight:8,maxWidth:8,minWidth:8});function Nc({sender:e,subject:t,date:n,message:r,isRead:o,handleFormOpen:a}){return S("button",{className:xc({isRead:o}),onTouchEnd:a,children:R("div",{className:Tc,children:[R("div",{className:Ec,children:[!o&&S("div",{className:Sc}),S(Ls,{text:t,isRead:o})]}),R("div",{className:kc,children:[S("div",{className:Ic,children:S(vc,{authorUserId:e,isRead:o})}),R("div",{className:Cc,children:[S("div",{className:wc,children:S(Ms,{date:n,isRead:o})}),o?S(Yi,{Component:qi}):S(yc,{children:S(Yi,{Component:qi})})]})]}),S("div",{className:Ac,children:Gn(r)?R(N,{children:[S(Yi,{Component:bc}),S(Ss,{children:"Shared a file"})]}):S(Ss,{children:r})})]})})}const Rc=An({display:"flex",alignItems:"center",flexDirection:"row",gap:"4px"}),Pc=An({backgroundColor:"typography.base",borderRadius:9999,maxHeight:8,minHeight:8,maxWidth:8,minWidth:8});function Dc({text:e,isRead:t}){return t?S(Ss,{children:e}):R("div",{className:Rc,children:[S("div",{className:Pc}),S(Ds,{children:e})]})}const Lc=Q(),Mc=Bn(null,An({paddingLeft:"25px"})),Oc=[Lc.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>S(Es,{children:S(vc,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>S(Fs,{stylists:[Mc],children:"From"}),size:160,maxSize:160}),Lc.accessor("subject",{id:"subject",cell:({row:e})=>R(Es,{children:[S(Dc,{text:e.original.subject,isRead:"READ"===e.original.readStatus}),S(Ss,{children:e.original.latestMessage.text})]}),header:()=>S(Fs,{stylists:[Mc],children:"Subject"}),size:200}),Lc.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>S(Es,{children:S(Ms,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>S(hc,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:gc,sortAscDisplay:pc}),size:150,maxSize:150}),Lc.display({id:Cs,cell:({row:e})=>S(Nc,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function Fc(e){return e?Oc.filter(e=>e.id===Cs):Oc.filter(e=>e.id!==Cs)}const Bc=[],Uc=An({display:"flex",flexDirection:"column",height:"250px",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),Vc=Bn(Pn["empty-dashboard-layout"],Uc);function Wc({children:e}){return S("div",{...Vc,"data-testid":"empty-dashboard-layout",children:e})}function Hc({Component:e,stylists:t}){return S(e,{stylists:[Bn(Pn["large-icon"],Pn.icon),...t??[]],size:25})}const qc=e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),jc=Wi(qc,"MessageIcon",{styleIconKey:"message"}),zc=()=>{Ml("Conversation",{routeProps:{conversationId:null}})};function _c(){return R(N,{children:[S(Hc,{Component:jc}),S(Vo,{wrap:"wrap",children:"Need help with your financials?"}),S(vs,{onClick:zc,children:S(Vo,{children:"Talk to a bookkeeper"})})]})}const Kc=Wi(qc,"Paperplane",{styleIconKey:"send"});function Yc(){return R(N,{children:[S(Hc,{Component:Kc}),S(Vo,{wrap:"wrap",children:"All caught up"}),S(Ho,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Zc=Bn(null,An({display:"flex",flexDirection:"row",gap:"5px"}));function Xc({children:e}){return S("div",{...Zc,children:e})}const Qc=Nn({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Gc(e){return S(e?Yc:_c,{})}function Jc({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:o,isMobile:a}){const i=function({conversations:e,isMobile:t}){return G({data:e??Bc,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??Bc.length,columns:Fc(t),getCoreRowModel:J(),getRowId:e=>e.id})}({conversations:n,isMobile:a}),{query:{data:l},isFilling:s}=vl({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!Zn(l?.data?.[0])&&!s;return R("div",{className:Qc({isMobile:a}),children:[S("div",{id:Pa}),R(Ki.Provider,{value:r,children:[R(Vn,{children:[S(_n,{children:"Conversations"}),R(Xc,{children:[S(Ji,{}),S(xs,{})]})]}),S(ks,{dashboard:"businessOwnerDashboard",children:o?S(ol,{numColumns:4}):R(N,{children:[!a&&S(ws.Provider,{value:{sortInstance:e,setSortInstance:t},children:S(Cl,{headerGroups:i.getHeaderGroups()})}),n.length>0?S(El,{children:i.getRowModel().rows.map(e=>S(ns,{rowData:e,isMobile:a},e.id))}):S(Wc,{children:Gc(c)})]})})]})]})}const $c=Bn(Pn.body,jn({body:"default"}));function ed({children:e,stylists:t=[]}){if(Gn(e))return null;const n=qn([$c,...t]);return S("div",{...n,children:e})}const td=Bn(null,An({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),nd=Nn({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),rd=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function od(){return S("div",{...td,children:rd.map((e,t)=>S(pa,{styles:nd({width:e?.width})},t))})}const ad=Wi(e=>p.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),p.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment",{styleIconKey:"comment"}),id=An({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}"}),ld=An({position:"relative",width:"25px",height:"25px"});function sd({hasUnread:e}){return R("div",{className:ld,children:[S(Hc,{Component:ad}),e&&S("div",{"data-testid":"unread-comment-badge",className:id,"aria-hidden":"true"})]})}const cd=Bn(Pn["financial-summary-chatbox-header"],An({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout}",boxSizing:"border-box"}));function dd({hasUnreadMessages:e=!1,showMessageIndicator:t}){return R("div",{...cd,children:[S(Vo,{children:"Message Bookkeeper"}),t&&S(sd,{hasUnread:e})]})}const ud=An({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function hd(){return R("div",{className:ud,children:[S(Hc,{Component:Kc}),S(Vo,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),S(Ho,{wrap:"wrap",children:"In the meantime, ask about your financial trends."}),S(vs,{onClick:()=>Ml("Conversation"),children:S(Vo,{children:"Send a message"})})]})}const pd=An({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function gd({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=xl(),{startPrefetch:o,cancelPrefetch:a}=Gl(),i=x(()=>{o({id:t}),n({id:t})},[t,o,n]),l=x(()=>{a(),r()},[a,r]);return R("div",{className:pd,children:[S(Hc,{Component:Kc}),S(Vo,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),S(Ho,{wrap:"wrap",children:"Pick up where you left off."}),S(vs,{onClick:()=>Ml("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:S(Vo,{children:"Continue conversation"})})]})}const md=An({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function vd({summaryId:e}){return R("div",{className:md,children:[S(Hc,{Component:Kc}),S(Vo,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),S(Ho,{wrap:"wrap",children:"Your bookkeeper will respond here."}),S(vs,{onClick:()=>Ml("FinancialSummary",{routeProps:{summaryId:e}}),children:S(Vo,{children:"Talk to a bookkeeper"})})]})}function bd({summaryId:e,conversationId:t}){const n=Xn(t);return Zn(e)?S(hd,{}):n?S(gd,{conversationId:t,summaryId:e}):S(vd,{summaryId:e})}const fd=An({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),yd=Bn(Pn["financial-summary-chatbox"],An({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"}));function xd({summaryData:e}){const t=Xn(e?.summary),n=Xn(e?.conversation);return R("div",{className:fd,children:[S(dd,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),S("div",{...yd,children:S(bd,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const Td=An({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),kd=Nn({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),wd=Bn(null,An({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),Cd=An({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function Ad({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},ir({queryKey:(t={limit:1,filter:{date:{equal:Ge(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Jl(t):["summaries",{}],queryFn:es,...n});var t,n}(t),o=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${ka.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${wa.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} 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.`}():n?.summary??"A summary of this month's financials will appear here once more data is available.",a=Bn(Pn["financial-summary-layout"],kd({isSample:e}));return R("div",{className:Cd,children:[S("div",{"data-testid":"financial-summary-layout",...a,children:!e&&r?S(od,{}):R("div",{className:Td,children:[S(ed,{stylists:[wd],children:o}),e&&S(Ta,{size:"lg"})]})}),S(xd,{summaryData:n})]})}const Ed=Bn(Pn["month-picker"],An({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),Id=Bn(Pn["month-picker-left-button"],An({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),Sd=Bn(Pn["month-picker-right-button"],An({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),Nd=Bn(Pn["month-picker-label"],An({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function Rd({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const o=Ze(e.year,e.month,1),a=wt(o,{abbreviateMonth:!0});return R("div",{...Ed,children:[S(vs,{stylists:[Id],onClick:()=>{return t(0===(n=e).month?{month:11,year:n.year-1}:{month:n.month-1,year:n.year});var n},disabled:r,children:S(Yi,{Component:Hi})}),S("div",{...Nd,children:S(Vo,{children:a})}),S(vs,{stylists:[Sd],onClick:()=>{return t(11===(n=e).month?{month:0,year:n.year+1}:{month:n.month+1,year:n.year});var n},disabled:n,children:S(Yi,{Component:qi})})]})}const Pd=An({display:"flex",flexWrap:"wrap",justifyContent:"center",rowGap:"10px",columnGap:"max(10px, calc(50% - 600px))",maxWidth:"1440px",width:"100%"});function Dd({children:e}){return S("div",{className:Pd,children:e})}const Ld=Nn({variants:{color:{positive:{backgroundColor:"money.positive.weak"},negative:{backgroundColor:"money.negative.weak"}}}}),Md=Bn(Pn["progress-bar"],An({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),Od=Bn(Pn["progress-bar-fill"],An({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),Fd=Bn(Pn["tile-bar-label"],An({paddingLeft:"10px"})),Bd=Bn(Pn["tile-bar-label-outer"],An({paddingLeft:"10px"}));function Ud({label:e="",percentage:t,color:n,width:r}){const o=void 0===r?"100%":`${r}px`,a=t>=50,i="positive"===n?Pn["bar-transactions-positive"]:Pn["bar-transactions-negative"],l=Bn(i,Ld({color:n})),s=qn([Od,l]);return R("div",{...Md,style:{width:o},children:[S("div",{...s,style:{width:`${t}%`},children:a&&S("div",{...Fd,children:S(Ss,{children:e})})}),!a&&S("div",{...Bd,children:S(Ss,{children:e})})]})}const Vd=Bn(Pn["metric-md"],jn({metric:"md"}));function Wd(e){return S("div",{...Vd,children:e.children})}const Hd=Bn(null,An({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),qd=Bn(null,An({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),jd=({label:e,amount:t,total:n,color:r})=>{const o=n>0?function(e,t,n,r=0,o=100){return r+(e-t)*(o-r)/(n-t)}(t,0,n):0;return R("div",{...Hd,children:[S(Ud,{label:e,percentage:o,color:r}),S("div",{...qd,children:S(Wd,{children:Fo(t)})})]})},zd={netIncome:0,income:0,expenses:0,absoluteSum:0},_d=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return zd;const t=e.json?.data?.[0];if(Zn(t))return zd;const n=t.income?.total??0,r=t.expenses?.total??0,o=U(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:o}},Kd=Wi(e=>p.createElement("svg",{stroke:"#000000",width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),p.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),p.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}),p.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");function Yd({Component:e,stylists:t}){return S(e,{stylists:[Bn(Pn["medium-icon"],Pn.icon),...t??[]],size:15})}const Zd={},Xd=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return Zd[e]={loading:!1,error:null,scriptEl:t}},Qd="undefined"!=typeof window&&void 0!==window.document;function Gd({src:e,checkForExisting:t=!1,...n}){let r=Zd[e];!r&&t&&e&&Qd&&(r=Xd(e));const[o,a]=y(r?r.loading:Boolean(e)),[i,l]=y(r?r.error:null),[s,c]=y(!1);return T(()=>{if(!Qd||!e||s||i)return;let o;r=Zd[e],!r&&t&&(r=Xd(e)),r?o=r.scriptEl:(o=document.createElement("script"),o.src=e,Object.keys(n).forEach(e=>{void 0===o[e]?o.setAttribute(e,n[e]):o[e]=n[e]}),r=Zd[e]={loading:!0,error:null,scriptEl:o});const d=()=>{r&&(r.loading=!1),a(!1),c(!0)},u=e=>{r&&(r.error=e),l(e)};return o.addEventListener("load",d),o.addEventListener("error",u),document.body.appendChild(o),()=>{o.removeEventListener("load",d),o.removeEventListener("error",u),r&&r.loading&&(o.remove(),delete Zd[e])}},[e]),[o,i]}function Jd(e){return no(`${t=e,ro[t]}/v1`,"v1");var t}async function $d({institutionId:e,accessToken:t,environment:n}){if(!t)throw new Error("Access token is required to get Plaid item institution");const r={path:"/banks2/bankUrl",accessToken:t,endpointManager:Jd(n)},{url:o,headers:a}=Gr(r);return await al({url:o,includeCredentials:!0,extraHeaders:a,params:e?{institutionId:e}:void 0})}const eu=Bn(Pn["button-danger"],An({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{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"}}));function tu({children:e,stylists:t=[],...n}){return S(gs,{stylists:[eu,...t],...n,children:e})}const nu=Bn(Pn["button-tertiary"],An({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"},_supportHover:{_notDisabled:{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"}}}));function ru({children:e,stylists:t=[],...n}){return S(gs,{stylists:[nu,...t],...n,children:e})}const ou="cancel",au="danger",iu="success",lu=Nn({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),su=Nn({base:{background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",gap:"16px"},variants:{size:{sm:{maxWidth:"360px",minWidth:"0",margin:"32px"},md:{maxWidth:"600px",minWidth:"400px",margin:"32px"},lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},margin:{sm:"32px",base:"0"},height:{sm:"auto",base:"100dvh"}}},padding:{none:{padding:"0"},sm:{padding:"8px"},md:{padding:"16px"},lg:{padding:"24px"}}},defaultVariants:{size:"sm",padding:"md"}}),cu={transform:"none",willChange:"auto"};function du({show:e,role:t="dialog",children:n,size:r="sm",padding:o="md",outsidePress:a=!1,escapeKey:i=!0,className:l}){const{context:s}=te({open:e,strategy:"fixed"}),c=se(s,{outsidePress:a,escapeKey:i}),d=ce(s,{role:t}),{getFloatingProps:u}=de([c,d]),h=[su({size:r,padding:o}),l].filter(Boolean).join(" ");return e?S(ve,{children:S(me,{lockScroll:!0,className:lu(),children:S(be,{context:s,modal:!0,returnFocus:!0,children:S("div",{...u(),className:h,style:cu,children:n})})})}):null}const uu=An({display:"flex",justifyContent:"flex-end",gap:"8px"}),hu="success",pu="danger",gu=fe.createConfirmation(ye(function({show:e,proceed:t,title:n,body:r,buttons:o=[{key:"ok",type:"default",label:"OK"}]}){return R(du,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:Pn["alert-dialog"],children:[S(Vo,{wrap:"wrap",stylists:[Bn(Pn["alert-header"])],children:n}),r&&"string"==typeof r?S(Ss,{wrap:"wrap",children:r}):S(N,{children:r}),S("div",{className:uu,children:o.map(e=>{const n=(e=>{switch(e){case pu:return tu;case hu:return ru;default:return vs}})(e.type);return S(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:S(Vo,{children:e.label})},e.key)})})]})}));function mu(e,t,n,r){const o=1===n?e:t;return r?`${n} ${o}`:o}const vu=e=>Ml("Conversation",{routeProps:{conversationId:null,defaultValues:e}}),bu=An({display:"flex",flexDirection:"column",gap:"12px"});async function fu(e){await gu({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:ou,label:"Cancel"},{key:iu,label:"Chat",type:hu}]})===iu&&vu({message:{text:`Please help me with my bank issue (code: ${e}). Thanks!`,attachments:[]}})}const yu=e=>{const t=e?.status?"DELETED"===e.status?"REMOVED":e.status:"ACTIVE",n="MORTGAGE"!==e?.apiType&&"BROKERAGE"!==e?.apiType&&e?.apiType?e.apiType:"OTHER";return{iconUrl:"",...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:ui({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:ui({id:e.plaidItemId||e.oauthAccountId,prefix:"INTEGRATION"}),apiInstitutionId:e.apiInstitutionId??null},mask:e.apiMask??"",beginningBalanceData:{},isSupported:e.isSupported||!1,tranStartDate:e.tranStartDate||null,tranMinStartDate:e.tranMinStartDate||null,latestTransactionDate:e.latestTransactionDate||null,accountBalance:e.apiCurrentBalance||null}},xu=Bn(Pn["button-secondary"],An({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"},_supportHover:{_notDisabled:{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"}}}));function Tu({children:e,stylists:t=[],...n}){return S(gs,{stylists:[xu,...t],...n,children:e})}function ku({mutationFn:e,onMutateFn:t,...n}){const r=er(),o=ar(),a=!Gn(r);return O({...n,mutationFn:a?t=>e({data:t,accessToken:r,environment:o}):tr,onMutate:a&&Xn(t)?e=>t({data:e,accessToken:r,environment:o}):void 0},rr)}const wu=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:io(n)};return await to(r)},Cu=async({data:e,accessToken:t,environment:n})=>wu({data:e,accessToken:t,environment:n}),Au=async({data:e,accessToken:t,environment:n})=>wu({data:e,accessToken:t,environment:n}),Eu=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/accounts",bodyParams:{accounts:e.accounts},accessToken:t,endpointManager:io(n)};return await to(r)})({data:{accounts:e},accessToken:t,environment:n});function Iu(e){return ku({onSuccess:async()=>{jr("mutation successful, invalidating bank account queries");try{return rr.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&zr({error:e,severity:"error"})}},...e})}function Su(){return Iu({mutationFn:Au})}function Nu(){return ku({onSuccess:async()=>{jr("mutation successful, invalidating bank account queries");try{return rr.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&zr({error:e,severity:"error"})}},mutationFn:Eu})}const Ru=An({display:"flex",flexDirection:"column",gap:"16px"}),Pu=async()=>gu({title:"Merge Accounts",body:R("div",{className:Ru,children:[S(Ss,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),S(Ss,{wrap:"wrap",children:"This action can't be undone."}),S(Ss,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:ou,label:"Cancel"},{key:au,label:"Continue",type:pu}]}),Du=()=>gu({title:"Merge Failed",body:S(Ss,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:ou,label:"OK"}]}),{formContext:Lu,fieldContext:Mu,useFieldContext:Ou,useFormContext:Fu}=xe(),Bu=Wi(e=>p.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{id:"icon/check"},p.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"currentColor",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function Uu({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return R(ru,{type:"submit",disabled:n,children:[e&&S(Yi,{Component:Bu}),S(Vo,{children:t})]})}const Vu=Bn(null,An({display:"flex",width:{xl:"auto",base:"100%"}}));function Wu({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return R(Tu,{type:"submit",disabled:n,stylists:[Vu],children:[e&&S(Yi,{Component:Bu}),S(Vo,{children:t})]})}const Hu=Nn({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function qu({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=Bn("vertical"===e?Pn["vertical-divider"]:Pn["horizontal-divider"],n,Hu({alignment:e,color:t}));return S("div",{...r})}const ju=Bn(null,An({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",backgroundColor:"surface.foreground",minHeight:"48px",xl:{flexDirection:"row",justifyContent:"flex-end"}}));function zu({children:e,showIcon:t=!0,textContent:n="Save",disabled:r=!1}){return R(N,{children:[S(qu,{alignment:"horizontal",color:"normal"}),S("div",{...ju,children:e??S(Wu,{showIcon:t,textContent:n,disabled:r})})]})}const _u=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Ku=[Bn(null,An({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Yu=Bn(null,An({display:"flex",alignItems:"center",gap:"4px"}));function Zu({errorMessage:e}){return R("div",{...Yu,children:[S(Yd,{Component:_u,stylists:Ku}),S(Ho,{intent:"danger",wrap:"wrap",children:e})]})}const Xu=An({display:"flex",flexDirection:"column",padding:"16px 16px",cursor:"pointer",outline:"none",gap:"8px",borderRadius:"md",border:"1px solid {colors.border.layout}","&[data-state='closed'][data-disablehover='false']":{_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"}},"&[data-state='open']":{backgroundColor:"surface.intent.action.discreet.active"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Qu=An({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Gu=An({display:"flex",flexDirection:"column",gap:"8px"}),Ju=An({display:"flex",justifyContent:"space-between",alignItems:"center"});function $u({children:e,inputRef:t,popupTriggerProps:n,label:r,isDefaultValue:o,isTouched:a,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p,hasErrorStyles:g}){const m=Bn(i||null,Xu,l,Qu,zi),[v,b]=y(!0);return R("div",{className:Gu,children:[R("div",{className:Ju,children:[void 0!==r&&S(Ss,{children:r}),Xn(p)&&S(Ss,{children:`${p}`})]}),S("div",{...m,onClick:s,...n,onMouseDown:e=>{b(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{b(!1),c?.()},"data-clicked":v,"data-isdefaultvalue":o,"data-haserror":a&&void 0!==d||g,"data-disablehover":u,children:e}),a&&d&&S(Zu,{errorMessage:d})]})}const eh=An({border:"{borderWidths.lg} solid transparent",backgroundColor:"surface.foreground.disabled","&:focus-within, &[data-isdefaultvalue='false']":{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout"},"&:focus-within":{cursor:"text"}});function th({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:o}){const a=Ou(),i=Te(a.store,e=>e.meta.errors[0]?.message),l=Te(a.store,e=>e.meta.isDefaultValue),s=Te(a.store,e=>e.meta.isTouched);return S($u,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:Pn["discreet-form-input"],additionalStyles:eh,errorMessage:i,onClick:o,onBlur:a.handleBlur,children:e})}function nh(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function rh(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function oh(e){"Enter"===e.key&&e.currentTarget.blur()}const ah=Bn(Pn["amount-input"],jn({label:"default"}),An({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),ih=Bn(null,An({display:"flex",alignItems:"center",gap:"2px"}));function lh({value:e,onChange:t,inputRef:n,onClick:r,onBlur:o,autofocus:a=!1}){return R("div",{...ih,children:[S(Ss,{children:"$"}),S(we,{...ah,getInputRef:n,thousandSeparator:!0,decimalScale:2,value:Zn(e)?"":e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:r,onBlur:o,onKeyDown:oh,autoFocus:a})]})}const sh=An({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout"}),ch=Nn({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function dh({kind:e,label:t,children:n,inputRef:r,disabled:o,popupTriggerProps:a,onClick:i,disableHover:l=!1,type:s,maxLength:c,hasErrorStyles:d}){const u=Ou(),h=Te(u.store,e=>e.meta.errors[0]?.message),p=Te(u.store,e=>e.meta.isTouched),g="string"==typeof u.state.value?u.state.value.length:0,m=Xn(c)?c-g:void 0,v=o?sh:ch({kind:e});return S($u,{label:t,inputRef:r,popupTriggerProps:a,className:Pn["editable-form-input"],additionalStyles:v,errorMessage:h,onBlur:u.handleBlur,disableHover:l,onClick:i,type:s,isTouched:p,remainingChars:m,hasErrorStyles:d,children:n})}const uh=Bn(null,An({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function hh({options:e,onSelect:t,selectedLabel:n}){const r=zs();return S("div",{...uh,children:e.map(e=>S(rc,{onClick:()=>{return n=Number(e.value),r.close(),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const ph=Wi(e=>p.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2922)"},p.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_9779_2922"},p.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),gh=Bn(null,An({cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderRadius:"sm",gap:"7px",backgroundColor:"surface.intent.action.discreet",border:"{borderWidths.lg} solid transparent",_supportHover:{backgroundColor:"surface.intent.action.discreet.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),ji);function mh({selectedLabel:e,options:t,onSelect:n}){return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>R("div",{...gh,...t,children:[S(Vo,{children:e}),S(Ys,{Component:ph})]})}),S(tc,{children:S(hh,{options:t,onSelect:n,selectedLabel:e})})]})}const vh=Bn(null,An({display:"flex",alignItems:"center",gap:"15px"})),bh=ut.map((e,t)=>({value:t,label:e})),fh=ht({}).map(e=>({value:e,label:String(e)}));function yh({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),o=(e,n)=>{const r=new Date(e,n,1);t(r)};return R("div",{...vh,children:[S(mh,{selectedLabel:ut[r],options:bh,onSelect:e=>o(n,e)}),S(mh,{selectedLabel:String(n),options:fh,onSelect:e=>o(e,r)})]})}const xh=Bn(null,An({background:"surface.foreground",padding:"25px",gap:"15px"})),Th=Bn(null,An({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),kh=Bn(null,An({backgroundColor:"surface.intent.action.discreet",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discreet.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),ji),wh=Bn(null,An({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),Ch=Bn(null,An({padding:"8px",textAlign:"center"})),Ah=Bn(null,An({backgroundColor:"surface.intent.action.discreet",border:"{borderWidths.lg} solid transparent",padding:"6px",width:"36px",height:"36px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",cursor:"pointer",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discreet.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}},"&[data-selected='true']":{backgroundColor:"surface.intent.action.discreet.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"}}),ji),Eh=Bn(null,An({color:"typography.base"}));function Ih({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:o,minDate:a}){const i=t&&pt(e,t),l=gt(e),s=e.getMonth()!==n,c=!!o&&mt(e,o),d=!!a&&mt(a,e);return S("button",{...Ah,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:S(Vo,{stylists:s||c||d?[Eh]:[],children:e.getDate().toString()})})}function Sh({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:o,minDate:a}){const i=zs(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=Ze(e,t,1),r=new Date(n);return r.setDate(r.getDate()-n.getDay()),Array.from({length:42},(e,t)=>{const n=new Date(r);return n.setDate(r.getDate()+t),n})}(s,c),u=(h=d)[h.length-1];var h;const p=void 0===o||u&&mt(o,u),g=Zn(a)||d.length>0&&mt(d[0],a),m=e=>{t(e),i.close()},v=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return R("div",{...xh,children:[R("div",{...Th,children:[S("button",{...kh,onClick:()=>v(-1),disabled:!g,children:S(Yi,{Component:Hi})}),S(yh,{currentMonthYear:l,onMonthYearChange:r}),S("button",{...kh,onClick:()=>v(1),disabled:!p,children:S(Yi,{Component:qi})})]}),R("div",{...wh,children:[dt.map(e=>S("div",{...Ch,children:S(Ho,{children:e})},e)),d.map(t=>S(Ih,{date:t,selectedDate:e,currentMonth:c,onClick:m,maxDate:o,minDate:a},t.toISOString()))]})]})}const Nh=Bn(null,jn({label:"default"}),An({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),Rh=Bn(null,jn({body:"default"}),An({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"}}));function Ph(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const Dh=async({data:e,accessToken:t,environment:n})=>{const{file:r,entity:o,caption:a,entityId:i}=e,l=io(n).getUrl(`/files/upload/${o}`),s=Gn(a)?"att_"+i:a,c=new FormData;return c.append("file",r),c.append("caption",s),c.append("entityId",String(i)),(await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`},credentials:"include",body:c})).json()},Lh=async({data:e,accessToken:t,environment:n})=>{const r=io(n).getUrl("/files/attachment");return(await fetch(r,{method:"DELETE",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:e.id})})).json()};const Mh=An({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Oh=/* @__PURE__ */new Set(["pdf","xls","xlsx","csv","txt","jpg","jpeg","png","gif","heic","jfif","tif","tiff","svg","webp"]),Fh=[...Oh].map(e=>`.${e}`).join(","),Bh=/* @__PURE__ */new Set(["xls","xlsx","csv"]),Uh=[...Oh].map(e=>e.toUpperCase()).join(", ");function Vh(e,t,n){const r=e.name.split("."),o=r.length>=2?r[r.length-1].toLowerCase():void 0;return o&&Oh.has(o)?e.size>52428800?"File exceeds the 50MB size limit."+(Bh.has(o)?" Try splitting it into smaller parts.":""):t.some(t=>t.name===e.name&&t.size===e.size)||n.has(`${e.name}:${e.size}`)?"File has already been attached. To replace it, delete the existing file first.":void 0:`Unsupported file type. Please upload a ${Uh} file.`}const Wh=({onFileSelect:e,onUploadComplete:t,existingAttachments:n=[]})=>{const r=g(null),{mutateAsync:o,isPending:a}=ku({mutationFn:Dh,onSuccess:async()=>rr.invalidateQueries({queryKey:["files/attachments"]})}),i=x(()=>{r.current?.click()},[]),l=x(async a=>{const i=Array.from(a.target.files??[]);if(0===i.length)return;const l=/* @__PURE__ */new Set,s=[],c=[];for(const e of i){const t=crypto.randomUUID(),r=Vh(e,n,l);r?s.push({localId:t,name:e.name,size:e.size,id:null,isPending:!1,error:r}):(s.push({localId:t,name:e.name,size:e.size,id:null,isPending:!0}),c.push({localId:t,file:e,name:e.name,size:e.size}),l.add(`${e.name}:${e.size}`))}e?.(s);try{if(c.length>0){const e=s.filter(e=>!e.error),n=c.map(async({localId:e,file:t})=>({localId:e,result:await o({file:t,entity:"message",caption:t.name,entityId:null})})),r=(d=e,u=await Promise.allSettled(n),d.map(({localId:e,name:t,size:n})=>{const r=u.find(t=>"fulfilled"===t.status&&t.value.localId===e);if(r&&"fulfilled"===r.status){const o=r.value.result?.attachment?.id??null;return{localId:e,name:t,size:n,id:o,isPending:!1}}return{localId:e,name:t,size:n,id:null,isPending:!1}}));t?.(r)}}finally{r.current&&(r.current.value="")}var d,u},[n,e,t,o]);return R("div",{children:[S("input",{type:"file",multiple:!0,accept:Fh,ref:r,onChange:l,style:{display:"none"}}),S(vs,{type:"button",onClick:i,disabled:a,children:S("span",{className:Mh,children:S(Yd,{Component:bc})})})]})},Hh=h.object({localId:h.string(),id:h.number().nullable(),name:h.string(),size:h.number(),isPending:h.boolean()}),qh=h.object({message:h.object({text:h.string(),attachments:h.array(Hh)}).refine(e=>e.text.trim().length>0||e.attachments.some(e=>null!==e.id),{message:"Either message text or attachments are required"})}),jh=An.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),zh=An.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"}),_h=An(zh,jh),Kh=An.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Yh=An(Kh,jh,jn.raw({body:"default"})),Zh=An({display:"block",width:"100%"}),Xh=An({position:"relative"}),Qh=An({display:"flex",justifyContent:"flex-end",gap:"15px"}),Gh=An({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Jh=w(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n,onFileSelect:r,onUploadComplete:o,hideFileUpload:a},i){const l=Ou(),s=g(null),{startCallback:c}=cl({delay:50,callback:e=>n(e)});C(i,()=>s.current);const d=!e&&qh.safeParse(l.form.state.values).success;return S(dh,{kind:"text",inputRef:s,disableHover:!0,onClick:()=>(Ph(t),void c(!0)),children:R("div",{className:Zh,children:[R("div",{className:Xh,children:[R("pre",{className:_h,children:[l.state.value.text,S("br",{})]}),S("textarea",{ref:s,placeholder:"Message...",value:l.state.value.text,className:Yh,onChange:e=>l.handleChange({...l.state.value,text:e.target.value})})]}),R("div",{className:Qh,children:[!a&&S(Wh,{onFileSelect:r,onUploadComplete:o,existingAttachments:l.state.value.attachments}),S(vs,{disabled:!d,type:"submit",children:S("span",{className:Gh,children:S(Yd,{Component:Kc})})})]})]})})});function $h(e){return new U(e).div(100).toNumber()}function ep(e){return new U(e).times(100).toNumber()}const tp=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,np=e=>{const t=e?.description;return`${t} | ${Bo($h(Number(e?.amount)))} | ${vt(yt(e?.date||""))}`},rp=v(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function op(e,t){switch(t.type){case"increment":return((e,t)=>{let n;if(null===e.focusedIndex)n=0;else{const r=e.focusedIndex+1;n=!t.repeat&&r>e.maxIndex?0:Math.min(r,e.maxIndex)}return{...e,focusedIndex:n}})(e,t);case"decrement":return((e,t)=>{let n;if(null===e.focusedIndex)n=e.maxIndex;else{const r=e.focusedIndex-1;n=!t.repeat&&r<0?e.maxIndex:Math.max(r,0)}return{...e,focusedIndex:n}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function ap(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ip(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.top>=n.top&&r.bottom<=n.bottom&&r.left>=n.left&&r.right<=n.right}function lp(e,t,n){if(null===e)return{node:void 0,metadata:void 0};const r=t[e];return{node:r,metadata:n.get(r)}}function sp(e){const[t,n]=y(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:o,isMousing:a,isScrolling:i}=function(e,t){const n=g(null),[r,o]=y(!0),[a,i]=y(!1),l=b(rp),[s,c]=A(op,{focusedIndex:null,maxIndex:e});T(()=>{const e=n.current,t=()=>{Zn(s.focusedIndex)&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[n,s.focusedIndex,c,l?.popupNodeId]);const d=g(null);return T(()=>{c({type:"max",max:e})},[e]),T(()=>{const e=n.current;if(null!==e){const n=e=>{i(!1);const n=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!n)return;const r=Number(e.target.getAttribute("data-index"));s.focusedIndex===r&&d.current===e.target||(0!==e.movementX||0!==e.movementY)&&n&&(o(!0),d.current=e.target,c({type:"set",focusedIndex:r}),t.setCascadeState(!0,r))},r=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,n="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;o(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):n&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},a=()=>i(!0);return e.addEventListener("mousemove",n),e.addEventListener("keydown",r),e.addEventListener("scroll",a),()=>{e.removeEventListener("mousemove",n),e.removeEventListener("keydown",r),e.removeEventListener("scroll",a)}}},[t,s.focusedIndex]),{listRef:n,focusedState:s,isMousing:r,isScrolling:a}}(t.size-1,e),l=zs(),s=x((e,t)=>{n(n=>new Map(n).set(e,t??null))},[]),c=x(e=>{n(t=>{const n=new Map(t);return n.delete(e),n})},[]),{sortedNodes:d,sortedMap:u}=function(e,t){const n=m(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(ap)),n},[e,t]),r=m(()=>{const t=/* @__PURE__ */new Map;return n.forEach((n,r)=>{const o=e.get(n)??{};t.set(n,{...o,index:r})}),t},[n,e]);return{sortedNodes:n,sortedMap:r}}(t,r);!function(e,t,n,r,o,a){T(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=lp(r,t,n),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,n){const r=e.placement.includes("left"),o=e?.popupParentNodeId,a=o&&n?.hasCascading&&r?"ArrowLeft":"ArrowRight",i=r?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:n?.hasCascading&&t.key===a,shouldCloseCascade:o&&t.key===i}}(o,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=r,g=l,m=i,v=a,!(!(h=s)||!h.hasCascading||null===p||g&&m&&ip(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),o.close())};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,r,n,o,a])}(r,d,u,o.focusedIndex,l,e);const{startCallback:h,cancelCallback:p}=cl({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&ip(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return v=o.focusedIndex,T(()=>{const e=C.current;if(null===v||f)return;const{node:t,metadata:n}=lp(v,k,w);return E.lastOpenedIndex!==v&&n?.hasCascading&&(E.closeCurrentCascade(),I({focusedIndex:v,node:t,listElement:e})),()=>S()},[v,f=a,C=r,E=e,S=p,k=d,w=u,I=h]),function(e,t,n,r){T(()=>{const{metadata:o}=lp(e,t,n);null===e||o?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(o.focusedIndex,d,u,e),m(()=>({register:s,unregister:c,map:u,focusedIndex:o.focusedIndex,listRef:r,isMousing:a,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,u,o.focusedIndex,r,a,i,l?.nodeId]);var v,f,k,w,C,E,I,S}const cp=v(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function dp({style:e,children:t}){const n=Bn(Pn["popup-list"],Us,e),r=function(){const[e,t]=y(null),[n,r]=y(!1),[o,a]=y(null),i=x((n,o)=>{n&&e!==o?(a(o),t(o)):n||e!==o||(r(!1),t(null))},[e,r]),l=x(()=>{t(null),a(null),r(!1)},[t,a,r]),s=x(()=>{t(null),a(null),r(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:n,setFocus:r,lastOpenedIndex:o,closeCurrentCascade:s}}(),o=sp(r);return S("div",{...n,onScroll:r.onScroll,ref:o.listRef,tabIndex:0,children:S(rp.Provider,{value:o,children:S(cp.Provider,{value:r,children:t})})})}function up({searchTerm:e,setSearchTerm:t,onClick:n,placeholder:r,SearchInput:o,SearchList:a,DefaultList:i,extraProps:l,listLength:s,forceSearchVisible:c}){const d=c||s>=5,u=Jn(e),h=e=>{n?.(e)};return R(N,{children:[d&&S(o,{searchTerm:e,setSearchTerm:t,placeholder:r}),d&&u?S(a,{...l??{},onClick:h,searchTerm:e}):S(i,{...l??{},onClick:h})]})}const hp=In(jn({body:"default"}),An({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent",width:325,minWidth:325,"&::placeholder":{color:"typography.base.weak"}}));function pp({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=g(null);return T(()=>{r.current?.focus({preventScroll:!0});const e=e=>{const t=document.activeElement,n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement;!r.current||document.activeElement===r.current||n||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||r.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),S("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:hp})}function gp({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:o,listLength:a,forceSearchVisible:i,getSearchActiveStyles:l}){const s=zs(),[c,d]=y(""),u=Jn(c),h=l?.(u);return S(tc,{children:S(dp,{style:h,children:S(up,{searchTerm:c,setSearchTerm:d,onClick:t=>{e?.(t),s.close()},placeholder:t,SearchInput:pp,SearchList:n,DefaultList:r,extraProps:o,listLength:a,forceSearchVisible:i})})})}function mp({hasCascading:e=!1}={}){const t=g(null),{register:n,unregister:r,map:o,focusedIndex:a,isMousing:i,listRef:l}=b(rp);E(()=>{const o=t.current;if(o)return n(o,{index:0,hasCascading:e}),()=>{r(o)}},[n,r,e]);const s=m(()=>void 0!==o&&null!==t.current?o.get(t.current)?.index??-1:-1,[o]),c=s===a;E(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=x(()=>{l?.current?.focus()},[l]),u=m(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const vp=w(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:o},a){return S("button",{...Ws,onClick:e,"data-listitem":!0,"data-index":t,...o,...r,ref:a,children:n})}),bp=w(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:o,itemProps:a,itemRef:i}=mp(),l=ge([i,r]);return S(vp,{...Ws,onClick:e,index:o,...n,itemProps:a,ref:l,children:t})});function fp({promptText:e}){return R(N,{children:[S(Yi,{Component:rs}),S(Ss,{children:e})]})}function yp({text:e}){return S("div",{...Ws,children:e?S(Vo,{children:e}):S(pa,{styles:An({width:"100%",height:"16px"})})})}const xp=Bn(Pn["popup-list"],Us),Tp=()=>R("div",{...xp,children:[S(yp,{}),S(yp,{}),S(yp,{}),S(yp,{}),S(yp,{})]});function kp({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?S(Tp,{}):R(N,{children:[r&&S(bp,{onClick:()=>Ml("BankAccountForm"),children:S(fp,{promptText:"Add bank account"})}),e?.map(e=>S(bp,{onClick:()=>t(e),children:S(Vo,{wrap:"wrap",children:si(e?.name,e?.mask)})},e?.id))]})}const wp={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1},Cp={...wp,keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}]};function Ap({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:o=!1}){const a=m(()=>new Ce(e??[],Cp),[e]),i=m(()=>e?a.search(t).map(e=>e.item):[],[e,t,a]);return r?S(Tp,{}):R(N,{children:[o&&S(bp,{onClick:()=>Ml("BanksAndIntegrations"),children:S(fp,{promptText:"Add bank account"})}),0===i.length?S(yp,{text:"No results found"}):i.map(e=>S(bp,{onClick:()=>n(e),children:S(Vo,{wrap:"wrap",children:si(e?.name,e?.mask)})},e?.id))]})}function Ep({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return S(gp,{onClick:e,placeholder:"Search bank accounts...",SearchList:Ap,DefaultList:kp,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const Ip=An({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function Sp({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:o,onClick:a}){return R(js,{placement:"bottom-start",children:[S(_s,{children:r=>S(dh,{label:e,popupTriggerProps:r,disabled:t,children:S("button",{className:Ip,type:"button",disabled:t,children:S(Ss,{children:si(n?.name??"",n?.mask??"")})})})}),S(Ep,{bankAccounts:r,isFilling:o,onClick:a,showAddButton:!0})]})}const Np=()=>["expenses/categories"],Rp=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await sl(n);return{...r,data:r.data?(o=r.data,o.map(e=>({...e,id:ui({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?ui({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var o};function Pp(e){return ir({...e,queryKey:["expenses/categories"],queryFn:Rp})}function Dp(){return Pp({select:e=>({...e,data:e.data?Op(e.data):void 0})})}function Lp(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentCategoryId){const e=t.get(n.parentCategoryId)??[];e.push(n),t.set(n.parentCategoryId,e)}return t}function Mp(e){if(0===e.length)return[];const t=Lp(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function Op(e){if(0===e.length)return[];const t=Lp(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function Fp(){return dl({prefetchFn:_a(Np,Rp)})}const Bp=e=>({id:e.id,name:e.name});function Up(e){const t=e.map(e=>e?.category?.name??e?.glAccount?.name).filter(e=>void 0!==e),n=new Set(t);return{label:mu("Category","Categories",n.size,!0),list:[...n].join(", ")}}const Vp=Bn(Pn.text,jn({label:"strongLabel"}),An({maxWidth:"100%"}),To);function Wp({children:e,stylists:t=[]}){const n=qn([Vp,...t]);return S("div",{...n,children:e})}const Hp={keys:[{name:"name"}],threshold:.1};function qp(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}function jp(e,t){const n=[];return e.forEach(e=>{const r=e.item,o=(l=r,t.find(e=>e.children?.some(e=>e.id===l.id))),a=!(o||0!==r?.children?.length&&r.children),i=!o&&r.children&&r.children.length>0;var l;o?qp(o,r,n):a?qp(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{qp(e,n,t)})}(r,n)}),n}const zp=Bn(null,An({whiteSpace:"normal"})),_p=[Bn(null,An({marginLeft:"6px",marginRight:"6px"}))];function Kp({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:o}=Pp({select:e=>({...e,data:e.data?Mp(e.data):void 0})}),a=n?.data,i=!o&&r&&(void 0===a||0===a.length),l=m(()=>new Ce(a??[],Hp),[a]),s=m(()=>a?jp(l.search(e),a):[],[a,e,l]);return o?S(Tp,{}):i?S(yp,{text:"No data"}):0===s.length?S(yp,{text:"No results found"}):S(N,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return R(bp,{onClick:()=>t(Bp(n)),children:[S("img",{src:n.iconUrl,alt:"",width:"15px",height:"15px"}),S(Wp,{stylists:[zp],children:r?n.name:R(N,{children:[e.name,S(Yi,{Component:qi,stylists:_p}),n.name]})})]},`${e.id}_${n.id}`)})})}const Yp=w(function({index:e,popupTriggerProps:t,children:n,itemProps:r},o){const a=ge([o,t?.ref]);return S(vp,{index:e,ref:a,itemProps:r,popupTriggerProps:t,children:n})});function Zp({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:o}=b(cp),{itemRef:a,index:i,itemProps:l}=mp({hasCascading:!0}),{isScrolling:s}=b(rp);return R(js,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[S(_s,{children:t=>S(Yp,{itemProps:l,index:i,ref:a,popupTriggerProps:t,children:e})}),S(tc,{initialFocus:o,children:t})]})}const Xp=An({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}),Qp=An({display:"flex",gap:"8px"});function Gp({icon:e,iconUrl:t,displayLabel:n}){return R("div",{className:Xp,children:[R("div",{className:Qp,children:[e,Zn(e)&&t&&S("img",{src:t,alt:"",width:"15px",height:"15px"}),S(Vo,{wrap:"wrap",children:n})]}),S(Yi,{Component:qi})]})}function Jp({category:e,handleCategoryChange:t}){return S(dp,{children:e.children?.map(e=>R(bp,{onClick:()=>t(Bp(e)),children:[S("img",{src:e.iconUrl,alt:"",width:"15px",height:"15px"}),S(Vo,{wrap:"wrap",children:e.name})]},e.id))})}function $p({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=Dp(),o=t?.data,a=!r&&n&&void 0===o;return r?S(Tp,{}):a?S(yp,{text:"No data"}):S(N,{children:o?.map(t=>t.hasChilds?S(Zp,{triggerChildren:S(Gp,{displayLabel:t.name,iconUrl:t.iconUrl}),popupChildren:S(Jp,{category:t,handleCategoryChange:e})},t.id):R(bp,{onClick:()=>e(Bp(t)),children:[S("img",{src:t.iconUrl,alt:"",width:"15px",height:"15px"}),S(Vo,{wrap:"wrap",children:t.name})]},t?.id))})}const eg=({onClick:e})=>{const{query:{data:t}}=Dp();return S(gp,{onClick:e,placeholder:"Search expense categories...",SearchList:Kp,DefaultList:$p,listLength:(t?.data??[]).length})},tg=Bn(Pn["category-text"],An({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",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),_i),ng=Bn(null,An({color:"inherit"})),rg=Bn(Pn["amount-input-container"],An({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{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"}}),_i),og=()=>["accounting/glAccounts"],ag=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await sl(n);return cg(r)};function ig(e){return ir({...e,queryKey:["accounting/glAccounts"],queryFn:ag})}function lg(){return ig({select:hg})}function sg(){return ig({select:pg})}const cg=e=>e.map(e=>({...e,id:ui({id:e.id,prefix:"GL_ACCOUNT"})}));function dg(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>dg(e,t))}const ug=e=>!e.parentAccountNo;function hg(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const n of e)if(n.parentAccountNo){const e=t.get(n.parentAccountNo)??[];e.push(n),t.set(n.parentAccountNo,e)}return t}(e);return e.filter(ug).map(e=>({...e,children:dg(e,t)}))}function pg(e){return hg(e).flatMap(e=>[e,...e.children])}const gg=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function mg(e,t){return m(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const vg=An({display:"grid",textWrap:"nowrap",width:"100%"});function bg({children:e,rows:t,cols:n}){return S("div",{className:vg,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const fg=Nn({base:{minWidth:0,borderRadius:"zero",border:"1px solid",borderColor:"border.layout",_hover:{zIndex:1},_focus:{zIndex:2}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}},corners:{rounded:{_first:{borderTopLeftRadius:"sm",borderBottomLeftRadius:"sm"},_last:{borderTopRightRadius:"sm",borderBottomRightRadius:"sm"}}}}});function yg({option:e,handleClick:t,selected:n,width:r,backgroundColor:o,corners:a}){const i=Bn(Pn["button-group"],In(fg({width:r,backgroundColor:o,corners:a}),is,os,as,ji));return void 0===e?null:S("button",{type:"button",...i,onClick:()=>t(e),"data-active":n?.value===e.value,children:n?.value===e.value?S(Vo,{wrap:"wrap",textAlign:"center",children:e.label}):S(Ss,{wrap:"wrap",alignment:"center",children:e.label})})}function xg({options:e,handleClick:t,selected:n,rows:r,cols:o}){return S(bg,{rows:r,cols:o,children:e?.map(e=>S(yg,{option:e,handleClick:t,selected:n},e.value))})}function Tg({options:e}){const t=zs(),n=Ou();return S(tc,{children:S(dp,{children:e.map(e=>S(bp,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.close()},children:S(Ss,{children:e.label})},e.value))})})}const kg=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),wg=Bn(null,An({color:"typography.base.weak"})),Cg=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Ag=An({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),Eg=e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),Ig=Wi(Eg,"Bank",{styleIconKey:"bank"}),Sg=Nn({base:{display:"flex",flexDirection:{base:"row",sm:"column"},alignItems:{base:"center",sm:"start"},justifyContent:"flex-start",textAlign:"start",gap:"4px",maxWidth:"100%",flexWrap:"wrap",minWidth:0},variants:{active:{true:{flexDirection:"column-reverse",alignItems:"start"},false:{flexDirection:{base:"column"},alignItems:{base:"start"}}}}});function Ng({accountName:e,accountNo:t,syncText:n,active:r=!0}){const o=t?si(e,t):e;return R("div",{className:Sg({active:r}),children:[n&&S(Ho,{intent:r?"normal":"weak",children:n}),S(Ss,{wrap:"ellipsis",intent:r?"default":"weak",children:o})]})}const Rg=e=>["plaidInstitutionLogo",e??{}];function Pg(e){const t=er(),n=ar();return L({queryKey:Rg({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await $d({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const Dg=An({display:"flex",gap:"10px",maxWidth:"100%"});function Lg({accountName:e,accountNo:t,institutionId:n,syncText:r,active:o=!0,showIcon:a=!0}){const i=Pg(n);return R("div",{className:Dg,children:[i&&a?S("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):S(Hc,{Component:Ig}),S(Ng,{accountName:e,accountNo:t,active:o,syncText:r})]})}const Mg=An({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function Og({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return S(vs,{...r,disabled:n,width:"fill-parent",children:S(Wp,{children:e?si(e.name,e.mask):R("div",{className:Mg,children:[S(Ss,{children:t}),S(Yi,{Component:rs})]})})})}const Fg="TRIGGER_ACCOUNT",Bg="FORM_SELECTABLE_ACCOUNT",Ug=An({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function Vg({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:o,warningMessage:a}){return R("div",{className:Ug,children:[R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(Og,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===Fg?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),S(Ep,{bankAccounts:r,isFilling:o,onClick:t})]}),a&&S(Zu,{errorMessage:a})]})}const Wg=(e,t,n)=>{if(!n)return;const r=e===Bg?t:n,o=e===Bg?n:t,a=(i=r?.mask,l=o?.mask,!i||!l||i!==l);var i,l;const s=(c=r?.apiName,d=o?.apiName,yi(c)&&fi(d));var c,d;const u=(h=r?.status,p=o?.status,"ACTIVE"===h&&"INACTIVE"===p);var h,p;return a?"Selected account number does not match destination account number":s?"Merging a linked account into a manually tracked account may result in duplicate transactions":u?"You selected an active account to be merged into an archived account":void 0},Hg=An({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),qg=An({display:{base:"block",sm:"none"}}),jg=An({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),zg=An({display:"flex",justifyContent:"center",alignItems:"center"}),_g=An({display:{base:"none",sm:"block"}}),Kg=An({display:{base:"block",sm:"none"}});function Yg({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:o}){const a=n&&n.length>0;return R("div",{className:Hg,children:[R("div",{className:jg,children:[a?S(Vg,{selectedAccount:t,setSelectedAccount:o,mergeDestination:Fg,bankAccounts:n,isFilling:r,warningMessage:Wg(Fg,e,t??null)}):S(Og,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),R("div",{className:zg,children:[S("div",{className:_g,children:S(Yd,{Component:qi})}),S("div",{className:Kg,children:S(Yd,{Component:ph})})]}),S(Lg,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""})]}),S("div",{className:qg,children:S(qu,{alignment:"horizontal"})})]})}const Zg=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await sl(n),o=void 0!==r.data?r.data.map(e=>({...e,id:ui({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:o}};function Xg(){return ir({queryKey:["expenses/vendors"],queryFn:Zg})}const Qg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:io(n)};return await to(r)},Gg=In(jn({body:"default"}),An({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),Jg=An({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),$g=Bn(Pn["button-inline"],An({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"}));function em({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:o,inputRef:a}){return R("div",{className:Jg,children:[S("input",{ref:a,type:"text",placeholder:e,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r()):"Escape"===e.key&&(e.preventDefault(),o())},onFocus:e=>{e.stopPropagation()},className:Gg}),S("button",{type:"button",onClick:r,...$g,children:S(Ho,{children:"Add"})})]})}function tm({promptText:e,placeholderText:t,onSubmit:n}){const[r,o]=y(!1),[a,i]=y(""),l=g(null);return T(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),S(bp,{onClick:r?void 0:()=>{o(!0)},children:r?S(em,{placeholder:t,value:a,onChange:i,onSubmit:()=>{a.trim()&&(n(a.trim()),i(""),o(!1))},onCancel:()=>{i(""),o(!1)},inputRef:l}):S(fp,{promptText:e})})}function nm({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:o}){const a=m(()=>new Ce(e??[],wp),[e]),i=m(()=>e?a.search(t).map(e=>e.item):[],[e,t,a]);return r?S(Tp,{}):R(N,{children:[S(tm,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:o}),0===i.length?S(yp,{text:"No results found"}):i.map(e=>S(bp,{onClick:()=>n(e),children:S(Ss,{children:e.name})},e.id))]})}function rm({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?S(Tp,{}):R(N,{children:[S(tm,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>S(bp,{onClick:()=>t(e),children:S(Ss,{children:e.name})},e.id))]})}function om({onClick:e}){const{query:{data:t,isLoading:n}}=Xg(),{mutate:r}=ku({mutationFn:Qg,onSuccess:async()=>rr.invalidateQueries({queryKey:["expenses/vendors"]})}),o=t?.data??[];return S(gp,{onClick:e,placeholder:"Search vendors...",SearchList:nm,DefaultList:rm,extraProps:{vendors:o,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:o.length})}const am=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await sl(n),o=void 0!==r.data?r.data.map(e=>({...e,id:ui({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:o}};function im(){return ir({queryKey:["clientMgmt/clients"],queryFn:am})}const lm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:io(n)};return await to(r)};function sm({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:o}){const a=m(()=>new Ce(e??[],wp),[e]),i=m(()=>e?a.search(t).map(e=>e.item):[],[e,t,a]);return r?S(Tp,{}):R(N,{children:[S(tm,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:o}),0===i.length?S(yp,{text:"No results found"}):i.map(e=>S(bp,{onClick:()=>n(e),children:S(Ss,{children:e.name})},e.id))]})}function cm({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?S(Tp,{}):R(N,{children:[S(tm,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>S(bp,{onClick:()=>t(e),children:S(Ss,{children:e.name})},e.id))]})}function dm({onClick:e}){const{query:{data:t,isLoading:n}}=im(),{mutate:r}=ku({mutationFn:lm,onSuccess:async()=>rr.invalidateQueries({queryKey:["clientMgmt/clients"]})}),o=t?.data??[];return S(gp,{onClick:e,placeholder:"Search customers...",SearchList:sm,DefaultList:cm,extraProps:{customers:o,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:o.length})}function um({frequencies:e,onClick:t}){const n=zs();return S(tc,{children:S(dp,{children:e.map(e=>S(bp,{onClick:()=>(t(e),void n.close()),children:S(Vo,{children:e.name})},e.value))})})}const{useAppForm:hm,withForm:pm}=ke({formContext:Lu,fieldContext:Mu,formComponents:{SaveButton:Uu,FormSaveButton:Wu,FormFooter:zu},fieldComponents:{DiscreetAmountField:function({label:e}){const t=g(null),n=Ou();return S(th,{inputRef:t,label:e,children:S(lh,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,hasErrorStyles:t,autofocus:n=!1}){const r=g(null),o=Ou();return S(dh,{inputRef:r,label:e,hasErrorStyles:t,children:S(lh,{value:o.state.value,onChange:o.handleChange,inputRef:r,autofocus:n})})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:o=!1}){const a=Ou(),i=Te(a.store,e=>e.meta.isDefaultValue),l=g(null),[s,c]=y(()=>a.state.value?yt(a.state.value):/* @__PURE__ */new Date),d=a.state.value?yt(a.state.value):null,[u,h]=y(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const o=ft(r);if(o){let e=o;t&&n?e=kt(Tt(o,t),n):t?e=Tt(o,t):n&&(e=kt(o,n)),a.handleChange(xt(e)),c(e)}else a.handleChange("")},m=u||(d?vt(d):""),[v,b]=y(!1),f=e=>{v&&(()=>{if(d&&!i){const e=ft(u);(t&&e&&mt(e,t)||n&&e&&mt(n,e))&&h(vt(d))}})(),b(e)},x=e=>{"Enter"===e.key&&(e.preventDefault(),f(!v))},T=o?dh:th;return R(js,{placement:"bottom-start",onOpenChange:f,open:v,children:[S(_s,{children:t=>S(T,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>b(!0),children:S("input",{...Nh,ref:l,type:"text",id:a.name,value:m,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:x,autoComplete:"off"})})}),S(tc,{initialFocus:!1,children:S(Sh,{selectedDate:d,onDateSelect:e=>{a.handleChange(xt(e)),h(vt(e)),c(e)},viewDate:s,onViewDateChange:c,maxDate:t,minDate:n})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:n=!1,resizeable:r=!0}){const o=Ou(),a=g(null);return S(dh,{label:e,inputRef:a,children:S("textarea",{...Rh,ref:a,value:o.state.value||"",onChange:e=>o.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:r?"both":"none"},autoFocus:n})})},MessageAreaInput:Jh,SplitExpenseCategoryField:function({value:e,onChange:t}){return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>R("button",{...tg,...t,type:"button",children:[e&&S("img",{src:e.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Vo,{stylists:[ng],children:e?.name||"Uncategorized"})]})}),S(eg,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,o]=y(!1);return S("div",{...rg,"data-clicked":r,children:S(lh,{value:e,onChange:t,onClick:()=>o(!0),onBlur:()=>(o(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Ou(),r=wi(t.id),{query:{data:o},isFilling:a}=ai({select:e=>({...e,data:Ii(e?.data)})}),i=o?.data,l=Zn(e)||!tp(e);return S(Sp,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:a})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Ou(),{query:{data:r}}=sg(),o=function(e){const{query:t}=ai({select:t=>({...t,data:ki(t.data,e)})});return t.data?.data}(t?.id),{query:{data:a},isFilling:i}=ai({select:e=>{return{...e,data:(t=e?.data,t?.filter(e=>"ACTIVE"===e.status&&e.isSupported&&e.glAccountId))};var t}}),l=a?.data,s=e?xi(e.amount):"";return S(Sp,{label:s,onClick:e=>{const t=(o=r,a=e,o?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===a.glAccountId));var o,a,i;t&&n({id:(i=t).id||"",name:i.name,accountNo:i.accountNo})},bankAccount:o,bankAccountOptions:l,isFilling:i})},ButtonGroupField:function({label:e,options:t}){const n=Ou(),r=t.find(e=>e.value===n.state.value);return S(dh,{label:e,disableHover:!0,children:S(xg,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:xg,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=Ou();return R(js,{placement:"bottom-start",children:[S(_s,{children:o=>S(dh,{label:t,popupTriggerProps:o,disabled:n,children:S("button",{...kg,type:"button",children:r.state.value?S(Vo,{children:Cg(e,r.state.value)}):S(Vo,{stylists:[wg],children:`Select ${t}...`})})})}),S(Tg,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:o="Enter value..."}){const a=Ou(),i=g(null);return S(dh,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:S("input",{className:Ag,value:a.state.value,onChange:e=>a.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:o})})},BulkMergeAccountRowField:Yg,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const o=g(null),a=r?dh:th;return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(a,{inputRef:o,label:e,popupTriggerProps:t,children:S(Ss,{intent:n?.name?"default":"weak",children:n?.name??"Select vendor"})})}),S(om,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const o=g(null),a=r?dh:th;return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(a,{inputRef:o,label:e,popupTriggerProps:t,children:S(Ss,{intent:n?.name?"default":"weak",children:n?.name??"Select customer"})})}),S(dm,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=g(null),o=`${n?.name??Bl[0].name}`;return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(dh,{inputRef:r,label:e,popupTriggerProps:t,children:S(Vo,{children:o})})}),S(um,{frequencies:Bl,onClick:t})]})}}});const gm=[Bn(null,An({"& path":{stroke:"icon.base"}}))];function mm({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return R(vs,{type:"button",onClick:n,children:[e&&S(Yi,{Component:Ks,stylists:gm}),S(Vo,{children:t})]})}const vm=An({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),bm=An({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),fm=An({maxWidth:"600px"}),ym=An({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),xm=An({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Tm=An({display:"flex",justifyContent:"flex-start",alignItems:"center"}),km=An({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),wm=An({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),Cm=An({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),Am=e=>{nh(e),rh(e)};function Em({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:o}=ai(),a={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=Nu(),o=er(),a=ar(),i=Xn(n),l=i?{selectedAccounts:n}:e;return i&&o&&n.forEach(({duplicateAccount:e})=>{var t,n,r;e&&(t=e.id,n=o,r=a,ni({queryKey:Yn(Wl({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:ql,accessToken:n,environment:r}))}),hm({defaultValues:l,onSubmit:async e=>{if(await Pu()===au){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!o)return void(await Du());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=Yn(Wl({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),o=await Xa({queryKey:r,queryFn:ql,accessToken:t,environment:n});return o?.data?.[0]?.date}(t.id,o,a),r=(i=yt(e.tranStartDate||""),l=yt(n||""),s=yt(e.tranMinStartDate||""),Zn(l)?i:Xn(s)?kt(l,s):(Xn(i)&&kt(l,i),i));var i,l,s;return Zn(r)?null:xt(r)})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...Ti(t),duplicateBankAccountIds:[hi(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await Du()}}},onSubmitInvalid:()=>{}})}(a,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return R("form",{className:vm,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:Am,children:[R("div",{className:bm,children:[S(Vo,{children:"Merge Accounts"}),S("div",{className:fm,children:S(Ss,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),R("div",{className:ym,children:[R("div",{className:xm,children:[S("div",{className:Tm,children:S(Vo,{children:"Duplicate Account"})}),S("div",{className:km,children:S(Vo,{children:"Into"})}),S("div",{className:wm,children:S(Vo,{children:"Destination Account"})})]}),S(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>S(i.AppField,{name:`selectedAccounts[${n}]`,children:t=>{const n=t.state.value.duplicateAccount?.id,a=function(e,t,n,r){const o=function(e,t,n){const r=new Set(e.map(e=>e.id));return t.forEach(({duplicateAccount:e})=>{e&&e.id!==n&&r.add(e.id)}),Array.from(r)}(e,t,n);return r?.filter(e=>!o.includes(e.id)&&fi(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return S(Yg,{destinationAccount:t.state.value.destinationAccount,selectedDuplicate:t.state.value.duplicateAccount,availableAccounts:a,isFilling:o,onSelectionChange:e=>{const n={duplicateAccount:e,destinationAccount:t.state.value.destinationAccount};t.handleChange(n)}},t.state.value.destinationAccount.id)}},n))})]}),S("div",{className:Cm,children:S(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return R(N,{children:[S(mm,{showIcon:!1,onClick:()=>n()}),S(Tu,{onClick:()=>i.reset(a),disabled:!t,children:S(Vo,{children:"Clear Selections"})}),S(Uu,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const Im=An({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",width:"100%",maxWidth:"100%",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative",overflow:"hidden",boxSizing:"border-box"}),Sm=fe.createConfirmation(ye(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const o=n?n.map(e=>e.destinationAccount):r;return S(du,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:S("div",{className:Im,children:S(Em,{destinationAccounts:o,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function Nm({plaidItemAccounts:e,matchingAccountPairs:t}){await Sm({matchingAccountPairs:t,plaidItemAccounts:e})}const Rm=An({display:"flex",flexDirection:"column",gap:"12px"}),Pm=async(e,t,n)=>{try{const r=await async function({accessToken:e,plaidItemId:t,environment:n}){if(!e)throw new Error("Access token is required to create Plaid link token");const r={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:Jd(n)},{url:o,headers:a}=Gr(r);return al({url:o,includeCredentials:!0,extraHeaders:a,params:t?{plaidItemId:t}:void 0})}({plaidItemId:e,accessToken:t,environment:n});return r.link_token?(jr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(zr({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),fu("NO_LINK_TOKEN"))}catch(r){return zr({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),fu("LINK_TOKEN_FAILED")}};async function Dm(e,t,n){const r=await async function(e,t){const n=Yn(Qa({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await Xa({queryKey:n,queryFn:Ga,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function Lm(e,t,n,r){jr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||jr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const o=await async function(e,t,n){if(e){r=t,o=n,ni({queryKey:Yn(["banks/accounts",{}],{}),queryFn:oi,accessToken:r,environment:o});const a=await Dm(e,t,n);if(a){const e=await ii(t,n);return e?.data?.filter(e=>e.integration?.id===a.id)||[]}}var r,o;return[]}(t?.institution?.institution_id,n,r),{plaidItem:a}=await async function({publicToken:e,metadata:t,accessToken:n,environment:r}){if(!n)throw new Error("Access token is required to create Plaid link token");const o={path:"/banks2/webPlaidPublicToken",accessToken:n,endpointManager:Jd(r)},{url:a,headers:i}=Gr(o);return await Jr({url:a,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(jr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([rr.invalidateQueries({queryKey:["integrations"]}),rr.invalidateQueries({queryKey:["banks/accounts",{}]}),rr.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=Xn(e.apiErrorType)&&Xn(e.apiErrorCode),n="RELINK"===qa({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(a))return zr({error:new Error("Plaid Item requires relink, plaid reopened automatically"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:a}}),{relinkPlaidItemId:a.id};const i=await ii(n,r),s=i?.data?.filter(e=>fi(e.apiName)&&"ACTIVE"===e.status)||[];return await async function(e,t,n,r,o){const a=n.institution?.name,i=l(e.plaidItemAccounts,t,"id");if(0===i.length)return 0===(e.plaidItemAccounts??[]).length?(zr({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await gu({title:"Uh Oh!",body:"It appears something went wrong fetching the accounts from your bank. Please chat with the support or try again later.",buttons:[{key:ou,label:"Cancel"},{key:iu,label:"Chat",type:hu}]})===iu&&vu({message:{text:`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`,attachments:[]}})}(a||"my bank")):void zr({error:new Error("No new accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}});if(!i.some(e=>"ACTIVE"===e.status))return zr({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),gu({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${a} account.`,buttons:[{key:ou,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return zr({error:new Error("Accounts saved successfully with unsupported accounts"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),function(e,t,n){const r=e.length;return gu({title:"All set! Ready to track your transactions?",body:R("div",{className:bu,children:[S(Ss,{wrap:"wrap",children:`Your ${n} ${t} ${mu("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),S(Ss,{wrap:"wrap",children:`The following linked ${r>1?"accounts are":"account is"} not supported at this time, so ${r>1?"they":"it"} will remain unsynced.`}),S("ul",{children:e.map(e=>S("li",{children:S(Ss,{wrap:"wrap",children:si(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:iu,label:"Get Started",type:hu}]})}(s,a,e.plaidItemAccounts.length);const c=function(e,t){const n=[];for(const r of e){if(!r.apiMask)continue;const e=t.find(e=>e.mask===r.apiMask&&r.isSupported);e&&n.push({destinationAccount:yu(r),duplicateAccount:e})}return n}(i,o);return c.length>0?async function({institutionName:e,matchingAccountPairs:t,plaidItemAccounts:n}){const r=t.slice(0,3),o=t.length>3;await gu({title:"Your transactions are being categorized",body:R("div",{className:Rm,children:[S(Ss,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),S(Ss,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),R("ul",{children:[r.map(({duplicateAccount:e})=>S("li",{children:S(Ss,{wrap:"wrap",children:si(e?.name??"",e?.mask??"")})},e?.id)),o&&S("li",{children:S(Ss,{wrap:"wrap",children:"and more..."})})]}),S(Ss,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:ou,label:"No thanks"},{key:iu,label:"Review",type:hu}]})===iu&&await Nm({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:a??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(zr({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=a,u=e.plaidItemAccounts.length,gu({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${mu("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:iu,label:"Get started",type:hu}]})):void 0;var d,u}(a,o,t,e,s),{}}catch(o){return zr({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:o}}),await async function(e){await gu({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:ou,label:"Cancel"},{key:iu,label:"Chat",type:hu}]})===iu&&vu({message:{text:`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`,attachments:[]}})}(t.institution?.name||"my bank"),{}}}async function Mm(e,t,n){return Zn(e)?(jr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(jr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(zr({error:new Error("Plaid Item sync failed, refreshing Plaid Items"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),!0):("INVALID_UPDATED_USERNAME"===e.error_code&&(zr({error:new Error("Plaid Item sync failed due to invalid updated username"),severity:"error",extraData:{metadata:t,error:e,linkToken:n}}),await async function(e){const t=await gu({title:e||"Invalid Updated Username",body:'Your bank account has an updated username. To fix it, tap "Banks & Integrations", and unlink your old account, so you can relink it with your new username. If you need any assistance, tap "Chat" to chat with a member of our team.',buttons:[{key:ou,label:"Cancel"},{key:"chat",label:"Chat"},{key:iu,label:"Banks & Integrations",type:hu}]});"chat"===t?vu({message:{text:"Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!",attachments:[]}}):t!==iu||(e=>{const t=Bt.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||Ml("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const Om=e=>{const t=e.find(e=>e.isSupported&&e.lastSyncedDate);if(t&&t.lastSyncedDate)return`Last synced ${Ct(t.lastSyncedDate)}`},Fm=e=>{let t;return t=e.isSupported?"ACTIVE"!==e.status?"Archived":e.syncTransactions?"Processing":"Not Synced":"Not Supported",t},Bm="PLAID_LINK_NEW",Um="PLAID_LINK_UPDATE",Vm="PLAID_LINK_UNLINK";function Wm({plaidEvent:e,plaidItemId:t,apiAccessToken:n,apiErrorCode:r,message:o}){return{eventType:"onPlaidLink",message:o,defaultPrevented:!0,data:{plaidEvent:e,integrationId:t,apiAccessToken:n,apiErrorCode:r}}}const Hm=v({});function qm({onPlaidLink:e,children:t}){return S(Hm.Provider,{value:{onPlaidLink:e},children:t})}function jm(){return b(Hm)}async function zm(e){const{url:t,headers:n}=Gr(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:o}=e,a=Zr({extraHeaders:n,authorization:t});jr("HTTP DELETE Request",{url:o,accessToken:t});try{const e=await fetch(o,{method:"DELETE",headers:a,credentials:"include",body:JSON.stringify(r)});return jr("HTTP DELETE Response",{url:o,status:e.status,statusText:e.statusText}),Xr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const _m=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:io(n)};return await to(r)};function Km(){return ku({mutationFn:_m,onSuccess:()=>{const e=["integrations"];return rr.invalidateQueries({queryKey:e})}})}const Ym=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:io(t)};return await to(n)};function Zm(){return ku({mutationFn:Ym,onSuccess:()=>{const e=["integrations"];return rr.invalidateQueries({queryKey:e})}})}const Xm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String(hi(e.id)),removeFromApi:e.removeFromApi},accessToken:t,endpointManager:io(n)};return await async function(e){return zm(e)}(r)};function Qm(){const{mutate:e}=Zm();return ku({mutationFn:Xm,onSuccess:()=>{const e=["integrations"];return rr.invalidateQueries({queryKey:e})},onError:async t=>{zr({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await gu({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:ou,label:"Cancel"},{key:iu,label:"Try Again",type:hu}]})===iu&&e()}})}function Gm(e){return new Promise(t=>{window.Plaid.create({token:e,onSuccess:(e,n)=>t({status:"success",public_token:e,metadata:n}),onExit:(e,n)=>t({status:"exit",metadata:n,error:e}),onEvent:(e,t)=>{jr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function Jm(e,t,n,r){const o=await Pm(e,t,n);if(!o)return;const a=await Gm(o);if("success"===a?.status){const{public_token:e,metadata:o}=a;jr("Plaid link successful",{public_token:e,metadata:o});const i=await Lm(e,o,t,n);if(i.relinkPlaidItemId)return Jm(i.relinkPlaidItemId,t,n,r)}else if("exit"===a?.status){const{metadata:e,error:t}=a;jr("Plaid link exited",{metadata:e,error:t}),await Mm(t,e,o)&&r()}else zr({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:a,token:o}})}function $m(){const[e,t]=Gd({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=er(),r=ar(),{mutate:o}=Zm(),{onPlaidLink:a}=jm();return{linkPlaid:e=>{if(Xn(a)){const t=Wm(e);a(t)}else Jm(e.plaidItemId?hi(e.plaidItemId):void 0,n,r,o)},loading:e||Xn(t),hasOnPlaidLinkOverride:Xn(a)}}function ev(){const[e,t]=Gd({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=er(),r=ar(),{mutate:o}=Zm(),{apiPartnerName:a}=b(mc),{onPlaidLink:i}=jm();return{linkPlaid:e=>{if(Xn(i)){const t=Wm(e);i(t)}else!async function(e,t,n,r,o){const a=await Pm(e,t,n);if(!a)return;const i=await Gm(a);if("success"===i?.status){const{public_token:e,metadata:a}=i;jr("Plaid link from search successful",{public_token:e,metadata:a});const l=await async function(e,t,n,r,o){if(t?.institution?.institution_id){const i=await Dm(t.institution.institution_id,n,r);if(i)return zr({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(a=o,gu({title:"Already Linked",body:`It seems that this bank is already linked${a?` with ${a}`:""}. Please tap "Relink" to update the existing linked institution.`,buttons:[{key:ou,label:"Cancel"},{key:iu,label:"Relink",type:hu}]}))===iu?{relinkPlaidItemId:hi(i.id)}:{}}var a;return jr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),Lm(e,t,n,r)}(e,a,t,n,r);l.relinkPlaidItemId&&Jm(l.relinkPlaidItemId,t,n,o)}else if("exit"===i?.status){const{metadata:e,error:t}=i;jr("Plaid link from search exited",{metadata:e,error:t}),await Mm(t,e,a)&&o()}}(e.plaidItemId?hi(e.plaidItemId):void 0,n,r,a,o)},loading:e||Xn(t),hasOnPlaidLinkOverride:Xn(i)}}const tv=Bn(null,os,An({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",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),ji);function nv(){const{linkPlaid:e,loading:t}=$m();return R("button",{onClick:()=>e({plaidEvent:Bm,message:"Tile Plaid Link button pressed"}),...tv,disabled:t,children:[S(Yd,{Component:Kd}),S(Ss,{intent:"primary",children:"Link Account"})]})}const rv=An({width:266,minHeight:32});function ov(){return S(pa,{styles:rv})}const av=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),iv=({defaultRange:e=nt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:o}=function({filter:e}){return co({filter:e,select:_d})}({filter:e});let a;return a=t?Ca:r??av,R(xo,{isSample:t,children:[S(vo,{title:"Profit + Loss"}),S(fo,{children:o?R(ma,{children:[S(ov,{}),S(ov,{})]}):R(N,{children:[S(No,{title:Fo(a.netIncome),label:"Profit"}),R(Po,{children:[S(jd,{amount:a.income,total:a.absoluteSum,color:"positive",label:"Income"}),S(jd,{amount:a.expenses,total:a.absoluteSum,color:"negative",label:"Expenses"})]})]})}),t&&S(Ta,{size:"sm"}),n&&S(nv,{})]})},lv=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],sv={moneyIn:0,moneyOut:0,netMoneyIn:0};const cv=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,o=t[3].environment,a={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...ct(n.filter)},accessToken:r,endpointManager:io(o)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||Zn(n)||Zn(n.operatingActivities)||!n.operatingActivities.children?sv:function(e){let t=new U(0),n=new U(0);for(const r of e.children)r.total<0?n=n.plus(U(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await to(a))},dv=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),uv=({defaultRange:e=nt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:o},isFilling:a}=function({filter:e}){return ir({queryKey:lv({filter:e}),queryFn:cv})}({filter:e});let i;i=t?Ea:r??dv;let l=0;return(t||o)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),R(xo,{isSample:t,children:[S(vo,{title:"Cash Flow"}),S(fo,{children:a?R(ma,{children:[S(ov,{}),S(ov,{})]}):R(N,{children:[S(No,{title:Fo(i.netMoneyIn),label:"Change in Cash"}),R(Po,{children:[S(jd,{amount:i.moneyIn,total:l,color:"positive",label:"Money In"}),S(jd,{amount:i.moneyOut,total:l,color:"negative",label:"Money Out"})]})]})}),t&&S(Ta,{size:"sm"}),n&&S(nv,{})]})},hv=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),pv=Bn(null,An({display:"flex",justifyContent:"end"}));function gv({color:e,bulletLabel:t,moneySummary:n}){return R("div",{...hv,children:[S(Xo,{color:e,label:t}),S("div",{...pv,children:S(Ss,{children:n})})]})}const mv={total:0,children:[]},vv=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||Zn(n)||Zn(n.expenses)||!n.expenses.children?mv:{total:n.expenses.total??0,children:(r=n.expenses.children,r.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var r},bv=Bn(null,An({display:"flex",gap:"10px",alignItems:"center"})),fv=An({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),yv=Bn(null,fv);function xv({bulletAmount:e=3,shimmer:t=!1}){return S(N,{children:Array.from({length:e},(e,n)=>R("div",{...bv,children:[S(Xo,{color:_o.var("colors.brand.secondary")}),t?S(pa,{styles:fv}):S("div",{...yv})]},n))})}const Tv=Bn(null,An({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),kv=[_o.var("colors.brand.primary"),_o.var("colors.brand.success"),_o.var("colors.brand.action")],wv=Object.freeze({total:0,children:[]});function Cv({defaultRange:e=nt.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const o=Bt(e=>e.externalOptions).dataVisualizationColors??kv,{query:{data:a},isFilling:i}=function({filter:e}){return co({filter:e,select:vv})}({filter:e});let l;l=n?Aa:a??wv;const s=void 0===t?"Total Expenses":`${ut[t]} Total`,c=l.children.length>0;return R(xo,{isSample:n,children:[S(vo,{title:"Expenses"}),S(fo,{children:i?S(ma,{children:S(xv,{shimmer:!0})}):R(N,{children:[S("div",{...Tv,children:S(No,{title:Fo(l.total),label:s})}),S(Po,{children:c?l.children.map((e,t)=>S(gv,{color:o[t],bulletLabel:e.name,moneySummary:Fo(e.total)},t)):S(xv,{})})]})}),n&&S(Ta,{size:"sm"}),r&&S(nv,{})]})}const Av=Bn(null,An({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Ev({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:o}){const a=(i=e.month,{beginDate:Ze(l=e.year,i,1),endDate:Ze(l,i+1,0)});var i,l,s,c,d,u,h,p;return R("div",{...Av,children:[R(Vn,{children:[S(_n,{children:"Monthly Review"}),S(Rd,{period:e,setPeriod:t,disableNext:r||(s=e,c=n,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:r})]}),R(Dd,{children:[S(iv,{defaultRange:a,isSample:r,showLinkAccountButton:o}),S(uv,{defaultRange:a,isSample:r,showLinkAccountButton:o}),S(Cv,{defaultRange:a,monthIndex:e.month,isSample:r,showLinkAccountButton:o})]})]})}const Iv="Oldest to Newest",Sv="Newest to Oldest",Nv="A-Z",Rv="Z-A",Pv="Lowest to Highest",Dv="Highest to Lowest",Lv="A-Z",Mv="Z-A";function Ov(){const[e,t]=y(void 0),n=m(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in Ul)??!1,n=(e.direction&&e.direction in Vl)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const Fv=An({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"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),Bv=An({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Uv=An({background:"brand.primary.strong",border:"none",color:"icon.contrast"});function Vv({checked:e,onClick:t}){const[n,r]=y(e??!1),o=void 0===e?n:e;return S("button",{...Bn(Pn["checkbox-input"],Fv,o?Uv:Bv,zi),type:"button",onClick:o=>{void 0===e&&r(!n),t&&t(o)},"data-is-checked":o,children:o&&S(Ys,{Component:Bu})})}const Wv=Bn(null,An({paddingLeft:"20px",paddingRight:"5px"}));function Hv({checked:e,onClick:t}){return S("div",{...Wv,children:S(Vv,{checked:e,onClick:t})})}const qv=Bn(Pn.text,An({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),To);function jv({children:e}){return S("div",{...qv,children:e})}const zv=Bn(Pn["date-cell"],An({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function _v({date:e,annotation:t}){const n=vt(yt(e));return R("div",{...zv,children:[t&&S(jv,{children:t}),S(Ss,{children:n})]})}const Kv=An({color:"money.negative"}),Yv=An({color:"money.positive"}),Zv=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>Qn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" "),Xv=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 10.625H7.5C5.8424 10.625 4.25269 9.96652 3.08058 8.79442C1.90848 7.62231 1.25 6.0326 1.25 4.375V0.625",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M10 14.375L13.75 10.625L10 6.875",stroke:"currentColor",strokeMiterlimit:10})),"ChildRow"),Qv=Bn(Pn["transaction-date-cell-container"],An({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px"}));function Gv({transaction:e,showTypeLabel:t=!1,isChild:n=!1}){const r=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let n;return n=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:n,css:t?Yv:Kv}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?Kv:Yv}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?Kv:Yv};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?Kv:Yv};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:Kv};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=Yv;return e.amount<0&&(t="Invoice Payment Refund",n=Kv),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:Zv(e.type),css:e.amount<0?Kv:Yv}))(e)}return t})(e),o=Bn(Pn["transaction-type-label"],r.css),a=t?S("span",{...o,children:r.displayName}):void 0;return n?R("div",{...Qv,children:[S(Yd,{Component:Xv}),S(_v,{date:e.date,annotation:a})]}):S(_v,{date:e.date,annotation:a})}const Jv=An({display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",width:"100%"}),$v=An({display:"flex",flexDirection:"column",width:"100%"}),eb=An({width:20,minWidth:20,height:20,minHeight:20,borderRadius:"9999px"});function tb({label:e,subLabel:t,iconUrl:n}){return R("div",{className:Jv,children:[n?S("img",{src:n,className:eb,alt:void 0,width:24,height:24}):S("span",{className:eb}),R("div",{className:$v,children:[S(Ss,{children:e}),S(Ho,{children:t})]})]})}function nb({bankTransaction:e,isChild:t=!1}){return t?S("div",{className:An({paddingLeft:"25px"}),children:S(tb,{label:e.displayName,subLabel:e.description,iconUrl:e.iconUrl})}):S(tb,{label:e.displayName,subLabel:e.bankAccount?.displayName,iconUrl:e.iconUrl})}function rb(e){return Bo($h(e.amount))}const ob=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.10632H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.69366H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.28131H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8687H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.71875 10.4749L3.33125 12.8686L0.9375 10.4749",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 1.50635V12.8688",stroke:"currentColor",strokeMiterlimit:10})),"NestedRows"),ab=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.9187 2.13135H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 5.71851H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 9.30682H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M6.9187 12.8934H14.6875",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M0.9375 4.5251L3.33125 2.13135L5.71875 4.5251",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M3.33118 13.4938V2.13135",stroke:"currentColor",strokeMiterlimit:10})),"NestedRowsExpanded"),ib=An({display:"flex",alignItems:"center",gap:"8px"}),lb=An({padding:"6px"});function sb({row:e}){const t=e.original,n=S(Ss,{children:rb(t)});if(e?.getCanExpand()){const t=e.getIsExpanded();return S(sc,{ariaLabel:t?"Collapse children":"Expand children",ariaExpanded:t,children:R("div",{className:ib,children:[S(Yd,{Component:t?ab:ob}),n]})})}return S("div",{className:lb,children:n})}const cb=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 1.25L1.25 13.75",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M13.75 9.84375V1.25H5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Withdraw"),db=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M13.75 13.75L1.25 1.25",stroke:"currentColor",strokeMiterlimit:10}),p.createElement("path",{d:"M5.15625 13.75H13.75V5.15625",stroke:"currentColor",strokeMiterlimit:10})),"Deposit"),ub=An({padding:"10px",height:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"8px"}),hb=An({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"});function pb({annotation:e,accountName:t}){const n=(e=>{switch(e){case"Withdrawn from":return cb;case"Deposited to":return db;default:return null}})(e);return R("div",{className:ub,children:[n&&S(Yd,{Component:n}),R("div",{className:hb,children:[e&&S(Ho,{children:e}),t&&S(Ss,{children:t})]})]})}const gb=An({maxWidth:"100%",width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background","& .Tight-sub-label":{color:"typography.base"},"& .Tight-icon > path":{stroke:"icon.base"}}),mb=In(gb,An({padding:"2.5px"})),vb=In(gb,An({padding:"4px 5px",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{}})),bb=An({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-label":{color:"typography.intent.secondary"},"& .Tight-icon > path":{stroke:"icon.intent.secondary"}}),fb=In(bb,An({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-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-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),yb=An({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-label":{color:"typography.intent.action"},"& .Tight-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-label":{color:"typography.intent.action.hover"},"& .Tight-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-label":{color:"typography.intent.action.hover"},"& .Tight-icon > path":{stroke:"icon.intent.action.hover"}}}),xb=In(yb,An({_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-label":{color:"typography.intent.secondary.hover"},"& .Tight-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-label":{color:"typography.intent.secondary.hover"},"& .Tight-icon > path":{stroke:"icon.intent.secondary.hover"}}})),Tb=An({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-label":{color:"typography.intent.success"},"& .Tight-icon > path":{stroke:"icon.intent.success"}}),kb=In(Tb,An({_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-label":{color:"typography.intent.success.hover"},"& .Tight-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-label":{color:"typography.intent.success.hover"},"& .Tight-icon > path":{stroke:"icon.intent.success.hover"}}})),wb=An({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-label":{color:"typography.intent.warning"},"& .Tight-icon > path":{stroke:"icon.intent.warning"}}),Cb=In(wb,An({_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-label":{color:"typography.intent.warning.hover"},"& .Tight-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-label":{color:"typography.intent.warning.hover"},"& .Tight-icon > path":{stroke:"icon.intent.warning.hover"}}})),Ab=An({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-label":{color:"typography.intent.danger"},"& .Tight-icon > path":{stroke:"icon.intent.danger"}}),Eb=In(Ab,An({_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-label":{color:"typography.intent.danger.hover"},"& .Tight-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-label":{color:"typography.intent.danger.hover"},"& .Tight-icon > path":{stroke:"icon.intent.danger.hover"}}})),Ib=An({display:"flex",alignItems:"center",gap:"8px",height:"37px",margin:"0 8px",padding:"10px",borderRadius:"sm",cursor:"pointer",minWidth:0,outline:"none","&:focus-visible":{outline:"2px solid",outlineColor:"border.layout",outlineOffset:"2px"}}),Sb={default:fb,neutral:fb,warning:Cb,success:kb,critical:Eb,highlight:xb},Nb=w(function({variant:e="default",children:t,stylists:n=[],...r},o){const a=qn([Bn(Pn["selector-button"],In(Ib,Sb[e]),zi),...n]);return S("button",{ref:o,...a,...r,children:t})}),Rb={keys:[{name:"name"},{name:"accountNo"}],threshold:.1};function Pb(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}function Db(e,t){const n=[];return e.forEach(e=>{const r=e.item,o=(l=r,t.find(e=>e.children?.some(e=>e.accountNo===l.accountNo))),a=!o&&r.children?.length>0,i=!(o||r.children&&0!==r.children.length);var l;a?function(e,t){e.children.forEach(n=>{Pb(e,n,t)})}(r,n):o?Pb(o,r,n):i&&Pb(r,r,n)}),n}const Lb=[Bn(null,An({marginLeft:"6px",marginRight:"6px"}))],Mb=Bn(null,An({whiteSpace:"normal"}));function Ob({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:o}=sg(),a=mg(r,e),i=m(()=>new Ce(a,Rb),[a]),l=m(()=>Db(i.search(n),a),[a,n,i]);return o?S(Tp,{}):l.map(({parent:e,child:n})=>S(bp,{onClick:()=>t(n),children:R(Wp,{stylists:[Mb],children:[e.name,S(Yi,{Component:qi,stylists:Lb}),n.name]})},`${n.accountNo}`))}function Fb({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:o}=lg(),a=mg(n,e);return o?S(Tp,{}):o||r||void 0!==n?a.map(e=>S(Zp,{triggerChildren:S(Gp,{displayLabel:e.name}),popupChildren:S(Bb,{glAccount:e,onClick:t})},e.accountNo)):S(yp,{text:"No data"})}function Bb({glAccount:e,onClick:t}){return S(dp,{children:e.children.map(e=>S(bp,{onClick:()=>t(e),children:S(Vo,{children:e.name})},e.accountNo))})}const Ub=An({maxWidth:"420px",width:"fit-content"});function Vb({onClick:e,types:t}){const{query:{data:n}}=lg(),r=mg(n,t);return S(gp,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?Ub:void 0,SearchList:Ob,DefaultList:Fb,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}const Wb=async({data:e,accessToken:t,environment:n})=>qb({data:{data:e},accessToken:t,environment:n}),Hb=async({data:e,accessToken:t,environment:n})=>Wb({data:[e],accessToken:t,environment:n}),qb=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:Ua(n)};return await eo(r)};function jb(){return ku({onSuccess:async()=>{const e=["banks/transactions"];return jr("mutation successful, invalidating BT queries"),rr.invalidateQueries({queryKey:e}).catch(e=>zr({error:e,severity:"error"}))},mutationFn:Wb})}function zb(){return ku({onSuccess:async()=>(jr("mutation successful, invalidating BT queries"),rr.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>zr({error:e,severity:"error"}))),mutationFn:Hb})}function _b({transaction:e,parentTransaction:t,accountName:n}){const{startPrefetch:r,cancelPrefetch:o}=dl({prefetchFn:_a(og,ag)}),{mutate:a}=zb(),i=void 0!==t;return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>R(Nb,{...t,onMouseEnter:r,onMouseLeave:o,children:[e.glAccount&&S("img",{src:e.glAccount.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Ss,{children:n})]})}),S(Vb,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:o}=t,{id:i}=e,l=o.map(e=>e.id===i?{...e,glAccountId:n.id.toString()}:e);a({id:r,children:l})}}:t=>{a({id:e.id,glAccountId:t.id})},types:gg})]})}const Kb=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),p.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}),p.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"),Yb=Bn(null,An({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Zb=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Xb({transaction:e}){const{label:t,list:n}=Up(e.children);return S(Es,{children:R("div",{...Zb,children:[S(Yd,{Component:Kb}),R("div",{...Yb,children:[S(Vo,{children:t}),S(Ho,{children:n})]})]})})}function Qb({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=Fp(),o=e.category?.name??"",{mutate:a}=zb(),i=void 0!==t;return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>R(Nb,{...t,onMouseEnter:n,onMouseLeave:r,children:[e.category&&S("img",{src:e.category.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Ss,{children:o})]})}),S(eg,{onClick:i?n=>{if(n?.id&&i){const{id:r,children:o}=t,{id:i}=e,l=o.map(e=>e.id===i?{...e,categoryId:n.id.toString()}:e);a({id:r,children:l})}}:t=>{t?.id&&a({id:e.id,categoryId:t.id.toString()})}})]})}function Gb({transaction:e,parentTransaction:t}){if(e.children.length>0)return S(Xb,{transaction:e});switch(vi(e.type)){case"EXPENSE_CATEGORY":return S(Qb,{transaction:e,parentTransaction:t});case"TRANSFER":return S(pb,{annotation:xi(e.amount),accountName:e.bankAccount?.name});case"PAYMENT":return zr({error:new Error("Should not get here. Payout without line items."),severity:"error"}),null;default:return S(_b,{transaction:e,parentTransaction:t,accountName:e.glAccount?.name})}}function Jb({name:e}){return S(N,{children:e&&S(Ss,{children:e})})}const $b=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],ef=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function tf({onClick:e}){const t=zs(),{userRole:n}=b(mc),r=(e=>{switch(e){case"OWNER":default:return $b;case"ACCOUNTANT":return ef}})(n)||[];return S(tc,{children:S(dp,{children:r.map(({status:n,displayName:r})=>S(bp,{onClick:()=>(e(n),void t.close()),children:S(Vo,{children:r})},n))})})}const nf=Wi(e=>p.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag",{styleIconKey:"flag"}),rf=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),p.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),of=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck",{styleIconKey:"checkmark"}),af={PARTNER_REVIEW_REQUIRED:"PARTNER_REVIEW_REQUIRED",USER_REVIEW_REQUIRED:"USER_REVIEW_REQUIRED",ACCOUNTANT_REVIEW_REQUIRED:"ACCOUNTANT_REVIEW_REQUIRED",RECONCILED:"RECONCILED",RECONCILIATION_DISCREPANCY:"RECONCILIATION_DISCREPANCY",STAGED:"STAGED",AWAITING_MATCH:"AWAITING_MATCH",RECONCILIATION_STAGED:"RECONCILIATION_STAGED",RECONCILIATION_AWAITING:"RECONCILIATION_AWAITING"},lf=[{name:"Needs Review",value:[af.USER_REVIEW_REQUIRED],icon:nf},{name:"Flagged to Accountant",value:[af.ACCOUNTANT_REVIEW_REQUIRED],icon:nf},{name:"Discrepancy",value:[af.RECONCILIATION_DISCREPANCY],icon:_u},{name:"Processing",value:[af.PARTNER_REVIEW_REQUIRED,af.STAGED],icon:rf},{name:"Reconciled",value:[af.RECONCILED],icon:of}],sf=[{name:"Needs Review",value:[af.ACCOUNTANT_REVIEW_REQUIRED],icon:nf},{name:"Flagged to Business Owner",value:[af.USER_REVIEW_REQUIRED],icon:nf},{name:"Discrepancy",value:[af.RECONCILIATION_DISCREPANCY],icon:_u},{name:"Processing",value:[af.PARTNER_REVIEW_REQUIRED],icon:rf},{name:"Reconciled",value:[af.RECONCILED],icon:of}];function cf(e){return e in af}const df=(e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===af.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===af.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===af.ACCOUNTANT_REVIEW_REQUIRED||l===af.RECONCILIATION_AWAITING),o=((e,t)=>"ACCOUNTANT"===t&&e===af.USER_REVIEW_REQUIRED)(e,t),a=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);var l;let s,c,d;return r?(s="Pending Review",c=rf,d="neutral"):o?(s="Pending User Review",c=rf,d="neutral"):n?(s="Needs Review",c=nf,d="warning"):a?(s="Discrepancy",c=_u,d="critical"):i?(s="Reconciled",c=of,d="success"):(s="Processing",c=rf,d="neutral"),{text:s,variant:d,Icon:c}},uf=Bn(Pn["review-status-selector-button"],An({width:"151px",justifyContent:"center"})),hf=Bn(Pn["review-status-dropdown-arrow"],An({display:"none"}));function pf({status:e,transactionId:t}){const[n,r]=y(!1),{mutate:o}=zb(),a=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=b(mc),{text:s,variant:c,Icon:d}=df(e,l);return t&&((u=t).startsWith(ci.TRANSACTION_LINE_ITEM)||u.startsWith(ci.PROCESSOR_TRANSACTION))?null:R(js,{open:n,blockInteraction:!1,onOpenChange:a,enableClickMiddleware:!1,placement:"bottom-start",children:[S(_s,{children:e=>R(Nb,{variant:c,...e,stylists:[uf],onClick:i,children:[S(Yd,{Component:d}),S(Ss,{children:s}),S("div",{...hf,children:S(Yi,{Component:ph})})]})}),S(tf,{onClick:e=>{o({id:t,reviewStatus:e}),a()}})]});var u}function gf({status:e,transactionId:t}){return S(pf,{status:e,transactionId:t},t)}function mf(){return S(Yd,{Component:qi})}function vf(){return S(mf,{})}const bf=e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),ff=Wi(bf,"Dash"),yf=Bn(null,An({stroke:"icon.base.weak"}));function xf({hasConversation:e,hasUnread:t=!1}){return S(N,{children:e?S(sd,{hasUnread:t}):S("div",{"data-testid":"no-conversations-dash",children:S(Ys,{Component:ff,stylists:[yf]})})})}function Tf({conversationId:e}){const{query:{data:t}}=fl(e??null),{startPrefetch:n,cancelPrefetch:r}=xl(),{startPrefetch:o,cancelPrefetch:a}=Gl(),i=Xn(t),l=i&&"READ"===t?.readStatus,s=x(()=>{Xn(e)&&(n({id:e}),o({id:e}))},[e,n,o]),c=x(()=>{Xn(e)&&(r(),a())},[e,r,a]);return S("div",{onMouseEnter:s,onMouseLeave:c,children:S(xf,{hasConversation:i,hasUnread:!l})})}const kf=Bn(Pn["badge-chip"],mb),wf=Bn(null,wo),Cf=Bn(null,zi),Af=Bn(Pn["neutral-badge"],bb),Ef=Bn(Pn["highlight-badge"],yb),If=Bn(Pn["success-badge"],Tb),Sf=Bn(Pn["warning-badge"],wb),Nf=Bn(Pn["critical-badge"],Ab);function Rf({type:e,children:t}){let n;switch(e){case"critical":n=Nf;break;case"warning":n=Sf;break;case"neutral":n=Af;break;case"success":n=If;break;case"highlight":n=Ef}const r=qn([kf,wf,n,Cf]);return S("div",{...r,children:t})}function Pf({reviewStatus:e}){const{userRole:t}=b(mc),{variant:n,Icon:r}=df(e,t);return S(Rf,{type:n,children:S(Yd,{Component:r})})}const Df=An({padding:"12px 16px",display:"flex",gap:"6px",flexDirection:"row",alignItems:"center",maxWidth:"100%"}),Lf=An({display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,gap:"8px"}),Mf=An({display:"flex",gap:"8px",justifyContent:"flex-start",alignItems:"center",minWidth:0}),Of=An({display:"flex",alignItems:"center",gap:"12px",minWidth:0}),Ff=An({display:"flex",gap:"8px",flexDirection:"column",minWidth:0}),Bf=An({width:24,minWidth:24,height:24,minHeight:24,borderRadius:"9999px"});function Uf({row:e}){const t=e.original,n=function(e){if(e.children.length>0){const{label:t,list:n}=Up(e.children);return`${t}: ${n}`}switch(vi(e.type)){case"EXPENSE_CATEGORY":return e.category?.name;case"TRANSFER":return`${xi(e.amount)}: ${e.bankAccount?.name}`;case"PAYMENT":return void zr({error:new Error("Should not get here. Payout without line items."),severity:"error"});default:return e.glAccount?.name}}(t),r=void 0!==e.getParentRow();return R("div",{className:Df,children:[r&&S(Yd,{Component:Xv}),R("div",{className:Ff,children:[R("div",{className:Mf,children:[t.iconUrl?S("img",{src:t.iconUrl,className:Bf,alt:void 0,width:24,height:24}):S("span",{className:Bf}),S(Vo,{children:t.description})]}),R("div",{className:Of,children:[S(Pf,{reviewStatus:t.reviewStatus}),S(Ho,{wrap:"wrapTwice",children:n})]})]}),R("div",{className:Lf,onClick:t=>{e.getCanExpand()&&(t.stopPropagation(),e.toggleExpanded())},children:[S(sb,{row:e}),S(Yi,{Component:qi})]})]})}const Vf=Q(),Wf=[Vf.display({id:Vt.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?S(Hv,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),Vf.accessor("date",{id:Vt.DATE,cell:e=>{const t=void 0!==e.row.getParentRow();return S(Es,{children:S(Gv,{transaction:e.row.original,isChild:t})})},header:()=>S(hc,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Iv,sortDescDisplay:Sv}),size:130,maxSize:144}),Vf.accessor("description",{id:Vt.DESCRIPTION,cell:e=>{const t=void 0!==e.row.getParentRow();return S(Es,{children:S(nb,{bankTransaction:e.row.original,isChild:t})})},header:()=>S(hc,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Nv,sortDescDisplay:Rv}),size:180}),Vf.accessor("amount",{id:Vt.AMOUNT,cell:e=>S(Es,{alignVariant:"flexEnd",children:S(sb,{row:e.row})}),header:()=>S(hc,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:Pv,sortDescDisplay:Dv,align:"right"}),size:130,maxSize:130}),Vf.accessor("category.id",{id:Vt.CATEGORY,cell:({row:e})=>S(Gb,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>S(hc,{columnName:"Category",padding:"none"}),size:130,meta:{clickable:!0}}),Vf.accessor(e=>e.classSegments[0]?.id,{id:Vt.CLASS_SEGMENT,cell:e=>S(Es,{children:S(Jb,{name:e.row.original.classSegments[0]?.name})}),header:()=>S(hc,{columnName:"Business"}),size:130}),Vf.accessor("reviewStatus",{id:Vt.REVIEW_STATUS,cell:e=>S(Es,{children:S(gf,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>S(hc,{columnName:"Status",sortDef:"REVIEW_STATUS",sortAscDisplay:Lv,sortDescDisplay:Mv,padding:"large"}),size:200,maxSize:230,meta:{clickable:!0}}),Vf.display({id:Vt.COMMENTS,cell:e=>{const t=e.row.original;return S(Es,{alignVariant:"center",children:S(Tf,{conversationId:t.conversation?.id})})},header:()=>S(hc,{columnName:"Comments"}),size:80,maxSize:110,meta:{clickable:!0}}),Vf.display({id:Vt.EXPAND,cell:()=>S("div",{className:An({paddingRight:"20px"}),children:S(vf,{})}),size:40,maxSize:60})],Hf=Vf.display({id:"MOBILE",cell:e=>S(Uf,{row:e.row})}),qf=v(!0);function jf(){return b(qf)}const zf=[];function _f({transactions:e,columns:t}){const n=jf(),r=n?["MOBILE"]:t,o=n?{MOBILE:!0}:function(e){if(e)return Object.values(Vt).reduce((t,n)=>(t[n]=e.includes(n),t),{})}(t),a=n?[Hf]:(i=t)?Wf.filter(e=>i.includes(e.id)):Wf;var i;return G({data:e??zf,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??zf.length,columns:a,getCoreRowModel:J(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,iconUrl:t.iconUrl??"",reconciliationMatch:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],suggestedCategories:[],conversation:null,status:"ACTIVE"};var t}),getExpandedRowModel:$(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:r,columnVisibility:o}})}const Kf=[Vt.COMMENTS,Vt.DATE,Vt.DESCRIPTION,Vt.AMOUNT,Vt.CATEGORY,Vt.REVIEW_STATUS];function Yf(e,t){return Ml("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function Zf(e){const t=e.row,n=e.column.columnDef.meta?.clickable,r=t.getCanExpand(),o=bi(e.row.original.type),a="category"===e.column.id&&(r||o),i="comments"===e.column.id,l="amount"===e.column.id;if(i){const e=t.getParentRow();Yf(e?.original.id??t.original.id,"conversation")}else if(l&&r)t.toggleExpanded();else if(!n||a){const e=t.getParentRow();Yf(e?.original.id??t.original.id)}}function Xf({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Kl(),o=x(()=>n({id:e.original.id}),[n,e.original]);return S(Ll,{rowData:e,onMouseEnter:o,onMouseLeave:r,onCellClick:Zf,shouldDisplayDivider:n=>{return r=n,o=t,a=e.getVisibleCells().length,!(0===r||o&&1===r||r===a-1||o||1===r);var r,o,a}})}function Qf(){return R(N,{children:[S(Hc,{Component:of}),S(Vo,{wrap:"wrap",children:"All caught up"}),S(Ho,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Gf=Bn(Pn["button-warning"],An({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{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"}}));function Jf({children:e,stylists:t=[],...n}){return S(gs,{stylists:[Gf,...t],...n,children:e})}function $f(){const{linkPlaid:e,loading:t}=$m();return S(Jf,{onClick:()=>e({plaidEvent:Bm,message:"Plaid Link button pressed"}),disabled:t,children:S(Vo,{children:"Link your bank"})})}const ey=Bn(null,An({whiteSpace:"wrap"}));function ty(){return R(N,{children:[S(Hc,{Component:Ig}),S(Vo,{textAlign:"center",stylists:[ey],children:"Your bank transactions will be categorized for you"}),S(Ho,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),S($f,{})]})}const ny=An({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function ry(){return R(N,{children:[S("div",{className:ny,children:S(Yd,{Component:rf})}),S(Vo,{children:"Transactions are being processed"}),S(Ho,{children:"Any transactions that require review will show up here."})]})}const oy=An({xl:{minWidth:"900px"}});function ay({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:o,transactions:a}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return _f({transactions:e,columns:t?[...t,Vt.EXPAND]:void 0})}({transactions:e,columns:Kf})}({transactions:a}),{query:{data:l},isFilling:s}=jl({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=jf(),d=!Zn(l?.data?.[0])&&!s,u=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=S(Qf,{})):r=S(ry,{}):r=S(ty,{}),r}(e??!1,a.length>0,d);return R("div",{className:oy,children:[S("div",{id:Da}),R(Ki.Provider,{value:o,children:[R(Vn,{children:[S(_n,{children:c?"Transactions":"Transactions For Your Review"}),S(Xc,{children:S(Ji,{})})]}),S(ks,{dashboard:"businessOwnerDashboard",children:r?S(ol,{}):R(N,{children:[S(ws.Provider,{value:{sortInstance:t,setSortInstance:n},children:S(Cl,{headerGroups:i.getHeaderGroups()})}),Zn(u)?S(El,{children:i.getRowModel().rows.map(e=>S(Xf,{rowData:e,hasSelect:!1},e.id))}):S(Wc,{children:u})]})})]})]})}function iy(){const{sortInstance:e,setSortInstance:t,apiSort:n}=Ov(),{query:{data:r},isFilling:o,paginationControls:a}=jl({filter:Ma,sort:n,limit:10}),i=r?.data??Fa,{hasPlaidLinkedBankAccount:l,isFilling:s}=Ai();return S(ay,{sortInstance:e,setSortInstance:t,isFilling:o||s,paginationControls:a,transactions:i,hasLinkedAccount:l??!1})}const ly=Bn(Pn["button-action"],An({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{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"}}));function sy({children:e,stylists:t=[],...n}){return S(gs,{stylists:[ly,...t],...n,children:e})}const cy=Wi(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),p.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),p.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),dy=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:ad,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:nf,buttonText:"Review"};case"LINK_BANK":return{Icon:Ig,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:Ig,buttonText:"Fix"};case"RELINK":return{Icon:Ig,buttonText:"Relink"};case"CHAT":return{Icon:_u,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:cy,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:of,buttonText:""};default:return{Icon:_u,buttonText:""}}},uy=Bn(Pn["banner-title"],An({display:"flex",alignItems:"center",gap:"8px"})),hy=Bn(Pn["banner-icon"],An({width:"20px",height:"20px"}));function py({title:e,type:t}){const{Icon:n}=dy(t);return R("div",{...uy,children:[S(Yd,{Component:n,stylists:[hy]}),S(Vo,{wrap:"wrap",children:e})]})}const gy=Bn(null,An({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:{base:"4px",xl:"5px"},flex:{xl:"1 1 0"},minWidth:{xl:"200px"},width:"100%"}));function my({title:e,description:t,type:n}){return R("div",{...gy,children:[S(py,{title:e,type:n}),S(Ho,{wrap:"wrap",children:t})]})}const vy=Bn(Pn["banner-button"],An({display:"flex",justifyContent:"center",alignItems:"center",width:{base:"100%",xl:"128px"},gap:{xl:"15px"},flexShrink:{xl:"0"}})),by=Bn(Pn["banner-button-text"]),fy=Bn(Pn["banner-button-icon"]);function yy({priority:e,type:t,handleClick:n}){const{buttonText:r}=dy(t),{Button:o}=(e=>{switch(e){case"URGENT":return{Button:tu};case"HIGH":return{Button:Jf};case"MEDIUM":return{Button:sy};default:return{Button:gs}}})(e);return R(o,{onClick:n,stylists:[vy],children:[S(Vo,{stylists:[by],children:r}),S(Yi,{stylists:[fy],Component:qi})]})}const xy=Nn({base:{display:"flex",flexDirection:{base:"column",xl:"row"},padding:{base:"16px",xl:"15px"},gap:{base:"16px",xl:"0"},justifyContent:{xl:"space-between"},alignItems:{base:"flex-start",xl:"center"},alignSelf:"stretch",width:{base:"100%",xl:"auto"},minWidth:{xl:"350px"},borderRadius:{base:"sm",xl:"lg"},border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Ty={HIGH:Pn["banner-high"],MEDIUM:Pn["banner-medium"],LOW:Pn["banner-low"],URGENT:Pn["banner-urgent"]};function ky({task:e,handleClick:t}){const{name:n,description:r,shortDescription:o,type:a,priority:i}=e,l=jf()?o:r,s=Bn(Pn.banner,Ty[i],xy({priority:i}));return R("div",{...s,children:[S(my,{title:n,description:l,type:a}),S(yy,{priority:i,type:a,handleClick:t})]})}function wy(e,t){vu({message:{text:`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`,attachments:[]}})}function Cy(e,t,n,r,o){return()=>gu({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:o})}function Ay(e,t,n,r,o,a){return{alert:Cy(e,t,o,a,[{key:ou,label:"Cancel"},{key:Va.CHAT,label:"Chat",type:hu}]),actions:{[Va.CHAT]:()=>wy(t,r)}}}function Ey(e){const{mutateAsync:t}=Qm(),n=er(),r=ar(),{apiPartnerName:o}=b(mc),a=jf(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=$m(),{linkPlaid:c,loading:d}=$m();if(Zn(e))return Ay(qa({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=qa({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case Va.DELETE_OR_RELINK:case Va.RELINK:return l?null:(g=i,m=o,v=a,{alert:Cy(u,(p=e).apiInstitutionName,m,v,[{key:ou,label:"Cancel"},{key:iu,label:"Relink",type:hu}]),actions:{success:()=>{g({plaidEvent:Um,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case Va.UNLINK_RELINK:return d?null:function(e,t,n,r,o,a,i){return{alert:Cy(e,t.apiInstitutionName,o,a,[{key:ou,label:"Cancel"},{key:Va.CHAT,label:"Chat"},{key:iu,label:"Unlink and Relink",type:hu}]),actions:{success:async()=>{i||await n({id:String(t.id),removeFromApi:!0}),r({plaidEvent:"PLAID_LINK_UNLINK_RELINK",plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink and Relink Bank Error button pressed"})},[Va.CHAT]:()=>wy(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,o,a,s);case Va.OPEN_BANK:return l?null:function(e,t,n,r,o,a,i,l){return{alert:Cy(e,t.apiInstitutionName,i,l,[{key:ou,label:"Cancel"},{key:Va.CHAT,label:"Chat"},{key:Va.RELINK,label:"Relink"},{key:iu,label:"Go To Bank",type:hu}]),actions:{success:async()=>{const e=await $d({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:o}),a=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(a,"_blank")},[Va.RELINK]:()=>{a({plaidEvent:Um,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[Va.CHAT]:()=>wy(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,o,a);case Va.UNLINK_ONLY:return function(e,t,n,r,o,a,i){return{alert:Cy(e,t.apiInstitutionName,o,a,[{key:ou,label:"Cancel"},{key:iu,label:"Unlink",type:hu}]),actions:{success:()=>{i?r({plaidEvent:Vm,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Unlink Bank Error button pressed"}):n({id:String(t.id),removeFromApi:!0})}}}}(u,e,t,c,o,a,s);default:return Ay(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,o,a)}var p,g,m,v}const Iy=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){zr({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function Sy({task:e}){const{linkPlaid:t,loading:n}=$m(),{linkPlaid:r,loading:o}=ev(),a=Ey(e?.meta?.plaidItem),i=n&&"RELINK"===e.type,l=o&&"LINK_BANK"===e.type&&!1,s="RELINK"!==e.type&&"LINK_BANK"!==e.type&&Zn(a);return i||l||s?null:S(ky,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:Um,plaidItemId:e?.meta?.plaidItem?.id,apiAccessToken:e?.meta?.plaidItem?.apiAccessToken,apiErrorCode:e?.meta?.plaidItem?.apiErrorCode,message:"Fix Relink Bank Error button pressed"}):"LINK_BANK"===e.type?(jr("Plaid Banner Link Bank clicked",{plaidItem:e?.meta?.plaidItem}),r({plaidEvent:Bm,message:"Plaid Banner Link Bank pressed"})):Xn(a)&&(jr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),Iy(a))}})}const Ny=Bn(Pn.banner,Pn["banner-default"],xy({priority:"DEFAULT"}));function Ry(){const e=jf()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return S("div",{...Ny,children:S(my,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const Py=Bn(Pn.banner,Pn["banner-default"],xy({priority:"DEFAULT"}));function Dy(){const e=jf()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return S("div",{...Py,children:S(my,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const Ly=An({width:"100%",height:72,minWidth:"300px"});function My(){return R(N,{children:[S(pa,{styles:Ly}),S(pa,{styles:Ly}),S(pa,{styles:Ly})]})}function Oy({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const o=e.length>0;return r?S(My,{}):o?e.map(e=>{if(void 0===Ri[e.type]||"ONBOARDING_FORM"===e.type&&Zn(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(Va).includes(e.type))return S(Sy,{task:e},e.id);const n=e.actionLink,r=Xn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return S(ky,{task:e,handleClick:r},e.id)}):S(n?Dy:Ry,{})}const Fy=Bn(Pn["button-table-header"]),By=An({height:{xl:"auto",base:"44px"}});function Uy(){const e=ai({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return S("div",{className:By,children:R(vs,{onClick:()=>{Ml(e?"BanksAndIntegrations":"NewConnection")},width:"fill-parent",stylists:[Fy],children:[S(Yi,{Component:Kd}),S(Fs,{children:"Banks & Integrations"})]})})}const Vy=Bn(Pn["business-owner-dashboard"],An({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),Wy=An({display:"flex",width:"100%",justifyContent:"center"}),Hy=e=>{const t=La[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},qy={status:{in:["ACTIVE","INACTIVE"]}},jy={filter:{status:{in:["ACTIVE"]}}};function zy({period:e,onChangePeriod:t}){const{sortInstance:n,setSortInstance:r,apiSort:o}=function(){const[e,t]=y(void 0);return{sortInstance:e,setSortInstance:x(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in ul)??!1,n=(e.direction&&e.direction in hl)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:a},isFilling:i,paginationControls:l}=vl({limit:10,sort:o,filter:Oa}),s=a?.data??Ba,c=jf(),{query:{data:d},isFilling:u}=Oi({select:e=>Fi(e,c)},jy),{query:{data:h}}=Ei(),{query:{data:p}}=ei(),g=jf(),v=m(()=>{let e=[];const t=p?.data;t&&(e=t.map(e=>za(e)));let n=[];!1===h?.hasPlaidLinkedBankAccount&&(n=[ja]);const r=d??[];return[...e,...n,...r]},[d,h,p]),b=function(){const{query:{data:e}}=jl({filter:qy,limit:1});return(e?.data?.length??0)>0}(),f=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(b,h),T=/* @__PURE__ */new Date,k={month:T.getMonth(),year:T.getFullYear()};const[w,C]=Hs(k,e,t),A=(E=w.month,{beginDate:Ze((I=w.year)-1,E+1,1),endDate:Ze(I,E+1,0)});var E,I;return S("div",{className:Wy,children:R("div",{...Vy,children:[R(Vn,{children:[S(_n,{children:"Action Items"}),S(Uy,{})]}),S(Ra,{children:S(Oy,{taskBanners:v,handleScrollAction:Hy,isWaitingForPlaidItemAccountsSync:!b&&!0===h?.plaidItemAccountsReadyToSync,isFilling:u})}),!g&&R(N,{children:[S(Ev,{period:w,handleDateChange:e=>{var t,n;(t=k).year===(n=e).year&&n.month>t.month||n.year>t.year||C(e)},todayPeriod:k,showSamples:f,showLinkAccountButton:f&&!h?.plaidItemAccountsReadyToSync}),S(Vn,{children:S(_n,{children:"Financial Summary"})}),S(Ad,{isSample:f,period:w}),S(Sa,{filter:A,isSample:f})]}),S(Jc,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:g}),!g&&S(iy,{})]})})}function _y(e){return S(Kr||N,{children:e.children})}function Ky({children:e}){return S(_y,{children:S("div",{className:Ln(Pn.component),children:e})})}function Yy(e){return S(Ky,{children:S(zy,{...e})})}function Zy(e,t){if(e?.id&&t.id){const n=t.id?.in?.filter(t=>!e.id?.in?.includes(t));return{...t,id:{in:[...e.id.in??[],...n??[]]}}}return e?.id&&!t.id?{...t,id:e.id}:t}const Xy=Object.freeze({toApply:[],toRemove:[]});function Qy(e){return{toApply:[],toRemove:e.map(e=>({name:e.name,value:e.value}))}}function Gy(e,t,n){const r=new Map(e);return r.set(t,n),r}function Jy({modelName:e,numActiveFilters:t,pending:n}){const r=t+n.toApply.length-n.toRemove.length,o=r>0?r:0;return o>0?`${e} (${o})`:e}function $y(e,t,n){return[...e.filter(e=>!n.some(t=>i(e.value,t.value))),...t]}function ex(e,t){const n=e.filter(e=>!t.some(t=>i(t.value,e.value))).map(e=>({name:e.name,value:e.value}));return{toApply:t.filter(t=>!e.some(e=>i(e.value,t.value))),toRemove:n}}function tx({Component:e,stylists:t}){return S(e,{stylists:[Bn(Pn["medium-icon"],Pn.icon),...t??[]],size:17})}const nx=An({display:"flex",alignItems:"center",gap:"9px",flex:"1 0 0"}),rx=Bn(null,An({padding:"16px",backgroundColor:"surface.foreground",width:"100%",borderRadius:"0px",borderTop:"none",_first:{borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"border.layout"},minHeight:"52px"}));function ox({text:e,handleClick:t,iconUrl:n,RightIcon:r,LeftIcon:o,rightIconSize:a="md",leftIconSize:i="md",popupTriggerChildrenProps:l,rightElement:s}){return S(vs,{onClick:t,stylists:[rx],popupTriggerProps:l,children:R("div",{className:nx,children:[R("div",{className:nx,children:[o&&S("md"===i?Yd:Hc,{Component:o}),n&&S("img",{src:n,alt:void 0,width:"md"===i?"15px":"25px",height:"md"===i?"15px":"25px"}),S(Ss,{wrap:"wrap",children:e})]}),s,r&&S("md"===a?Yd:tx,{Component:r})]})})}function ax({children:e,forceMount:t,fadeIn:n=!0}){const r={transform:"none",willChange:"auto",...n?{}:{animation:"none"}};return S(tc,{style:r,forceMount:t,children:e})}const ix=In(An({display:"flex",flexDirection:"row",alignItems:"center",gap:"12px"}),To);function lx({children:e}){return S(N,{children:S("div",{className:ix,children:e})})}const sx=An.raw({display:"flex",flexDirection:"row",minHeight:"55px",justifyContent:"space-between",alignItems:"center",backgroundColor:"surface.foreground",width:"100%",padding:"8px 16px"}),cx=Bn(Pn["drawer-header"],An(sx));function dx({hideDivider:e=!1,children:t}){return R(N,{children:[S("header",{...cx,children:t}),!e&&S(qu,{alignment:"horizontal",color:"normal"})]})}const ux=Bn(null,An({display:"flex",backgroundColor:"surface.intent.action.discreet",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discreet.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),zi),hx=()=>Ol();function px({Icon:e=Ks,handleClose:t=hx}={}){return S("button",{...ux,onClick:t,type:"button",children:S(Yd,{Component:e,...ux})})}const gx={type:"tween",duration:.3},mx={x:"100%"},vx={x:0},bx={x:"100%"},fx=An({display:"flex",flexDirection:"column",position:"fixed",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},backgroundColor:"surface.background"}),yx=Nn({base:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px",flex:"1 1 0",alignSelf:"stretch",overflowY:"auto",width:"100%"},variants:{padChildren:{true:{padding:"16px"},false:{padding:0}}},defaultVariants:{padChildren:!0}}),xx=An({display:"flex",alignItems:"center",flexDirection:"row"});function Tx({children:e,title:t,Footer:n=null,padChildren:r=!0}){const o=zs(),a=x(e=>{e.stopPropagation()},[]);return S(Ae,{children:o.context.open&&S(ax,{fadeIn:!1,forceMount:!0,children:R(Ee.div,{transition:gx,initial:mx,animate:vx,exit:bx,className:fx,onAnimationEnd:a,children:[S(dx,{children:S(lx,{children:R("div",{className:xx,children:[S(px,{Icon:Hi,handleClose:o.close}),S(Vo,{children:t})]})})}),S("div",{className:yx({padChildren:r}),children:e}),n]})})})}function kx({text:e,iconUrl:t,badge:n,title:r,children:o,Footer:a}){const i=n?`${e} ${n}`:e;return R(js,{children:[S(_s,{children:e=>S(ox,{text:i,iconUrl:t,RightIcon:qi,popupTriggerChildrenProps:e})}),S(Tx,{title:r,Footer:a??null,children:o})]})}function wx(e,t){const{items:n,fuseOptions:r,flattenItems:o,buildItemsWithChildren:a,processResults:i}=t,l=m(()=>o(n),[n,o]),s=m(()=>a(l),[l,a]),c=m(()=>new Ce(s??[],r),[s,r]);return m(()=>{if(!s)return{};const t=c.search(e);return function(e){const t={};for(const{parent:n,child:r}of e){const e=n.id;n.id===r.id?t[e]={parent:n,children:[]}:t[e]?t[e].children.push(r):t[e]={parent:n,children:[r]}}return t}(i(t,s))},[s,e,c,i])}const Cx=An({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function Ax({children:e}){return S("div",{className:Cx,children:e})}const Ex=An({display:"flex",flexDirection:"column",gap:"16px"}),Ix=An({display:"flex",flexDirection:"column",gap:"8px"});function Sx({groupedResults:e,onItemClick:t,selectedIds:n}){return S(Ax,{children:S("div",{className:Ex,children:Object.entries(e).map(([e,{parent:r,children:o}])=>{const a=o.length>0;return R("div",{className:Ix,children:[a&&S(Vo,{children:r.name??""}),S("div",{children:a?o.map(e=>S(ox,{text:e.name??"",iconUrl:e.iconUrl,handleClick:()=>t(e),RightIcon:n.has(e.id)?of:void 0},e.id)):S(ox,{text:r.name??"",iconUrl:r.iconUrl,handleClick:()=>t(r),RightIcon:n.has(r.id)?of:void 0},e)})]},e)})})})}const Nx=An({padding:"0",height:{sm:"35px",base:"51px"},cursor:"default",border:0});function Rx(){return S(pa,{styles:In(Vs,Nx)})}const Px=An({width:"70px",height:"24px"}),Dx=An({display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"100%",gap:"16px"});function Lx(){return R("div",{className:Dx,children:[S(pa,{styles:Px}),R(Ax,{children:[S(Rx,{}),S(Rx,{}),S(Rx,{})]}),S(pa,{styles:Px}),R(Ax,{children:[S(Rx,{}),S(Rx,{}),S(Rx,{})]})]})}const Mx=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_9779_2768)"},p.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:"currentColor"}),p.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:"currentColor"}),p.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:"currentColor"}))),"Dots"),Ox=An({paddingTop:"50px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function Fx({singularSearchCTANoun:e,pluralNounNotFound:t,showSearchCTA:n}){return R("div",{className:Ox,children:[S(Yd,{Component:Mx}),S(Vo,{wrap:"wrap",children:`No ${t} found`}),n&&S(Ho,{wrap:"wrap",children:`Try searching for a different ${e}`})]})}function Bx({searchTerm:e,onClick:t,categories:n,isFilling:r,selectedIds:o}){const a=wx(e,{items:n,fuseOptions:Hp,flattenItems:e=>e,buildItemsWithChildren:e=>e,processResults:jp});return r?S(Lx,{}):0===Object.keys(a).length?S(Fx,{singularSearchCTANoun:"category",pluralNounNotFound:"categories",showSearchCTA:!0}):S(Sx,{groupedResults:a,onItemClick:t,selectedIds:o})}function Ux(e,t){return Db(e,t).map(e=>({parent:e.parent,child:e.child}))}function Vx({searchTerm:e,onClick:t,glAccounts:n,isFilling:r,selectedIds:o}){const a=wx(e,{items:n,fuseOptions:Rb,flattenItems:e=>e,buildItemsWithChildren:e=>e,processResults:Ux});return r?S(Lx,{}):0===Object.keys(a).length?S(Fx,{singularSearchCTANoun:"GL account",pluralNounNotFound:"GL accounts",showSearchCTA:!0}):S(Sx,{groupedResults:a,onItemClick:t,selectedIds:o})}function Wx(e,t){return e.value?.[t]?.value?.id?.in??[]}function Hx(e,t,n){return{currentChildren:{toApply:e.toApply.filter(e=>Wx(e,n).some(e=>t.includes(e))),toRemove:e.toRemove.filter(e=>Wx(e,n).some(e=>t.includes(e)))},rest:{toApply:e.toApply.filter(e=>!Wx(e,n).some(e=>t.includes(e))),toRemove:e.toRemove.filter(e=>!Wx(e,n).some(e=>t.includes(e)))}}}function qx(e,t,n){const r=[];e.forEach(e=>Wx(e,n).forEach(e=>r.push(e))),t.toApply.forEach(e=>Wx(e,n).forEach(e=>r.push(e)));const o=t.toRemove.map(e=>Wx(e,n)).flat();return new Set(r.filter(e=>!o.includes(e)))}function jx(e,t,n,r){return x(o=>{t&&r&&r(r=>{const a=t.selectedValues(n).filter(t=>Wx(t,e).some(e=>o.includes(e))),i=r.get(e)??Xy,{rest:l}=Hx(i,o,e),s=Qy(a);return Gy(r,e,{toApply:l.toApply,toRemove:[...l.toRemove,...s.toRemove]})})},[t,n,r,e])}const zx=An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout}",marginTop:"auto",width:"100%"});function _x({onClearAll:e,onApply:t,isApplyButtonDisabled:n=!1}){return R("div",{className:zx,children:[S(sc,{onClick:e,children:S(Ss,{children:"Clear All"})}),R(vs,{type:"button",onClick:t,disabled:n,children:[S(Ss,{children:"Apply"}),S(Yi,{Component:Bu})]})]})}const Kx=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search",{styleIconKey:"search"}),Yx=An({display:"flex",flexDirection:"column",justifyContent:"start",gap:"8px",width:"100%"}),Zx=An({display:"flex",padding:"16px",flexDirection:"row",alignItems:"center",gap:"8px",flex:"1 0 0",borderRadius:"sm",border:"1px solid {colors.border.layout}",backgroundColor:"surface.foreground",maxHeight:"49px",minWidth:"fit-content"}),Xx=In(An({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",border:"none",outline:"none",_placeholder:{color:"typography.label.sub"}}),jn({label:"strongLabel"})),Qx=Bn(null,An({padding:0,outline:"none",border:"none",backgroundColor:"transparent"}));function Gx({searchTerm:e,setSearchTerm:t,placeholder:n}){return R("div",{className:Yx,children:[S(Vo,{children:"Search"}),R("div",{className:Zx,children:[S(Yd,{Component:Kx}),S("input",{type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:Xx}),Jn(e)&&S(vs,{stylists:[Qx],onClick:()=>t(""),children:S(Yd,{Component:Ks})})]})]})}function Jx({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:o,listLength:a,forceSearchVisible:i}){const[l,s]=y("");return S(up,{searchTerm:l,setSearchTerm:s,onClick:t=>{e?.(t)},placeholder:t,SearchInput:Gx,SearchList:n,DefaultList:r,extraProps:o,listLength:a,forceSearchVisible:i})}function $x({onApply:e,onClearAll:t}){const n=zs();return S(_x,{onApply:()=>{e(),n.close()},onClearAll:t})}function eT({category:e,badge:t,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c}){const d=m(()=>e.children?.map(e=>e.id)??[],[e.children]),u=x(()=>{a(d)},[d,a]),h=x(()=>{if(d&&i&&s&&c&&l){const e=l.get("category")??Xy,{currentChildren:t,rest:n}=Hx(e,d,"category"),r=$y(i,t.toApply,t.toRemove);c(r),s(e=>Gy(e,"category",n))}},[d,i,l,s,c]),p=S($x,{onApply:h,onClearAll:u});return S(kx,{text:e.name??"",iconUrl:e.iconUrl,badge:t,title:"All Categories",Footer:p,children:S(Jx,{placeholder:"Search expense categories...",onClick:o,SearchList:Bx,DefaultList:tT,listLength:e.children?.length??0,extraProps:{categories:e.children??[],label:e.name??"",isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c}})})}function tT({categories:e,label:t,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c}){return n?S(Lx,{}):R(Ax,{children:[S(Vo,{children:t}),S("div",{children:e.map(e=>{if(e.hasChilds){const t=e.children?.map(e=>e.id),d=t?t.filter(e=>r.has(e)).length:0,u=d>0?`(${d})`:void 0;return S(eT,{categories:e.children??[],label:e.name??"",category:e,badge:u,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c},e.id)}return S(ox,{text:e.name??"",iconUrl:e.iconUrl,handleClick:()=>o(e),RightIcon:r.has(e.id)?of:void 0},e.id)})})]})}const nT=[];function rT({filters:e,pendingFilters:t,onToggle:n,model:r,setPendingFilters:o,setFilters:a}){const{query:{data:i},isFilling:l}=Dp(),s=i?.data??nT,c=t.get("category")??Xy,d=qx(r?r.selectedValues(e):[],c,"category"),u=x(e=>{const t=oT(e);n(t)},[n]),h=jx("category",r,e,o);return o&&a?S(Jx,{placeholder:"Search expense categories...",onClick:u,SearchList:Bx,DefaultList:tT,listLength:s.length,extraProps:{categories:s,label:"All Expense Categories",isFilling:l,selectedIds:d,onToggle:u,onClearAllChildren:h,filters:e,pendingFilters:t,setPendingFilters:o,setFilters:a}}):null}function oT(e){const t=e.name??"",n=(e=>e.id?e.id.toString():"")(e);return{name:t,value:{category:{name:t,value:{id:{in:[n]}}}}}}function aT(e){return ze({key:"category",name:"Category",NestedListComponent:rT,possibleValues:e})}const iT=v(void 0);function lT(){return b(iT)}const sT=e=>["sdk/introspect",e];function cT(e){return async t=>{const n=t.queryKey;return async function(e,t,n){const r={path:"/sdk/introspect",accessToken:e,environment:t,params:n?{theme:n}:void 0};return await sl(r)}(n[2].accessToken,n[2].environment,e)}}function dT(){const e=lT();return ir({queryKey:sT(e),queryFn:cT(e)})}const uT=[{value:"in",label:"In"}];function hT(e){return ze({key:"reviewStatus",name:"Review Status",possibleValues:e,operators:uT})}function pT(e){return e.value.reviewStatus?.value.in?e.value.reviewStatus.value.in:e.value.reviewStatus?.value.notIn?e.value.reviewStatus.value.notIn:[]}const gT=h.object({minAmount:h.number().nullable(),maxAmount:h.number().nullable()}).refine(e=>null===e.minAmount||null===e.maxAmount||e.minAmount<=e.maxAmount,{message:"Minimum amount must be less than or equal to maximum amount",path:["amounts"]});function mT(e,t,n){let r=t,o=n;return e.forEach(e=>{const t=e.value.amount?.value;if(t){const e={minAmount:Xn((n=t).greaterThanEqual)?$h(n.greaterThanEqual):null,maxAmount:Xn(n.lessThanEqual)?$h(n.lessThanEqual):null};r=e.minAmount??r,o=e.maxAmount??o}var n}),{minAmount:r,maxAmount:o}}function vT(e,t,n){let r=null,o=null;const a=e.operators?.find(e=>"greaterThanEqual"===e.value),i=e.operators?.find(e=>"lessThanEqual"===e.value);if(!a||!i)return{minAmount:r,maxAmount:o};if(t){const n=mT(e.selectedValues(t),r,o);r=n.minAmount,o=n.maxAmount}if(n&&n.toRemove.forEach(e=>{const t=e.value.amount?.value;t&&(Xn(t.greaterThanEqual)&&(r=null),Xn(t.lessThanEqual)&&(o=null))}),n){const e=mT(n.toApply,r,o);r=e.minAmount,o=e.maxAmount}return{minAmount:r,maxAmount:o}}const bT=An({display:"flex",minHeight:0,width:"100%",height:"100%",justifyContent:"space-between",flexDirection:"column"});function fT({children:e,title:t}){return S(Tx,{title:t,padChildren:!1,children:S("form",{onSubmit:e=>{e.preventDefault()},className:bT,children:e})})}const yT=An({display:"flex",flexDirection:"row",width:"100%",alignItems:"center",gap:"16px"}),xT=An({display:"flex",flexDirection:"column",flex:1}),TT=An({display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between",padding:"16px"});function kT({model:e,setFilters:t,pendingFilters:n,setPendingFilters:r,filters:o}){return S(fT,{title:"Amount",children:S(wT,{model:e,setFilters:t,pendingFilters:n,setPendingFilters:r,filters:o})})}function wT({model:e,setFilters:t,pendingFilters:n,setPendingFilters:r,filters:o}){const a=function({model:e,setFilters:t,filters:n,setPendingFilters:r,pendingFilters:o}){const a=zs();return hm({defaultValues:vT(e,n,o),validators:{onChange:gT},onSubmit:()=>{if(!o||!n)return;const e=$y(n,o.toApply,o.toRemove);t(e),r&&r(Xy),a.close()}})}({model:e,setFilters:t,filters:o,setPendingFilters:r,pendingFilters:n}),i=Te(a.store,e=>e),l=i.errorMap&&Object.values(i.errorMap).some(e=>void 0!==e),s=()=>{if(!r||!o)return;if(l)return void r({toApply:[],toRemove:[]});const t=function(e,t,n,r){return ex(n.selectedValues(r),function(e,t,n){const r=n.operators?.find(e=>"greaterThanEqual"===e.value),o=n.operators?.find(e=>"lessThanEqual"===e.value),a=[];if(null!==e&&r){const t=Oo(e,{dollarSign:!0,signage:"default"}),o=ep(e),i=n.createFilter({name:`${t}${r.label}`,value:{[n.key]:{name:"",value:{[r.value]:o}}}});a.push(i)}if(null!==t&&o){const e=Oo(t,{dollarSign:!0,signage:"default"}),r=ep(t),i=n.createFilter({name:`${o.label} ${e}`,value:{[n.key]:{name:"",value:{[o.value]:r}}}});a.push(i)}return a}(e,t,n))}(a.getFieldValue("minAmount"),a.getFieldValue("maxAmount"),e,o);r(t)};return R(N,{children:[S("div",{className:TT,children:R(Ax,{children:[R("div",{className:yT,children:[S("div",{className:xT,children:S(a.AppField,{name:"minAmount",listeners:{onBlur:s},children:e=>S(e.EditableAmountField,{label:"Minimum",autofocus:!0,hasErrorStyles:l})})}),S(Vo,{children:"To"}),S("div",{className:xT,children:S(a.AppField,{name:"maxAmount",listeners:{onBlur:s},children:e=>S(e.EditableAmountField,{label:"Maximum",hasErrorStyles:l})})})]}),l&&S(Zu,{errorMessage:Object.values(i.errorMap)[0].amounts[0].message})]})}),S(_x,{onApply:a.handleSubmit,onClearAll:()=>{if(a.setFieldValue("minAmount",null),a.setFieldValue("maxAmount",null),r&&o){const t=e.selectedValues(o);r(Qy(t))}},isApplyButtonDisabled:l})]})}const CT=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"greaterThan",label:"Greater than"},{value:"greaterThanEqual",label:"+"},{value:"lessThan",label:"Less than"},{value:"lessThanEqual",label:"Up to"}];function AT(e,t){let n;return e.forEach(e=>{const r=e.value[t]?.value?.contain;r&&(n=r)}),n||""}function ET(e,t,n,r){let o="";const a=t.operators?.find(e=>"contain"===e.value);if(!a)return o;if(n&&(o=AT(t.selectedValues(n),e)),r){r.toRemove.forEach(t=>{t.value[e]?.value?.contain&&(o="")});const t=AT(r.toApply,e);t&&(o=t)}return o}const IT=An({display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between",padding:"16px"});function ST({model:e,setFilters:t,filters:n,setPendingFilters:r,pendingFilters:o}){return S(fT,{title:"Back",children:S(NT,{model:e,setFilters:t,filters:n,setPendingFilters:r,pendingFilters:o})})}function NT({model:e,setFilters:t,filters:n,setPendingFilters:r,pendingFilters:o}){const a=function({model:e,setFilters:t,filters:n,setPendingFilters:r,pendingFilters:o}){const a=zs();return hm({defaultValues:{[e.key]:ET(e.key,e,n,o)},onSubmit:()=>{if(!n||!o)return;const e=$y(n,o.toApply,o.toRemove);t(e),r&&r(Xy),a.close()}})}({model:e,setFilters:t,filters:n,setPendingFilters:r,pendingFilters:o});return R(N,{children:[S("div",{className:IT,children:S(Ax,{children:S(a.AppField,{name:e.key,listeners:{onBlur:()=>{const t=function(e,t,n){const r=t.selectedValues(n),o=function(e,t){const n=e.trim();if(!n)return null;const r=t.operators?.find(e=>"contain"===e.value);return r?t.createFilter({name:`${r.label} "${n}"`,value:{[t.key]:{name:"",value:{[r.value]:n}}}}):null}(e,t);return ex(r,o?[o]:[])}(a.getFieldValue(e.key),e,n);r(t)}},children:t=>S(t.TextAreaInput,{label:"Contains",placeholder:`Filter ${e.key}...`,autofocus:!0,resizeable:!1})})})}),S(_x,{onApply:a.handleSubmit,onClearAll:()=>{if(a.setFieldValue(String(e.key),""),r&&n){const t=e.selectedValues(n);r(Qy(t))}}})]})}const RT=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function PT(e){return ze({key:"bankAccount",name:"Bank Account",possibleValues:e})}const DT=e=>e.value.bankAccount?.value.id?.in?e.value.bankAccount?.value.id?.in:e.value.bankAccount?.value.id?.notIn?e.value.bankAccount?.value.id?.notIn:[],LT=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await sl(n),o=void 0!==r.data?r.data.map(e=>({...e,id:ui({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:o}};function MT(e){return ze({key:"customer",name:"Customer",possibleValues:e})}function OT(e){return ze({key:"vendor",name:"Vendor",possibleValues:e})}function FT(){return{values:Object.entries(gi).map(([e,t])=>function(e,t){const n="in";return{name:t,value:{type:{name:t,value:{[n]:e.map(e=>e.value)}}}}}(t,e))}}const BT=Nn({base:{width:"9px",height:"9px",borderRadius:"9999px",outline:"3px solid",outlineOffset:"3px",display:"flex",alignItems:"center",justifyContent:"center"},variants:{isSelected:{true:{backgroundColor:"brand.action.stronger",outlineColor:"brand.action.stronger"},false:{backgroundColor:"transparent",outlineColor:"brand.primary"}}}});function UT({isSelected:e}){return S("div",{className:BT({isSelected:e})})}function VT({filters:e,model:t,setFilters:n}){const r=zs();if(!t||!n)return null;const o=t.possibleValues?.();if(!o)return null;const a=t.selectedValues(e);return R(Ax,{children:[S(Ho,{children:"Filter by"}),S("div",{children:o.values.map((o,l)=>{const s=(c=o,0===a.length?jT(c.value.status?.value):a.some(e=>i(e.value,c.value)));var c;return S(ox,{text:o.name,handleClick:()=>(o=>{if(a.some(e=>i(e.value,o.value)))return void r.close();const l=a.map(e=>({name:e.name,value:e.value})),s=t.createFilter(o),c=$y(e,[s],l);n(c),r.close()})(o),rightElement:S(UT,{isSelected:s})},`${o.name}_${l}`)})})]})}const WT="status",HT=[{name:"Active",apiStatuses:["ACTIVE"]},{name:"Archived",apiStatuses:["INACTIVE"]},{name:"Active and Archived",apiStatuses:["ACTIVE","INACTIVE"]}];function qT(){const e="in";return{values:HT.map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[...t.apiStatuses]}}}}))}}function jT(e){if(!e)return!1;const t=e.in;return Array.isArray(t)&&1===t.length&&"ACTIVE"===t[0]}function zT(e){return jT(e.value.status?.value)}const _T=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],KT=(YT={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,reconciliationMatch:!0,invoice:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(YT));var YT;function ZT({onApply:e,onClearAll:t}){const n=zs();return S(_x,{onApply:()=>{e(),n.close()},onClearAll:t})}function XT({glAccount:e,badge:t,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c}){const d=m(()=>e.children?.map(e=>e.id)??[],[e.children]),u=x(()=>{a(d)},[d,a]),h=x(()=>{if(d&&i&&s&&c&&l){const e=l.get("glAccount")??Xy,{currentChildren:t,rest:n}=Hx(e,d,"glAccount"),r=$y(i,t.toApply,t.toRemove);c(r),s(e=>Gy(e,"glAccount",n))}},[d,i,l,s,c]),p=S(ZT,{onApply:h,onClearAll:u});return S(kx,{text:e.name,iconUrl:e.iconUrl,badge:t,title:"All GL Accounts",Footer:p,children:S(Jx,{placeholder:"Search GL accounts...",onClick:o,SearchList:Vx,DefaultList:QT,listLength:e.children?.length??0,extraProps:{glAccounts:e.children??[],label:e.name,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c}})})}function QT({glAccounts:e,label:t,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c}){return n?S(Lx,{}):R(Ax,{children:[S(Vo,{children:t}),S("div",{children:e.map(e=>{if(e.hasChilds){const t=e.children?.map(e=>e.id),d=t?t.filter(e=>r.has(e)).length:0,u=d>0?`(${d})`:void 0;return S(XT,{glAccounts:e.children??[],label:e.name,glAccount:e,badge:u,isFilling:n,selectedIds:r,onToggle:o,onClearAllChildren:a,filters:i,pendingFilters:l,setPendingFilters:s,setFilters:c},e.id)}return S(ox,{text:e.name,iconUrl:e.iconUrl,handleClick:()=>o(e),RightIcon:r.has(e.id)?of:void 0},e.id)})})]})}const GT=[];function JT({filters:e,pendingFilters:t,onToggle:n,model:r,setPendingFilters:o,setFilters:a}){const{query:{data:i},isFilling:l}=lg(),s=i??GT,c=t.get("glAccount")??Xy,d=qx(r?r.selectedValues(e):[],c,"glAccount"),u=x(e=>{const t=$T(e);n(t)},[n]),h=jx("glAccount",r,e,o);return o&&a?S(Jx,{placeholder:"Search GL accounts...",onClick:u,SearchList:Vx,DefaultList:QT,listLength:s.length,extraProps:{glAccounts:s,label:"All GL Accounts",isFilling:l,selectedIds:d,onToggle:u,onClearAllChildren:h,filters:e,pendingFilters:t,setPendingFilters:o,setFilters:a}}):null}function $T(e){const t=e.name;return{name:t,value:{glAccount:{name:t,value:{id:{in:[e.id]}}}}}}function ek(e){return ze({key:"glAccount",name:"GL Account",NestedListComponent:JT,possibleValues:e})}function tk(){const{filters:e,setFilters:t,addFilters:n,removeFilter:r,hasUserConfiguredTransactionFilters:o}={filters:Bt(e=>e.transactionsDashFilters),setFilters:Bt(e=>e.setTransactionsDashFilters),addFilters:Bt(e=>e.addTransactionsDashFilters),removeFilter:Bt(e=>e.removeTransactionsDashFilter),hasUserConfiguredTransactionFilters:Bt(e=>e.hasInitializedTransactionFilters)},{getCategories:a,getBankAccounts:i,getVendors:l,getCustomers:c,getGlAccounts:d,getReviewStatuses:u}=function(){const e=function(){const{query:{data:e},isFilling:t}=Pp(),n=e?.data,r=m(()=>n?.map(oT),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),t=function(){const{query:{data:e},isFilling:t}=ai(),n=e?.data,r=function({institutionIds:e}){const t=er(),n=ar(),r=[...new Set(e)],o=F({queries:r.map(e=>({queryKey:Rg({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>({institutionId:e,data:await $d({institutionId:e,accessToken:t,environment:n})}),staleTime:864e5}))}),a={};return o.forEach(e=>{e.data&&(a[e.data.institutionId]=e.data?.data?.map?.logo)}),a}({institutionIds:m(()=>n?.map(e=>e.integration?.apiInstitutionId).filter(e=>Xn(e))??[],[n])}),o=m(()=>n?.map(e=>{const t=e?.name,n=e?.mask,o=si(t,n);return{name:o,iconUrl:r[e.integration?.apiInstitutionId??""],value:{bankAccount:{name:o,value:{id:{in:[e.id]}}}}}}),[n,r]);return x(()=>({values:o??[],isFilling:t}),[o,t])}(),n=function(){const{query:{data:e},isFilling:t}=im(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Customer";return{name:t,value:{customer:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),r=function(){const{query:{data:e},isFilling:t}=Xg(),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Vendor";return{name:t,value:{vendor:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[t,r])}(),o=function(){const{query:{data:e},isFilling:t}=ir({queryKey:["clientMgmt/businesses","classSegments"],queryFn:LT}),n=e?.data,r=m(()=>n?.map(e=>{const t=e.name??"Unknown Class Segment";return{name:t,value:{classSegments:{name:t,value:{id:{in:[e.id]}}}}}}),[n]);return x(()=>({values:r??[],isFilling:t}),[r,t])}(),a=function(){const{query:{data:e},isFilling:t}=sg(),n=m(()=>e?.map(e=>$T(e)),[e]);return x(()=>({values:n??[],isFilling:t}),[n,t])}(),i=function(){const e=function(){const{query:{data:e}}=dT();return"ACCOUNTANT"===e?.userRole}(),t=m(()=>function(e){const t="in";return[...e].map(e=>({name:e.name,value:{reviewStatus:{name:e.name,value:{[t]:e.value}}}}))}(e?sf:lf),[e]);return x(()=>({values:t,isFilling:!1}),[t])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:o,getGlAccounts:a,getReviewStatuses:i}}(),h=m(()=>({reviewStatus:hT(u),amount:ze({key:"amount",name:"Amount",operators:CT,ModalComponent:kT}),bankAccount:PT(i),category:aT(a),customer:MT(c),date:Nt,description:ze({key:"description",name:"Description",operators:RT,ModalComponent:ST}),glAccount:ek(d),notes:ze({key:"notes",name:"Notes",operators:_T,ModalComponent:ST}),status:ze({key:WT,name:"Status",possibleValues:qT,singleSelect:!0,SimpleListComponent:VT}),vendor:OT(l),type:ze({key:"type",name:"Type",possibleValues:FT}),search:Ke}),[i,a,l,c,d,u]),p=m(()=>[h.reviewStatus,h.amount,h.bankAccount,h.category,h.customer,h.date,h.description,h.glAccount,h.notes,h.status,h.type,h.vendor],[h.reviewStatus,h.amount,h.bankAccount,h.category,h.customer,h.date,h.description,h.glAccount,h.notes,h.status,h.type,h.vendor]),g=/* @__PURE__ */(new Date).getDate(),v=m(()=>function(e){const t=e.reduce(nk,{});return t.status||(t.status={in:["ACTIVE"]}),function(e){const t={...e};return KT.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(t)}(e),[e,g]),b=x(e=>h[e],[h]);return{filters:e,filterPopupModels:p,setFilters:t,addFilters:n,removeFilter:r,apiFilters:v,getModel:b,hasUserConfiguredTransactionFilters:o}}function nk(e,t){const n={},r=t.value;var o,a,i,l;return r.date&&(n.date=function(e){const t=ct(e);return{greaterThanEqual:t.beginDate,lessThanEqual:t.endDate}}(r.date.value)),r.amount&&(n.amount=(o=e.amount,a=r.amount.value,o?{...o,...a}:a)),r.description&&(n.description=r.description.value),r.category&&(n.category=(i=e.category,l=r.category.value,Zy(i,l))),r.reviewStatus&&(n.reviewStatus=function(e,t){return e&&e.in?t.in?{...e,in:[.../* @__PURE__ */new Set([...e.in,...t.in])]}:e:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return Zy(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return Zy(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return Zy(e,t)}(e.glAccount,r.glAccount.value)),r.type&&(n.type=function(e,t){return e&&e.in?t.in?{...e,in:[.../* @__PURE__ */new Set([...e.in,...t.in])]}:e:t}(e.type,r.type.value)),r.search&&(n.search=r.search.value),r.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return Zy(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return Zy(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}function rk(e,t=500,n){const r=g();!function(e){const t=g(e);t.current=e,T(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const o=m(()=>{const o=c(e,t,n),a=(...e)=>o(...e);return a.cancel=()=>{o.cancel()},a.isPending=()=>!!r.current,a.flush=()=>o.flush(),a},[e,t,n]);return T(()=>{r.current=c(e,t,n)},[e,t,n]),o}const ok=An({animation:"linear 1s spin infinite"}),ak={background:"conic-gradient(from 90deg,rgba(255, 255, 255, 0) 0deg,rgba(148, 216, 232, 1) 360deg)",height:"100%",width:"100%",opacity:1};function ik({size:e}){const t=e??15;return R("svg",{className:ok,width:t,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[S("g",{clipPath:"url(#paint0_angular_27751_8190_clip_path)","data-figma-skip-parse":"true",children:S("g",{transform:"matrix(0 0.0075 -0.0075 0 8.5 8.5)",children:S("foreignObject",{x:"-1266.67",y:"-1266.67",width:"2533.33",height:"2533.33",children:S("div",{style:ak})})})}),S("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"stopsVar":[{"color":{"r":1.0,"g":1.0,"b":1.0,"a":0.0},"position":0.0},{"color":{"r":0.68932884931564331,"g":0.88676470518112183,"b":0.93322020769119263,"a":0.74038463830947876},"position":0.69711536169052124},{"color":{"r":0.58039218187332153,"g":0.84705883264541626,"b":0.90980392694473267,"a":1.0},"position":1.0}],"transform":{"m00":-9.1848822316819949e-16,"m01":-14.999998092651367,"m02":15.999998092651367,"m10":14.999998092651367,"m11":-9.1848822316819949e-16,"m12":1.0},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),S("defs",{children:S("clipPath",{id:"paint0_angular_27751_8190_clip_path",children:S("path",{d:"M15.4291 11.3701L14.5052 10.9874L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052L11.3701 15.4291ZM8.5 16V15V16ZM5.62987 15.4291L6.01256 14.5052L5.62987 15.4291ZM3.1967 13.8033L2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874L1.5709 11.3701ZM1 8.5H2H1ZM1.5709 5.62987L2.49478 6.01256L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478L5.62987 1.5709ZM8.5 1V2V1ZM11.3701 1.5709L10.9874 2.49478L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256L15.4291 5.62987ZM16 8.5H15C15 9.35359 14.8319 10.1988 14.5052 10.9874L15.4291 11.3701L16.353 11.7528C16.7801 10.7215 17 9.61623 17 8.5H16ZM15.4291 11.3701L14.5052 10.9874C14.1786 11.7761 13.6998 12.4926 13.0962 13.0962L13.8033 13.8033L14.5104 14.5104C15.2997 13.7211 15.9258 12.7841 16.353 11.7528L15.4291 11.3701ZM13.8033 13.8033L13.0962 13.0962C12.4926 13.6998 11.7761 14.1786 10.9874 14.5052L11.3701 15.4291L11.7528 16.353C12.7841 15.9258 13.7211 15.2997 14.5104 14.5104L13.8033 13.8033ZM11.3701 15.4291L10.9874 14.5052C10.1988 14.8319 9.35359 15 8.5 15V16V17C9.61623 17 10.7215 16.7801 11.7528 16.353L11.3701 15.4291ZM8.5 16V15C7.64641 15 6.80117 14.8319 6.01256 14.5052L5.62987 15.4291L5.24719 16.353C6.27846 16.7801 7.38376 17 8.5 17V16ZM5.62987 15.4291L6.01256 14.5052C5.22394 14.1786 4.50739 13.6998 3.90381 13.0962L3.1967 13.8033L2.48959 14.5104C3.27889 15.2997 4.21592 15.9258 5.24719 16.353L5.62987 15.4291ZM3.1967 13.8033L3.90381 13.0962C3.30022 12.4926 2.82144 11.7761 2.49478 10.9874L1.5709 11.3701L0.647024 11.7528C1.07419 12.7841 1.70029 13.7211 2.48959 14.5104L3.1967 13.8033ZM1.5709 11.3701L2.49478 10.9874C2.16813 10.1988 2 9.35359 2 8.5H1L0 8.5C-1.19209e-07 9.61623 0.219859 10.7215 0.647024 11.7528L1.5709 11.3701ZM1 8.5H2C2 7.64641 2.16813 6.80117 2.49478 6.01256L1.5709 5.62987L0.647024 5.24719C0.219859 6.27846 1.19209e-07 7.38376 0 8.5L1 8.5ZM1.5709 5.62987L2.49478 6.01256C2.82144 5.22394 3.30023 4.50739 3.90381 3.90381L3.1967 3.1967L2.48959 2.48959C1.70029 3.27889 1.07419 4.21592 0.647024 5.24719L1.5709 5.62987ZM3.1967 3.1967L3.90381 3.90381C4.50739 3.30022 5.22394 2.82144 6.01256 2.49478L5.62987 1.5709L5.24719 0.647023C4.21592 1.07419 3.27889 1.70029 2.48959 2.48959L3.1967 3.1967ZM5.62987 1.5709L6.01256 2.49478C6.80117 2.16813 7.64641 2 8.5 2V1V0C7.38376 -1.19209e-07 6.27846 0.219859 5.24719 0.647023L5.62987 1.5709ZM8.5 1V2C9.35359 2 10.1988 2.16813 10.9874 2.49478L11.3701 1.5709L11.7528 0.647024C10.7215 0.219859 9.61624 1.19209e-07 8.5 0V1ZM11.3701 1.5709L10.9874 2.49478C11.7761 2.82144 12.4926 3.30023 13.0962 3.90381L13.8033 3.1967L14.5104 2.48959C13.7211 1.70029 12.7841 1.07419 11.7528 0.647024L11.3701 1.5709ZM13.8033 3.1967L13.0962 3.90381C13.6998 4.50739 14.1786 5.22394 14.5052 6.01256L15.4291 5.62987L16.353 5.24719C15.9258 4.21592 15.2997 3.27889 14.5104 2.48959L13.8033 3.1967ZM15.4291 5.62987L14.5052 6.01256C14.8319 6.80117 15 7.64641 15 8.5L16 8.5H17C17 7.38376 16.7801 6.27846 16.353 5.24719L15.4291 5.62987ZM16 8.5H17V8.5H16H15V8.5H16Z"})})})]})}const lk=Bn(Pn["filter-bar"],An({display:"flex",padding:"16px",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",borderRadius:"2px",border:"1px solid {colors.border.layout}",background:"surface.foreground",xl:{display:"flex",flex:"1 0 0",flexDirection:"column",height:"35px",padding:"0 10px",justifyContent:"center",alignItems:"flex-start",gap:"10px",borderRadius:"sm",background:"surface.background"}})),sk=Bn(Pn["filter-search-bar"],An({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),ck=Bn(null,An({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),dk=Bn(null,An({border:"none",outline:"none",background:"transparent",fontSize:"lg",fontStyle:"normal",fontWeight:"sm",lineHeight:"18px",letterSpacing:"0.96px",display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",height:"100%",minWidth:0,padding:0,fontFamily:"label",_placeholder:{color:"typography.base.weak"},xl:{fontSize:"14px",lineHeight:"16px"}}));function uk({onChange:e,searchTerm:t,isFetching:n}){const[r,o]=y(t),[a,i]=y(!1),l=rk(x(t=>{e(t),i(!1)},[e,i]),280),s=An({width:25});return S("div",{...lk,children:R("div",{...sk,children:[S("div",{className:s,children:n||a?S(ik,{}):S(Yd,{stylists:[ck],Component:Kx})}),S("input",{...dk,value:r,onChange:e=>{return t=e.target.value,o(t),a||i(!0),void l(t);var t},placeholder:"Search",onKeyDown:rh})]})})}const hk=An({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),pk=Bn(Pn["filter-pill"],An({display:"inline-flex",height:"25px",padding:"5px 10px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"md",border:"{borderWidths.lg} solid",borderColor:"border.intent.secondary",background:"surface.intent.secondary",fontSize:"sm",fontWeight:"sm",lineHeight:"14px",color:"typography.intent.secondary"})),gk=Bn(null,An({border:"none",background:"none",padding:0,cursor:"pointer"})),mk=Bn(null,An({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function vk({text:e,onClickRemove:t}){return R("div",{...pk,children:[S("div",{...mk,children:e}),S("button",{...gk,onClick:t,children:S(Ys,{Component:Ks,stylists:[Bn(null,hk)]})})]})}function bk({filters:e,removeFilter:t}){return function(e){const t=[];let n=null,r=null,o=null,a=null,i=null;for(let s=0;s<e.length;s++){const l=e[s];if(l.modelKey!==_e&&l.modelKey!==It&&(l.modelKey!==WT||!zT(l))){if("amount"===l.modelKey){null===i&&(i=t.length);const e=l.value.amount?.value;if(Zn(n)&&Xn(e?.greaterThanEqual)){n=s,o=e.greaterThanEqual;continue}if(Zn(r)&&Xn(e?.lessThanEqual)){r=s,a=e.lessThanEqual;continue}}t.push({key:l.id,text:l.name,indicesToRemove:[s]})}}const l=function(e,t,n,r,o){if(null!==e&&null!==t&&null!==n&&null!==r){const a=Oo($h(n),{dollarSign:!0,signage:"default"}),i=Oo($h(r),{dollarSign:!0,signage:"default"});return{key:`${o[e].id}-${o[t].id}`,text:`${a} - ${i}`,indicesToRemove:[e,t].sort((e,t)=>t-e)}}return null!==e?{key:o[e].id,text:o[e].name,indicesToRemove:[e]}:null!==t?{key:o[t].id,text:o[t].name,indicesToRemove:[t]}:null}(n,r,o,a,e);return l&&t.splice(i??t.length,0,l),t}(e).map(e=>S(vk,{text:e.text,onClickRemove:()=>{e.indicesToRemove.forEach(e=>t(e))}},e.key))}const fk=Wi(e=>p.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_24404_41655)"},p.createElement("path",{d:"M1 1V3.366L6.317 9.866V14L8.683 12.817V9.866L14 3.366V1H1Z",strokeWidth:1,strokeMiterlimit:10}))),"Filter"),yk=An({display:"flex",padding:{base:"26px",xl:"16px"},gap:"8px",height:"35px"});function xk(){const e=jf();return S(vs,{onClick:()=>{Ml("TransactionFilterList")},stylists:[Bn(null,yk)],children:e?S(tx,{Component:fk}):R(N,{children:[S(Yi,{Component:fk}),S(Ss,{children:"Filters"})]})})}const Tk=An({width:200,minWidth:200});function kk({dateFilter:e,addFilter:t}){return S(bp,{onClick:()=>t(e),children:S(Vo,{children:rt[e]})})}function wk(){const{getModel:e,addFilters:t}=tk(),{setOpen:n}=zs(),r=r=>{const o=e(It);if(void 0===o)return;const a=o.createFilter({name:rt[r],value:{[o.key]:{name:rt[r],value:r}}});t([a]),n(!1)};return S(tc,{children:R(dp,{style:Tk,children:[S(kk,{dateFilter:nt.ALL_TIME,addFilter:r}),S(qu,{alignment:"horizontal"}),S(kk,{dateFilter:nt.THIS_MONTH,addFilter:r}),S(kk,{dateFilter:nt.LAST_MONTH,addFilter:r}),S(kk,{dateFilter:nt.LAST_3_MONTHS,addFilter:r}),S(kk,{dateFilter:nt.LAST_12_MONTHS,addFilter:r}),S(qu,{alignment:"horizontal"}),S(kk,{dateFilter:nt.THIS_QUARTER,addFilter:r}),S(kk,{dateFilter:nt.LAST_QUARTER,addFilter:r}),S(qu,{alignment:"horizontal"}),S(kk,{dateFilter:nt.THIS_YEAR,addFilter:r}),S(kk,{dateFilter:nt.LAST_YEAR,addFilter:r})]})})}const Ck=[Bn(null,yk)];function Ak(){const{filters:e}=tk(),t=e.find(e=>e.modelKey===It);let n=nt.LAST_12_MONTHS;return void 0!==t&&ot(t.value.date?.value)&&(n=t.value.date.value),R(js,{placement:"bottom-start",children:[S(_s,{children:e=>S(vs,{stylists:Ck,popupTriggerProps:e,children:S(Ss,{children:rt[n]})})}),S(wk,{})]})}const Ek=Bn(Pn["dashboard-header"],An({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),Ik=Bn(null,An({display:"flex",alignItems:"center",gap:"8px",padding:"15px 15px 0 15px",width:"100%",xl:{gap:"12px"}})),Sk=Bn(null,An({flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%",display:"flex"})),Nk=An({display:"none",xl:{display:"flex"}});function Rk({filters:e,removeFilter:t,getModel:n,isFetching:r}){const o=jf(),{addFilters:a}=tk(),i=m(()=>Zn(e)?"":e.find(e=>e.modelKey===_e)?.value.search?.value,[e]);return R("div",{...Ek,children:[R("div",{...Ik,children:[S(uk,{isFetching:r,searchTerm:i,onChange:e=>{const t=n(_e);if(void 0===t)return;const r=t.createFilter({name:"Search",value:{search:{name:e,value:e}}});a([r])}}),S(xk,{}),!o&&S(Ak,{}),S("div",{className:Nk,children:S(Ji,{})})]}),e.length>0&&S("div",{...Sk,children:S(bk,{filters:e,getModel:n,removeFilter:t})})]})}const Pk=Wt.filter(e=>e!==Vt.COMMENTS&&e!==Vt.CLASS_SEGMENT),Dk=Bn(null,An({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function Lk(){return S("div",{...Dk,children:S(Ji,{})})}function Mk({Component:e,stylists:t}){return S(e,{stylists:[Bn(Pn["xx-large-icon"],Pn.icon),...t??[]],size:50})}function Ok(){return R(N,{children:[S(Mk,{Component:Kx}),S(_n,{children:"No results found"}),S(Ho,{wrap:"wrap",children:"Based on the filters that are applied, there are no results to display."})]})}const Fk=v({resetSelected:void 0});function Bk({Icon:e,label:t,children:n,onClick:r}){return n?R(js,{placement:"bottom-start",children:[S(_s,{children:n=>R(sc,{popupTriggerProps:n,children:[e&&S(Yi,{Component:e}),S(Ss,{children:t})]})}),n]}):R(sc,{onClick:r,children:[e&&S(Yi,{Component:e}),S(Ss,{children:t})]})}const Uk=Wi(e=>p.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),p.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}),p.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),p.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function Vk({transactions:e,id:t,label:n}){const{mutate:r}=jb(),o=zs(),{resetSelected:a}=b(Fk);return cf(t)?S(bp,{onClick:()=>(t=>{if(e.length>0){const o=(n=t,e.map(e=>({id:e.id,reviewStatus:n})));r(o)}var n;o.close(),a&&a()})(t),children:n}):null}const Wk={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},Hk=e=>e.map(e=>({id:e.id,status:Wk.INACTIVE})),qk=Wi(e=>p.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.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}),p.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}),p.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),jk=[{id:"delete",label:"Delete",Icon:Uk,component:function({transactions:e,...t}){const{mutate:n}=jb(),r=()=>{const t=Hk(e);n(t)};return S(Bk,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&gu({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:ou,label:"Cancel"},{key:au,label:"Delete",type:pu}]}).then(e=>{e===au&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:qk,filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=jb(),o=e.length;return o>0&&S(Bk,{label:`${t} ${mu("Expense","Expenses",o,!0)}`,...n,children:S(eg,{onClick:function(t){var n,o;t?.id&&r((n=e,o=t.id.toString(),n.map(e=>({id:e.id,categoryId:o}))))}})})}},{id:"recategorize-revenues",label:"Recategorize",Icon:qk,filter:e=>"REVENUE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=jb(),{resetSelected:o}=b(Fk),a=e.length;return S(Bk,{label:`${t} ${mu("Revenue","Revenues",a,!0)}`,...n,children:S(Vb,{onClick:function(t){var n,a;r((n=e,a=t.id,n.map(e=>({id:e.id,glAccountId:a})))),o&&o()},types:gg})})}},{id:"review",label:"Change Review Status",Icon:of,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:Vk},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:Vk},{id:"RECONCILED",label:"Reconciled",component:Vk}]}];function zk({subActionList:e}){return S(dp,{children:e})}function _k({subActions:e,transactions:t,label:n,Icon:r}){const o=m(()=>e.map(e=>{const{component:n,id:r,filter:o,label:a}=e,i=t.filter(e=>!o||o(e));return i.length>0?S(n,{id:r,transactions:i,label:a},r):null}).filter(e=>null!==e),[e,t]);return S(Bk,{label:n,Icon:r,children:S(tc,{children:o.length>0?S(zk,{subActionList:o}):S(bp,{children:S(Ss,{children:"No Actions Available for Selection"})},"no-actions")})})}const Kk=Wi(bf,"Minus"),Yk=An({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"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),Zk=An({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Xk=An({background:"brand.primary.strong",border:"none"}),Qk=Bn(Pn["tiny-icon"],An({color:"white100"}));function Gk({checked:e,onClick:t,allRowsSelected:n,someRowsSelected:r}){const[o,a]=y(e??!1),i=void 0===e?o:e;return R("button",{...Bn(Pn["checkbox-input"],Yk,i?Xk:Zk,zi),type:"button",onClick:n=>{void 0===e&&a(!o),t&&t(n)},"data-is-checked":i,children:[i&&n&&S(Ys,{Component:Bu,stylists:[Qk]}),i&&!n&&r&&S(Ys,{Component:Kk,stylists:[Qk]})]})}const Jk=Bn(null,An({paddingLeft:"20px",paddingRight:"5px"}));function $k({checked:e,onClick:t,allRowsSelected:n,someRowsSelected:r}){return S("div",{...Jk,children:S(Gk,{checked:e,onClick:t,allRowsSelected:n,someRowsSelected:r})})}const ew=Bn(Pn["bulk-select"],An({display:"flex",padding:"12px 0 4px",flexDirection:"column",alignItems:"flex-start",gap:"3px",alignSelf:"stretch"})),tw=Bn(Pn["bulk-select"],An({display:"flex",width:"1226px",alignItems:"center",gap:"10px"}));function nw({table:e}){const t=e.getSelectedRowModel(),n=t.rows.some(e=>"EXPENSE"===e.original.type),r=t.rows.some(e=>"REVENUE"===e.original.type),o=m(()=>t.rows.map(e=>e.original),[t]),a=t.rows.length,i=a>0,l=m(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]),s=e.getIsAllRowsSelected(),c=e.getIsSomeRowsSelected();return S("div",{...ew,children:R("div",{...tw,children:[S($k,{checked:s||c,onClick:e.getToggleAllRowsSelectedHandler(),allRowsSelected:s,someRowsSelected:c}),S(Fk.Provider,{value:l,children:i&&R(N,{children:[S(Vo,{children:`${a} selected`}),jk.map(e=>{if("recategorize-expenses"===e.id&&!n)return null;if("recategorize-revenues"===e.id&&!r)return null;const{component:t,subActions:a,id:i,filter:l,...s}=e,c=o.filter(e=>!l||l(e));return a?S(_k,{subActions:a,transactions:o,...s},i):t&&S(t,{transactions:c,...s},i)})]})})]})})}const rw=An({padding:"8px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"surface.elevated",border:"none",gap:"8px"});function ow({formattedDate:e,formattedSum:t}){return R("div",{className:rw,children:[S(Vo,{wrap:"wrap",children:e}),S(Vo,{wrap:"wrap",children:t})]})}function aw({rows:e}){const t=m(()=>function(e){return Array.from(function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=n.original.date;if(t.has(e)){const r=t.get(e);r&&(r.netSumCents+=n.original.amount,r.formattedSumDollars=Bo($h(r.netSumCents)),r.rows.push(n))}else{const r=yt(e);t.set(e,{date:e,formattedDate:r?vt(r):e,netSumCents:n.original.amount,formattedSumDollars:Bo($h(n.original.amount)),rows:[n]})}}return t}(e).values())}(e),[e]);return S(N,{children:t.map(e=>R(I,{children:[S(ow,{formattedDate:e.formattedDate,formattedSum:e.formattedSumDollars}),e.rows.map(e=>S(Xf,{rowData:e},e.id))]},e.date))})}function iw({table:e}){const t=jf();return S(El,{children:t?S(aw,{rows:e.getRowModel().rows}):e.getRowModel().rows.map(e=>S(Xf,{rowData:e},e.id))})}function lw({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const o=jf(),a=function({transactions:e,columns:t}){const n=jf(),r=_f({transactions:e,columns:t?[Vt.SELECT,...t,Vt.EXPAND]:void 0});return function(e,t,n=!0){const r=n&&!Zn(t.getColumn(Ut.SELECT)),o=g(r?e:null);if(r){if(o.current!==e&&void 0!==o.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}o.current=e}}(e,r,!n),r}({transactions:e,columns:t});let i;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?i=S(Ok,{}):r&&0===e?.length&&(i=S(ry,{})):i=S(ty,{}),R(ks,{dashboard:"transactionDashboard",children:[Zn(i)&&!o&&S(nw,{table:a}),!a.getIsAllRowsSelected()&&!a.getIsSomeRowsSelected()&&S(Cl,{headerGroups:a.getHeaderGroups()}),Zn(i)?S(iw,{table:a}):S(Wc,{children:i})]})}const sw=An({display:"flex",padding:"16px 12px",border:"0.75px",borderStyle:"solid",borderRadius:["borderWidths.sm"],borderColor:["border.layout"]}),cw=In(sw,An({padding:"16px 12px",flexDirection:"column",alignItems:"flex-start",gap:"16px",flex:"1 0 0"}));function dw({children:e}){return S("div",{className:cw,children:e})}const uw=Bn(Pn["card-header"],An({display:"flex",alignItems:"center",gap:"10px",alignSelf:"stretch"}));function hw({children:e}){return S("div",{...uw,children:e})}const pw=An({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"12px",alignSelf:"stretch"});function gw({children:e}){return S("div",{className:pw,children:e})}const mw=Nn({base:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}});function vw({children:e,type:t,isSample:n=!1}){const r=Bn(Pn.card,mw({type:t,isSample:n}));return S("div",{...r,children:e})}const bw=Nn({base:{display:"flex",height:"48px",flexDirection:"row",justifyContent:"flex-start",alignItems:"center",borderRadius:"borderWidth.sm",cursor:"pointer",background:"surface.background",gap:"8px",alignSelf:"stretch"},variants:{filterStatus:{inactive:{padding:"8px"},active:{paddingTop:"8px",paddingBottom:"8px",paddingRight:"8px",paddingLeft:"4px",borderLeftWidth:"4px",borderLeftStyle:"solid",borderLeftColor:"brand.action.strong",background:"surface.background.hover"},zeroState:{color:"typography.base.weak",cursor:"default",padding:"8px"}}},defaultVariants:{filterStatus:"inactive"}});function fw({filterApiNames:e,filterModelKey:t,extractFilterValue:n,filterStatus:r,buttonClassName:o,isZeroState:a,filterEffectiveValueExtractor:i,children:l}){const{addFilters:s,filters:c,getModel:d,removeFilter:u}=tk();if(!d(t))return null;const h="active"===r,p=In(bw({filterStatus:r}),o);return S("div",a?{className:p,children:l}:{className:p,onClick:h?()=>{return t=u,void function(e,t,n){const r=[];return e.forEach((e,o)=>{n(e).some(e=>t.includes(e))&&r.push(o)}),r.reverse()}(c,e,i).forEach(e=>{t(e)});var t}:()=>((e,t,n,r,o)=>{const a=e(t);if(!a||!a.possibleValues)return;const i=[];a.possibleValues().values.forEach(e=>{const t=n(e.value);if(t&&t.some(e=>r.includes(e))){const t=a.createFilter(e);i.push(t)}}),o(i)})(d,t,n,e,s),children:l})}const yw=e=>["banks/transactions/summary",e],xw=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query/summary",bodyParams:t[1],accessToken:t[2].accessToken,endpointManager:Ua(t[2].environment)},r=await eo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};const Tw=An({width:"200px",minWidth:"200px"}),kw=Nn({base:{display:"flex",padding:"10px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"borderWidths.sm",borderWidth:"1px",borderStyle:"solid"},variants:{reviewStatus:{PARTNER_REVIEW_REQUIRED_RECONCILIATION_STAGED:{borderColor:"border.layout",background:"surface.background"},USER_REVIEW_REQUIRED:{borderColor:"surface.intent.warning.active",background:"surface.intent.warning"},RECONCILIATION_DISCREPANCY:{borderColor:"surface.intent.danger.weak",background:"surface.intent.danger.opaque"},RECONCILED:{borderColor:"surface.intent.success.active",background:"surface.intent.success"},zeroState:{borderColor:"border.layout",background:"surface.background"}}},defaultVariants:{reviewStatus:"PARTNER_REVIEW_REQUIRED_RECONCILIATION_STAGED"}}),ww=Bn(null,An({marginLeft:"auto"}));function Cw({labeledReviewStatus:e,isZeroState:t}){const{apiFilters:{reviewStatus:n}}=tk(),{data:r}=function(e){const{query:{data:t},isFilling:n,isRehydrating:r}=function({groupBy:e,filter:t}){return ir({queryKey:yw({groupBy:e,filter:t}),queryFn:xw})}({groupBy:"REVIEW_STATUS",filter:e});return{data:t?.data??void 0,isFilling:n,isRehydrating:r}}();let o=e.value.some(e=>{return t=n,!(!(r=e)||!cf(r))&&(t?.in?.includes(r)??!1);var t,r})?"active":"inactive";t&&(o="zeroState");const a="active"===o,i=e.value.join("_");if(e.value.includes("ACCOUNTANT_REVIEW_REQUIRED"))return null;const l=Bn(Pn["card-button-icon"],kw({reviewStatus:t?"zeroState":(s=i,kw.variantMap.reviewStatus.includes(s)?i:void 0)}));var s;const c=String(((e,t)=>{let n=0;return e?.forEach(e=>{e.value&&cf(e.value)&&t.value.includes(e.value)&&(n+=e.count??0)})??n})(r,e));return R(fw,{filterApiNames:e.value,filterModelKey:"reviewStatus",extractFilterValue:e=>e.reviewStatus?.value.in,filterStatus:o,buttonClassName:Tw,isZeroState:t,filterEffectiveValueExtractor:pT,children:[S("div",{...l,children:S(Yi,{Component:e.icon})}),!t&&a&&R(N,{children:[S(Vo,{children:e.name}),S(Vo,{stylists:[ww],children:c})]}),!t&&!a&&R(N,{children:[S(Ss,{children:e.name}),S(Ss,{extraClassNames:[An.raw({marginLeft:"auto"})],children:c})]}),t&&R(N,{children:[S(Ss,{intent:"weak",children:e.name}),S(Ss,{intent:"weak",extraClassNames:[An.raw({marginLeft:"auto"})],children:c})]})]},e.name)}function Aw({isZeroState:e}){return S(vw,{children:R(dw,{children:[S(hw,{children:S(Ss,{intent:"weak",children:"Review Status"})}),S(gw,{children:lf.map((t,n)=>S(Cw,{labeledReviewStatus:t,isZeroState:e},n))})]})})}const Ew=An({display:"none",xl:{display:"flex",height:"318px",maxHeight:"318px",alignItems:"flex-start",gap:"16px",alignSelf:"stretch",borderRadius:"borderWidths.sm"}});function Iw(e){return S("div",{className:Ew,children:e.children})}const Sw=Bn(null,An({display:"flex",flexDirection:"column",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"12px",gap:"8px",minWidth:"180px"})),Nw=Bn(null,An({width:"100%",height:"1px",backgroundColor:"border.layout"})),Rw=Bn(null,An({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"20px"})),Pw=_o.var("colors.money.positive"),Dw=_o.var("colors.money.negative");function Lw({active:e,payload:t}){if(!e||!t||0===t.length)return null;const n=t.find(e=>"income"===e.dataKey),r=t.find(e=>"expense"===e.dataKey),o=t[0]?.payload?.longLabel||"",a=n?.value??0,i=r?.value??0;return R("div",{...Sw,children:[S(Vo,{children:o}),S("div",{...Nw}),R("div",{...Rw,children:[S(Xo,{color:Pw,label:"Income",diameter:12}),S(Ho,{children:Fo(Number(a))})]}),R("div",{...Rw,children:[S(Xo,{color:Dw,label:"Expense",diameter:12}),S(Ho,{children:Fo(Number(i))})]})]})}const Mw={top:20,right:20,left:20,bottom:5},Ow=Bn(Pn["profit-loss-graph"],An({"& .recharts-surface":{outline:"none"}})),Fw=_o.var("colors.border.layout"),Bw={fill:_o.var("colors.typography.base"),fontSize:_o.var("fontSizes.metric.sm")},Uw=_o.var("colors.money.positive.weak"),Vw=_o.var("colors.money.negative.weak"),Ww=_o.var("colors.money.positive"),Hw=_o.var("colors.money.negative");function qw({data:e}){return S(V,{width:"100%",height:"100%",...Ow,style:{flexGrow:1},children:R(W,{data:e,accessibilityLayer:!0,barCategoryGap:"20%",margin:Mw,children:[S(j,{dataKey:"label",interval:0,tickLine:!1,stroke:Fw,tick:Bw}),S(_,{content:({active:e,payload:t})=>S(Lw,{active:e,payload:t}),isAnimationActive:!1,cursor:{fill:"transparent"}}),S(K,{name:"Income",dataKey:"income",minPointSize:2,fill:Uw,isAnimationActive:!1,activeBar:{fill:Ww}}),S(K,{name:"Expense",dataKey:"expense",minPointSize:2,fill:Vw,isAnimationActive:!1,activeBar:{fill:Hw}})]})})}const jw=An({display:"flex",flexDirection:"row",gap:"8px",justifyContent:"flex-end"}),zw=_o.var("colors.money.positive.weak"),_w=_o.var("colors.money.negative.weak");function Kw(){return R("div",{className:jw,children:[S(Xo,{color:zw,label:"Income",diameter:10}),S(Xo,{color:_w,label:"Expense",diameter:10})]})}const Yw=Nn({base:{display:"flex",flexDirection:"row","& > * + *":{marginLeft:"-1px"}},variants:{width:{full:{width:"100%"}}}});function Zw({width:e,children:t}){return S("div",{className:Yw({width:e}),children:t})}function Xw({options:e,handleClick:t,selected:n}){return S(Zw,{width:"full",children:e.map(e=>S(yg,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground",corners:"rounded"},e.value))})}const Qw=Bn(null,An({display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"20px"})),Gw=Bn(null,An({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px"})),Jw=Bn(null,An({flexDirection:"column",alignItems:"flex-end",gap:"10px",width:"300px",display:"flex"})),$w=Bn(Pn.card,In(sw,An({flexGrow:1,flexShrink:0,minHeight:"100%",flexDirection:"column"}))),eC=e=>"QUARTERLY"===e?function(){const e=/* @__PURE__ */new Date,t=tt(e);return{beginDate:et(Ze(e.getFullYear(),e.getMonth()-9,e.getDate())),endDate:t}}():"YEARLY"===e?{beginDate:Ye(Ze(/* @__PURE__ */(new Date).getFullYear()-4,0,1)),endDate:Qe()}:"LAST_12_MONTHS";const tC=[{label:"Months",value:"MONTHLY"},{label:"Quarters",value:"QUARTERLY"},{label:"Years",value:"YEARLY"}];function nC(){const[e,t]=y({label:"Months",value:"MONTHLY"}),n=function(e){const{query:{data:t}}=co({accountingMethod:"CASH",filter:eC(e),grouping:e,select:t=>{if("SUCCESS"!==t.result)return[];const n=t.json?.data;if(void 0===n)return[];let r=n;return"YEARLY"===e&&(r=function(e){let t=!1;const n=[],r=e.length-1,o=e.length-2;return e.forEach((e,a)=>{((e?.income?.total??0)>0||(e?.expenses?.total??0)>0)&&(t=!0),(t||a===r||a===o)&&n.push(e)}),n}(n)),r.map(t=>{const n=t.period?.beginDate,{label:r,longLabel:o}=function(e,t){return void 0===e?{label:"",longLabel:""}:"MONTHLY"===t?function(e){const t=yt(e??"");return{longLabel:t?wt(t,{abbreviateMonth:!1,abbreviateYear:!1}):"",label:ho(e)}}(e):"QUARTERLY"===t?function(e){const t=Xe(e),n=t.getMonth(),r=Math.trunc(n/3)+1,o=t.getFullYear();return{label:`Q${r} ${"'"+o%100}`,longLabel:`Quarter ${r} ${o}`}}(e):"YEARLY"===t?function(e){const t=Xe(e).getFullYear();return{label:t.toString(),longLabel:t.toString()}}(e):{label:"",longLabel:""}}(n,e);return{longLabel:o,income:(t.income?.total??0)+(t.otherIncome?.total??0),expense:(t.cogs?.total??0)+(t.expenses?.total??0)+(t.otherExpenses?.total??0),label:r}})}});return t??[]}(e.value),r=n.reduce((e,t)=>e+t.income-t.expense,0);return R("div",{...$w,children:[R("div",{...Qw,children:[R("div",{...Gw,children:["All Transactions",S(No,{title:Fo(r),label:void 0})]}),R("div",{...Jw,children:[S(Xw,{options:tC,handleClick:e=>t(e),selected:e}),S(Kw,{})]})]}),S(qw,{data:n})]})}function rC(){const e=jf(),{taskBanners:t,isFilling:n}=function(e){const{isMobile:t=!1}=e??{},n=(()=>{const e={filter:{status:{in:["ACTIVE"]}}};return ir({select:e=>Fi(e,!0),queryKey:e?Pi(e):["tasks",{}],queryFn:Mi})})(),r=Oi({select:e=>Fi(e,t)},Li),{query:{data:o},isFilling:a}=t?n:r,{query:{data:i},isFilling:l}=Ei(),{query:{data:s},isFilling:c}=ei();return{taskBanners:m(()=>{let e=[];const t=s?.data;t&&(e=t.map(e=>za(e)));let n=[];!1===i?.hasPlaidLinkedBankAccount&&(n=[ja]);const r=o??[];return[...e,...n,...r]},[o,i,s]),isFilling:a||l||c}}({isMobile:e}),{apiFilters:r}=tk(),o={filter:{...r}},{query:{data:a}}=jl(o),i=a?.data,l=(i?.length??0)>0,{query:{data:s}}=Ei();return R(N,{children:[R(Vn,{children:[S(_n,{children:"Action Items"}),S(Uy,{})]}),S(Ra,{children:S(Oy,{taskBanners:t,handleScrollAction:Bi,isWaitingForPlaidItemAccountsSync:!l&&!0===s?.plaidItemAccountsReadyToSync,isFilling:n})})]})}const oC=An({width:"270px",minWidth:"269px"}),aC=Bn(null,An({display:"flex",width:"20px",height:"20px",justifyContent:"center",alignItems:"center"})),iC=Bn(null,An({marginLeft:"auto"}));function lC({account:e,isZeroState:t}){const{apiFilters:n}=tk(),r=(i=n,l=e.id,i.bankAccount?.id?.in?.includes(l)?"active":"inactive"),o="active"===r,a=Oo(null!=e.accountBalance?$h(e.accountBalance):0,{dollarSign:!0});var i,l;return R(fw,{filterApiNames:[e.id],filterModelKey:"bankAccount",extractFilterValue:e=>e.bankAccount?.value.id?.in,filterStatus:r,buttonClassName:oC,isZeroState:t,filterEffectiveValueExtractor:DT,children:[e.iconUrl?S("img",{src:e.iconUrl,alt:"",className:aC.className}):S(Ig,{size:20,stylists:[aC]}),!t&&o&&R(N,{children:[S(Vo,{children:e.name}),S(Vo,{wrap:"wrap",children:`*${e.mask}`}),S(Vo,{wrap:"wrap",stylists:[iC],children:a})]}),!t&&!o&&R(N,{children:[S(Ss,{children:e.name}),S(Ss,{wrap:"wrap",children:`*${e.mask}`}),S(Ss,{wrap:"wrap",extraClassNames:[An.raw({marginLeft:"auto"})],children:a})]}),t&&R(N,{children:[S(Ss,{intent:"weak",children:e.name}),S(Ss,{intent:"weak",wrap:"wrap",children:`*${e.mask}`}),S(Ss,{intent:"weak",wrap:"wrap",extraClassNames:[An.raw({marginLeft:"auto"})],children:a})]})]},e.id)}const sC=[{name:"Expenses Card",mask:"0000",accountBalance:1e6},{name:"Travel Card",mask:"0001",accountBalance:5e5},{name:"Primary Checking",mask:"0002",accountBalance:15e5},{name:"Emergency Savings",mask:"0003",accountBalance:15e5}];function cC({isZeroState:e}){const{query:{data:t}}=ai(),n=(r=t?.data??[],e?sC:r.filter(e=>"ACTIVE"===e.status).sort((e,t)=>{const n=e.latestTransactionDate??"",r=t.latestTransactionDate??"";if(n!==r)return r.localeCompare(n);const o=e.accountBalance??0;return(t.accountBalance??0)-o}).slice(0,4));var r;return S(vw,{children:R(dw,{children:[S(hw,{children:S(Ss,{intent:"weak",children:"Account Balances"})}),S(gw,{children:n.map((t,n)=>S(lC,{account:t,isZeroState:e},n))})]})})}const dC=An({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1440px"}),uC=An({display:"flex",justifyContent:"center"}),hC=An({border:"{borderWidths.md} solid {colors.border.layout}",borderBottom:"none",paddingTop:"8px",marginTop:"16px"}),pC=An({border:"{borderWidths.md} solid {colors.border.layout}",borderTop:{xl:"{borderWidths.md} solid {colors.border.layout}",base:"none"}}),gC=An({display:"flex",flexDirection:"column",gap:"10px"});function mC({limit:e=100,columns:t=Pk}){const{userRole:n}=b(mc),{sortInstance:r,setSortInstance:o,apiSort:a}=Ov(),{filters:i,removeFilter:l,apiFilters:s,getModel:c}=tk(),d={limit:e,sort:a,filter:{...s}},{isFilling:u,paginationControls:h,query:{data:p,isError:g,error:m,isFetching:v}}=jl(d),f=p?.data,y=function(){const{query:{data:e,isFetching:t}}=jl({}),n=e?.data;return t?void 0:n&&n.length>0}();!function(e,t,n,r=!1){const o=Bt(e=>e.initializeDefaultFilters),a=Bt(e=>e.hasInitializedTransactionFilters);T(()=>{!a&&!n&&e&&r&&o({userRole:e,hasNonReconciledTransactions:t})},[a,n,e,t,o,r])}(n,f?.some(e=>"RECONCILED"!==e.reviewStatus)??!1,u,y);const{hasPlaidLinkedBankAccount:x}=Ai(),k=x??!1,w=jf();if(g)return S("div",{children:`Error: ${m?.message}`});if(u)return S(ol,{});if(void 0!==f){const e=function(e,t){let n;return n=0===e?"FILTERS_NOT_APPLIED":e>0&&0===t?"FILTERS_MATCHED_NONE":"FILTERS_MATCHED_ANY",n}(1===i.length&&Xn(i[0].value?.date)?0:i.length,f.length);return S("div",{className:uC,children:S("div",{className:dC,children:R(Ki.Provider,{value:h,children:[w&&S("div",{className:gC,children:S(rC,{})}),!w&&R(Iw,{children:[S(Aw,{isZeroState:!y}),S(cC,{isZeroState:!y}),S(nC,{})]}),S("div",{className:hC,children:S(Rk,{filters:i,removeFilter:l,getModel:c,isFetching:v})}),S("div",{className:pC,children:S(ws.Provider,{value:{sortInstance:r,setSortInstance:o},children:S(lw,{hasLinkedBankAccount:k,filterState:e,transactions:f,columns:t})})}),S(Lk,{})]})})})}return"zero state"}const vC=e=>S(Ky,{children:S(mC,{...e})}),bC=An({display:"flex",flexDirection:"column"});function fC({task:e}){return S("div",{className:bC,children:S(Sy,{task:e})})}const yC=An({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),xC=An({width:"80px",height:"12px"}),TC=An({width:"150px",height:"16px"}),kC=An({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),wC=An({userSelect:"none",cursor:"pointer"});function CC(){return R("div",{className:kC,children:[R("div",{className:wC,children:[R("div",{className:yC,children:[S(pa,{styles:TC}),S(pa,{styles:xC})]}),R("div",{className:yC,children:[S(pa,{styles:TC}),S(pa,{styles:xC})]})]}),S("div",{className:wC,children:R("div",{className:yC,children:[S(pa,{styles:TC}),S(pa,{styles:xC})]})})]})}const AC=An.raw({"&::before":{content:{base:"''",sm:"none"},position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}});function EC({children:e,stylists:t,shouldUseButtonDiscreteStyles:n=!1}){const r=jf(),o=n||r?sc:vs;return R(js,{placement:"bottom-start",children:[S(_s,{children:e=>S(o,{extraClassNames:[AC],popupTriggerProps:e,children:S(Yi,{Component:Mx,stylists:t})})}),S(tc,{children:e})]})}const IC=Wi(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),p.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),p.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),p.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),p.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),p.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),p.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),SC=An({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),NC=Bn(null,SC);function RC({children:e,clickHandler:t}){const n=zs();return t||(t=()=>{n.close()}),S(me,{lockScroll:!0,...NC,onClick:t,children:e})}const PC=Nn({base:{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"16px",position:"relative"},variants:{width:{lg:{minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"}},sm:{minWidth:{sm:"360px",base:"100dvw"},maxWidth:{sm:"392px",base:"100dvw"}}}}});function DC({width:e="lg",children:t}){const n=Bn(Pn["modal-popup"],PC({width:e}));return S("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}const LC=An({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),MC=An({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),OC=An({display:"flex",flexDirection:"column",gap:"12px"}),FC=An({display:"flex",flexDirection:"row",gap:"10px"}),BC=An({display:"flex",flexDirection:"column",gap:"10px"}),UC=({acknowledged:e,setAcknowledged:t})=>R("div",{className:OC,children:[S(Ss,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),R("div",{className:FC,children:[S(Vv,{checked:e,onClick:()=>t(!e)}),S(Ss,{wrap:"wrap",children:"I understand."})]})]});function VC({bankAccounts:e}){const{apiPartnerName:t}=b(mc),n=e.reduce((e,t)=>{const n=yt(t.tranStartDate||""),r=yt(e.tranStartDate||"");return n&&r&&mt(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=Nu();return hm({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,o;gu({title:"Start Date Updated",body:R("div",{className:BC,children:[S(Ss,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),S(Ss,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:iu,type:hu}]}),n((r=e,o=t.value.tranStartDate,r.map(e=>({id:hi(e.id),tranStartDate:o,duplicateBankAccountIds:[]}))))}})})(e,n),o=zs(),a=()=>{o.close()},[i,l]=y(!1),{query:{data:s}}=$a(),c=s?.data?.find(t=>t.id===(e[0]?.integration?.id??""))?.apiInstitutionName||"bank",d=yt(e.reduce((e,t)=>{const n=yt(t.tranMinStartDate||""),r=yt(e.tranMinStartDate||"");return n&&r&&mt(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${si(e[0]?.name,e[0]?.mask)} account dating back to ${At(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${At(d)}.`;return R("form",{className:LC,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),o.close()},children:[S(Vo,{children:"Set Bank Transaction Start Date"}),S(Ss,{wrap:"wrap",children:u}),S(Ss,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),S(r.AppField,{name:"tranStartDate",children:e=>S(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),S(r.Subscribe,{selector:e=>e,children:e=>{const t=yt(e.values.tranStartDate||""),r=yt(n),o=t&&r&&mt(t,r);return R(N,{children:[e.isDirty&&o&&S(UC,{acknowledged:i,setAcknowledged:l}),R("div",{className:MC,children:[S(mm,{showIcon:!1,onClick:a}),S(Uu,{showIcon:!1,textContent:"Confirm",disabled:!!o&&!i})]})]})}})]})}function WC({bankAccounts:e}){return R(js,{placement:"right-start",modal:!0,children:[S(_s,{children:e=>R(bp,{...e,children:[S(Yd,{Component:IC}),S(Vo,{children:"Edit Start Date"})]})}),S(ax,{children:S(RC,{children:S(DC,{width:"sm",children:S(VC,{bankAccounts:e})})})})]})}const HC=Wi(e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},p.createElement("path",{d:"M7.49998 14.4245C11.3242 14.4245 14.4244 11.3244 14.4244 7.50011C14.4244 3.67585 11.3242 0.575684 7.49998 0.575684C3.67573 0.575684 0.575562 3.67585 0.575562 7.50011C0.575562 11.3244 3.67573 14.4245 7.49998 14.4245Z",strokeMiterlimit:10}),p.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),qC=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),p.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),p.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),jC={QBO:"QuickBooks Online",XERO:"Xero",STRIPE:"Stripe",SHOPIFY:"Shopify",SQUARE:"Square",RUTTER:"Rutter",UBER:"Uber",MOOV:"Moov",QUALPAY:"Qualpay",BENCH:"Bench",WAVE:"Wave",MANUAL_ENTRY:"Manual Entry",CSV_IMPORT:"CSV Import",PARTNER_IMPLEMENTATION:"Partner Implementation",FRESHBOOKS:"FreshBooks",FRESHBOOKS2:"FreshBooks"};function zC(e){const{apiPartnerName:t,unitIntegrationBankName:n}=b(mc);return"UNIT"===e?n??t??"Unit":jC[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const _C=An({display:"flex",flexDirection:"column",gap:"16px"}),KC=Bn(null,An({color:"brand.danger"}));function YC({integration:e,accounts:t}){const{mutate:n}=Qm(),r=zs(),{linkPlaid:o,loading:a,hasOnPlaidLinkOverride:i}=$m(),{query:{data:l}}=(s=e.id,Ja({},{select:e=>{return{...e,data:(t=e.data,n=s,t?.find(e=>e.id===n))};var t,n}}));var s;const c=l?.data,{query:{data:d}}=Ni(e.id),u=d?.data,h=zC(e.apiName),p="PLAID"===e.apiName;return R(dp,{children:[p&&!a&&R(bp,{onClick:()=>(o({plaidEvent:Um,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r.close()),children:[S(Yd,{Component:rs}),S(Vo,{children:"Add Account"})]}),p&&u&&S(WC,{bankAccounts:u}),je(t)&&R(bp,{onClick:()=>Nm({plaidItemAccounts:t}),children:[S(Yd,{Component:qC}),S(Vo,{children:"Merge Accounts"})]}),p&&R(bp,{onClick:()=>(async()=>{let a;var l;a=je(t)?await(async e=>gu({title:"Remove Institution",body:S("div",{className:_C,children:S(Ss,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:ou,label:"Cancel"},{key:au,label:"Remove",type:pu}]}))(e.apiInstitutionName??h):await(async e=>gu({title:"Remove Institution",body:S("div",{className:_C,children:S(Ss,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:ou,label:"Cancel"},{key:au,label:"Remove",type:pu}]}))(h),r.close(),a===au&&(p&&i?o({plaidEvent:Vm,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(l=e.id,n({id:l,removeFromApi:p})))})(),children:[S(Yd,{stylists:[KC],Component:HC}),S(Vo,{stylists:[KC],children:"Delete Connection"})]})]})}const ZC=An({userSelect:"none"});function XC({children:e}){return S("div",{className:ZC,children:e})}const QC=An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"16px 12px 16px 16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"});function GC({children:e}){return S("div",{className:QC,children:e})}const JC=Bn(Pn.badge,vb),$C=Bn(null,wo),eA=Bn(null,zi),tA=Bn(Pn["neutral-badge"],fb),nA=Bn(Pn["highlight-badge"],xb),rA=Bn(Pn["success-badge"],kb),oA=Bn(Pn["warning-badge"],Cb),aA=Bn(Pn["critical-badge"],Eb);function iA({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:o}){let a;switch(e){case"critical":a=aA;break;case"warning":a=oA;break;case"neutral":a=tA;break;case"success":a=rA;break;case"highlight":a=nA}const i=qn([JC,$C,a,eA]);return S("button",{...i,onClick:n,disabled:r,...o,children:t})}function lA({plaidItem:e}){const t=Ey(e);return R(iA,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(jr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),Iy(t))},disabled:Zn(t),children:[S(Yd,{Component:_u}),S(Ho,{children:"Fix Bank Error"}),S(Yi,{Component:qi})]})}const sA=Nn({base:{padding:"16px 16px 16px 24px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discreet.hover",cursor:"pointer"}}}}}),cA=An({display:"flex",flexDirection:"row",alignItems:"center",gap:"14px",overflow:"hidden"});function dA({bankAccountId:e,name:t,mask:n,syncText:r,active:o,integration:a}){const i="PLAID"===a?.apiName,l=In(sA({active:o}),zi);return R("button",{className:l,onClick:t=>{t.stopPropagation(),Ml("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!o,children:[R("div",{className:cA,children:[S(Yd,{Component:i?Xv:Ig}),S(Ng,{accountName:t,accountNo:n,syncText:r,active:o})]}),o&&S(Yd,{Component:qi})]})}const uA=An({display:"flex",flexDirection:"column",gap:"4px"}),hA=An({display:"flex",alignItems:"center",gap:"8px"}),pA=Bn(null,An({color:"brand.primary.weak"})),gA=An({overflow:"hidden"});function mA({integration:e,isCompact:t=!1}){const{query:{data:n}}=Ni(e.id),r=n?.data,o="PLAID"===e.apiName,a=Pg(o?e.apiInstitutionId??void 0:void 0),i=zC(e.apiName);return je(r)?R(XC,{children:[R(GC,{children:[R(lx,{children:[S("img",{src:a,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}),R("div",{className:uA,children:[S(Ss,{children:e.apiInstitutionName??i}),S(Ho,{children:Om(r)})]})]}),R("div",{className:hA,children:[o&&Xn(e.apiErrorCode)&&S(lA,{plaidItem:e}),S(EC,{stylists:[pA],shouldUseButtonDiscreteStyles:t,children:S(YC,{integration:e,accounts:r})})]})]}),S("div",{className:gA,children:r.map(t=>{const n=t.isSupported&&"ACTIVE"===t.status;return S(dA,{bankAccountId:t.id,mask:t.mask,name:t.name,syncText:Fm(t),active:n,integration:e},t.id)})})]}):null}const vA=An({objectFit:"contain"});function bA(e,t,n){const r=({size:n=24})=>{const{icons:r}=b(Ui);return S("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:vA})};return r.displayName=t,r}const fA=bA("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1BYqFVTahLqg0JYSriExARInsXGwncSJPb7N7Uz/v/+3vnX2OR7HpiB1Zc5ea32X/3fZ31577X1O3Ctj7ba3/c3tvcmJ+0u/3LdWyr5SevO9Xs9SdGulV3r9mK9FV+CvVRlNpKK/Oh90xiX1hLa2JiTJpBx9VzaxJRjYFS/lm9uiS8I445gNowkPB4kj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VrT5RaFjD7TRLzDNzwVsppb7pxAmuW3MCLdLZIGOkhU7XRFBCcOII13WPEQpf5XaiJbYjLlwU2gZ2oBN/jfNskDFSQhcaXoz8hD5fuK57qF0nwyhlrocoJk7CUEa13HZbCTnFlWteoY/WImoxQSW3UkEj96e45Khws/SyVU4pgKowpIZ6dqeXChUuq9L6+04pgWqMhIbRdsjEgAUGk6h2zylVCJ39lVD4PvunPGEUGjaEXuYc5fUyW4KNxROXgsfolkruuEYOMuNdJhT+h/vTH1/COqFRcscx0qBTw7ScQfcf8AcsHhTkKwWj6PQ9d/xiA5GpOYlSvf0SgB2Ji0rVp1W42W9zxyu2EJ53phUaflFcCp6nu9u445MYSJ09lzqplnJGEwp20Z2oKYXncMcjsahE/B6tn5XSHE1o3EHrWe01+rQIqkrDw1qpYSm3AAKjwlXCw6F2yYEZUmfPFxrujUsrQtlRtlLwoVAwNu/GUhbhgXoVphV2aV60fZdbLDJvwjvUKTblZS91Xfdgq5mYIN0Nz6DGXtRQIlJXHCholApmC+VdV6mqT+f2k0URUFdXd5C/5KGhD2ULoeBlunsheDHhZqnhH/57auhDoidbbFBLA2W0oJvyvItTGnv4VyAomEgNBppFsYrmRFJhwz5ipJ8VNjT/btXuv4Wn6X+FwhH0WiIDFzXfxJzc4r488H9C0rMPxyn4LQAAAABJRU5ErkJggg==","Bank"),AA={GUSTO:TA,FRESHBOOKS:kA,FRESHBOOKS2:kA,SHOPIFY:xA,STRIPE:fA,SQUARE:yA,UBER:wA};function EA(e){return AA[e]??CA}const IA=An({display:"flex",flexDirection:"column",gap:"4px"});function SA({integration:e,isCompact:t}){const n=zC(e.apiName),r=function(e){if(e)return`Last synced ${Ct(e)}`}(e.lastSyncedDate),o=EA(e.apiName);return S(XC,{children:R(GC,{children:[R(lx,{children:[S(Hc,{Component:o}),R("div",{className:IA,children:[S(Ss,{wrap:"wrap",children:e.apiUsername?`${n} (${e.apiUsername})`:n}),r&&S(Ho,{intent:"normal",children:r})]})]}),S(EC,{shouldUseButtonDiscreteStyles:t,children:S(YC,{integration:e})})]})})}const NA=An({display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:"16px 12px",marginBottom:"8px"}),RA=An.raw({color:"typography.base.weak"}),PA=An({overflow:"hidden"});function DA({manualBankAccounts:e,isCompact:t=!1}){const n=jf(),r=t||n?sc:vs;return R(XC,{children:[R("div",{className:NA,children:[S(Ss,{extraClassNames:[RA],children:"Manually Tracked Accounts"}),S(r,{onClick:()=>Ml("BankAccountForm"),active:!1,children:S(Yi,{Component:rs})})]}),S("div",{className:PA,children:e.map(e=>S(dA,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const LA=Bn(Pn["selector-row"],In(An(ss,{backgroundColor:"surface.foreground",minWidth:"100%",justifyContent:"start",marginBottom:"5px",padding:"16px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"}),ji)),MA=An({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),OA=An({display:"flex",alignItems:"center",gap:"8px"}),FA=An({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",gap:"4px"}),BA=Bn(null,An({width:"20px",height:"20px"}));function UA(){const{linkPlaid:e,loading:t}=ev();return S("button",{...LA,disabled:t,onClick:()=>{jr("Add New Connection button pressed"),e({plaidEvent:Bm,message:"Add New Connection button pressed"})},children:R("div",{className:MA,children:[R("div",{className:OA,children:[S(Hc,{stylists:[BA],Component:Ig}),R("div",{className:FA,children:[S(Ss,{children:"Connect your bank"}),S(Ho,{children:"Find your banking institution with Plaid"})]})]}),S(Yd,{Component:qi})]})})}const VA=An({paddingInline:"16px",paddingBottom:"8px"}),WA=An.raw({color:"typography.base.weak",fontWeight:"label"});function HA({title:e,children:t}){return R("div",{children:[S("div",{className:VA,children:S(Ss,{extraClassNames:[WA],children:e})}),t]})}const qA=An({minWidth:"100%",height:"45px"});function jA(){return R(N,{children:[S(pa,{styles:qA}),S(pa,{styles:qA}),S(pa,{styles:qA})]})}const zA=Bn(Pn["selector-row"],In(An(ss,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),ji)),_A=An({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),KA=An({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),YA=An({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function ZA({integration:e}){const{linkPlaid:t,loading:n}=$m(),r=Pg(e.apiInstitutionId??void 0),o="PLAID"===e.apiName,a=EA(e.apiName),i=zC(e.apiName);return S("button",{...zA,disabled:n||!o,onClick:()=>{jr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:Um,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:R("span",{className:_A,children:[R("div",{className:KA,children:[r?S("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):S(Hc,{Component:a}),S(Ss,{children:e.apiInstitutionName??i??void 0})]}),o&&R("div",{className:YA,children:[S(Yi,{Component:Kd}),S(Ss,{children:"Relink"})]})]})})}const XA=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},p.createElement("g",{fill:"none",fillRule:"nonzero"},p.createElement("path",{fill:"#95BF47",d:"M48.024 12.24a.567.567 0 0 0-.536-.495c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69c-.357-.36-1.073-.27-1.341-.18-.045 0-.716.225-1.878.585-1.118-3.285-3.086-6.255-6.529-6.255h-.313C27.768.585 26.517 0 25.487 0c-8.048 0-11.894 10.125-13.1 15.255-3.13.99-5.367 1.665-5.635 1.755-1.744.54-1.789.585-2.012 2.25C4.56 20.52 0 56.07 0 56.07l35.549 6.705L54.82 58.59c0-.045-6.752-46.035-6.797-46.35zm-14.443-3.6c-.894.27-1.922.585-2.996.945V8.91c0-1.98-.268-3.6-.715-4.905 1.789.27 2.951 2.295 3.711 4.635zm-5.947-4.185c.492 1.26.805 3.015.805 5.445v.36c-1.967.63-4.07 1.26-6.215 1.935 1.207-4.635 3.487-6.885 5.41-7.74zm-2.37-2.295c.358 0 .716.135 1.029.36-2.594 1.215-5.321 4.275-6.484 10.44-1.7.54-3.354 1.035-4.919 1.53 1.342-4.68 4.606-12.33 10.374-12.33z"}),p.createElement("path",{fill:"#5E8E3E",d:"M47.488 11.7c-.224 0-5.008-.36-5.008-.36s-3.31-3.33-3.712-3.69a.716.716 0 0 0-.492-.225l-2.683 55.35 19.273-4.185s-6.752-46.035-6.797-46.35a.776.776 0 0 0-.581-.54z"}),p.createElement("path",{fill:"#FFF",d:"M29.02 22.41l-2.37 7.11S24.55 28.395 22 28.395c-3.756 0-3.935 2.385-3.935 2.97 0 3.24 8.407 4.5 8.407 12.105 0 5.985-3.757 9.855-8.854 9.855-6.126 0-9.211-3.825-9.211-3.825l1.654-5.445s3.22 2.79 5.902 2.79c1.789 0 2.504-1.395 2.504-2.43 0-4.23-6.886-4.41-6.886-11.385 0-5.85 4.159-11.52 12.61-11.52 3.22-.045 4.83.9 4.83.9z"}),p.createElement("path",{fill:"#000",d:"M77.835 35.263c-1.938-1.032-2.93-1.93-2.93-3.141 0-1.526 1.398-2.513 3.56-2.513 2.524 0 4.777 1.032 4.777 1.032L85 25.256S83.378 24 78.6 24c-6.669 0-11.31 3.814-11.31 9.154 0 3.051 2.163 5.34 5.047 7 2.343 1.301 3.154 2.243 3.154 3.634 0 1.436-1.171 2.603-3.334 2.603-3.2 0-6.264-1.66-6.264-1.66L64 50.115S66.794 52 71.526 52c6.85 0 11.807-3.365 11.807-9.423-.045-3.32-2.524-5.61-5.498-7.314zM103.897 24.304c-3.316 0-5.925 1.62-7.914 4.053l-.089-.045L98.768 13h-7.472L84 52h7.473l2.476-13.33c.972-5.044 3.537-8.152 5.925-8.152 1.68 0 2.343 1.171 2.343 2.838 0 1.035-.088 2.341-.31 3.377L99.078 52h7.473l2.919-15.762c.31-1.666.53-3.648.53-4.999.045-4.368-2.166-6.935-6.102-6.935zM127.92 24C118.943 24 113 32.23 113 41.4c0 5.859 3.565 10.6 10.255 10.6C132.058 52 138 43.994 138 34.6c.044-5.456-3.081-10.6-10.08-10.6zm-3.653 22.185c-2.552 0-3.609-2.191-3.609-4.965 0-4.338 2.201-11.405 6.25-11.405 2.641 0 3.521 2.326 3.521 4.562 0 4.652-2.244 11.808-6.162 11.808zM157.168 24c-5.102 0-8.01 4.489-8.01 4.489h-.09l.447-4.045h-6.713c-.313 2.712-.94 6.89-1.521 10L136 62h7.563l2.104-11.156h.179s1.566.978 4.43.978c8.906 0 14.724-9.066 14.724-18.222 0-5.067-2.282-9.6-7.832-9.6zm-7.25 22.133c-1.969 0-3.133-1.11-3.133-1.11L148.04 38c.895-4.711 3.356-7.822 5.996-7.822 2.328 0 3.044 2.133 3.044 4.133 0 4.889-2.91 11.822-7.16 11.822zM176.287 14A4.25 4.25 0 0 0 172 18.284c0 2.186 1.414 3.716 3.536 3.716h.088c2.343 0 4.332-1.574 4.376-4.284 0-2.186-1.459-3.716-3.713-3.716zM166 52h7.736L179 25h-7.782zM198.487 25.574h-5.453l.277-1.276c.462-2.642 2.034-4.965 4.668-4.965 1.387 0 2.496.41 2.496.41l1.525-6.06S200.66 13 197.748 13c-2.773 0-5.546.774-7.672 2.551-2.681 2.233-3.929 5.467-4.53 8.747l-.23 1.276h-3.652l-1.156 5.831h3.652L180 53h7.81l4.16-21.595h5.408l1.11-5.831z"}),p.createElement("path",{fill:"#000",d:"M216.005 25s-4.788 11.928-6.912 18.45h-.09c-.135-2.1-1.897-18.45-1.897-18.45h-8.04l4.607 24.615c.09.536.045.894-.18 1.251-.904 1.698-2.395 3.35-4.157 4.557-1.445 1.027-3.071 1.697-4.336 2.144L197.123 64c1.536-.313 4.788-1.608 7.498-4.11 3.479-3.216 6.731-8.22 10.029-15.01L224 25h-7.995z"}))),QA=Bn(Pn["selector-row"],In(An(ss,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),ji)),GA=An({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),JA=An({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),$A=An({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),eE=An({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",outline:"none",backgroundColor:"surface.foreground",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",padding:"12px 16px",borderRadius:"md",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"}}),tE=An({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function nE(){const e=zs(),{mutateAsync:t}=Km(),[n,r]=y("");return R("div",{className:JA,children:[S(Vo,{children:"Enter your shop name"}),S("div",{className:tE,children:S(XA,{})}),S(Ss,{children:"Please enter the name of your shop below."}),S("input",{className:eE,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),R("div",{className:$A,children:[S(mm,{showIcon:!1,onClick:()=>{e.close()}}),S(ru,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.close()},children:S(Vo,{children:"Connect"})})]})]})}function rE(){const e=EA("SHOPIFY")??Kd;return R(js,{placement:"bottom",modal:!0,children:[S(_s,{children:t=>R("button",{...QA,...t,children:[R("div",{className:GA,children:[S(Hc,{Component:e}),S(Ss,{children:"Shopify"})]}),S(Yd,{Component:qi})]})}),S(ax,{children:S(RC,{children:S(DC,{width:"sm",children:S(nE,{})})})})]})}const oE=Bn(Pn["selector-row"],In(An(ss,{minWidth:"100%",justifyContent:"space-between",padding:"16px",backgroundColor:"surface.foreground",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",borderTopColor:"transparent",borderLeft:"none",borderRight:"none"}),ji)),aE=An({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function iE({apiName:e}){const{mutateAsync:t}=Km(),n=zC(e);if("SHOPIFY"===e)return S(rE,{});const r=EA(e)??Kd;return R("button",{...oE,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[R("div",{className:aE,children:[S(Hc,{Component:r}),S(Ss,{children:n})]}),S(Yd,{Component:qi})]})}const lE=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function sE(e){return lE.includes(e)}const cE=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],dE=An({display:"flex",flexDirection:"column",paddingTop:"16px",gap:"16px",overflowY:"auto",height:"100%",backgroundColor:"surface.background"}),uE=An({display:"flex",flexDirection:"column",borderTop:"{borderWidths.md} solid {colors.border.layout.weak}"});function hE(){const{query:{data:e},isFilling:t}=ti(),n=e?.multiAccountIntegrations,r=e?.integrations,o=Xn(n)&&n.length>0||Xn(r)&&r.length>0,a=function({connectedIntegrations:e}){const t=b(mc),n=Bt(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(sE),o=e?.map(e=>e.apiName)||[];let a=r??cE;return t&&(a=a.filter(e=>t.supportedIntegrations.includes(e))),a=a.filter(e=>!o.includes(e)),a}({connectedIntegrations:r});return R("div",{className:dE,children:[(t||o)&&S(HA,{title:"Already Connected",children:t?S(jA,{}):R(N,{children:[n?.map(e=>S(ZA,{integration:e},e.id)),r?.map(e=>S(ZA,{integration:e},e.id))]})}),S(HA,{title:"Available Banks",children:S(UA,{})}),a&&a.length>0&&S(HA,{title:"Integrations",children:S("div",{className:uE,children:a.map(e=>S(iE,{apiName:e},e))})})]})}const pE=An({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}),gE=An({marginTop:"16px"}),mE=An.raw({color:"typography.base.weak",fontWeight:"label",paddingInline:"16px",marginBottom:"8px"});function vE({isCompact:e,showPlaidItems:t,showNewConnectionContent:n,multiAccountIntegrations:r,integrations:o,manualBankAccounts:a}){return n?S(hE,{}):t?R(N,{children:[R("div",{className:gE,children:[S(Ss,{extraClassNames:[mE],children:"Connected Accounts"}),r?.map(t=>S(mA,{integration:t,isCompact:e},t.id)),o?.map(t=>S(SA,{integration:t,isCompact:e},t.id))]}),a&&a.length>0&&S(DA,{manualBankAccounts:a,isCompact:e})]}):a&&a.length>0?S(DA,{manualBankAccounts:a}):R("div",{className:pE,children:[S(Hc,{Component:Ig}),S(Vo,{wrap:"wrap",textAlign:"center",children:"If you prefer to manually input your transactions as opposed to having them automatically tracked, you can add your Manually Tracked Bank Account(s) here."})]})}const bE=Bn(null,An({color:"typography.base.weak"})),fE=Bn(Pn["drawer-header"],An({padding:"10px 12px 10px 15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}"},sx)),yE=An({display:"flex",gap:"8px"}),xE=An({display:"flex",flexDirection:"column",gap:"16px",height:"100%"}),TE=Nn({base:{overflowY:"auto",height:{base:"100%",sm:"fit-content"},scrollbar:"hidden"},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),kE=An({padding:"20px 16px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.foreground",width:"100%"}),wE=An({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"16px",margin:"16px"}),CE=Bn(null,An({minWidth:"100%",padding:"16px",border:"1px solid {colors.border.intent.primary}"})),AE=Nn({base:{},variants:{refreshLoading:{true:{animation:"spin 1s linear infinite"},false:{animation:"none"}}}});function EE({inOverlay:e,showCloseButton:t=!1,onPlaidLink:n}){const r=jf()||e;$m();const{query:{data:o},isFilling:a}=ti(),i=o?.multiAccountIntegrations,l=o?.integrations,{query:{data:s}}=ai({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>yi(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:Ii(e?.data)};var t}}),{mutate:c,isPending:d}=Zm(),u=s?s.manualAccounts:null,h=i&&l?i.length+l.length:0,p=i?.find(e=>e.apiErrorCode),g=p&&za(p,!1),m="connected"===Bt(e=>e.banksAndIntegrationsSelectedTab).value,v=0===h&&m,b=m?"Add New Connection":"Add New Account",f=()=>{Ml(m?"NewConnection":"BankAccountForm")},y=r?sc:vs;return R(qm,{onPlaidLink:n,children:[R("div",{...fE,children:[R(lx,{children:[t&&S(px,{}),r?S(Vo,{children:"Banks & Integrations"}):S(_n,{stylists:[bE],children:"Banks & Integrations"})]}),R("div",{className:yE,children:[0!==h&&R(y,{onClick:()=>c(),active:!1,disabled:d,children:[S(Yd,{Component:Kd,stylists:[Bn(null,AE({refreshLoading:d}))]}),!r&&S(Ss,{children:"Sync Accounts"})]}),R(y,{onClick:()=>f(),active:!1,children:[S(Yd,{Component:rs}),!r&&S(Ss,{children:"Add New Connection"})]})]})]}),g&&S("div",{className:wE,children:S(fC,{task:g})}),a?S(CC,{}):R(N,{children:[S("div",{className:TE({height:v?"fill":void 0,background:v?"foreground":void 0}),children:S("div",{className:xE,children:S(vE,{isCompact:r,showPlaidItems:m,showNewConnectionContent:v,multiAccountIntegrations:i,integrations:l,manualBankAccounts:u})})}),r&&!(m&&v)&&S("div",{className:kE,children:R(vs,{stylists:[CE],onClick:()=>f(),disabled:m&&!1,children:[S(Yd,{Component:rs}),S(Vo,{children:b})]})})]})]})}const IE=An({display:"flex",justifyContent:"center"}),SE=An({display:"flex",flexDirection:"column",width:"100%",height:"100%",maxWidth:"1150px",border:"{borderWidths.md} solid {colors.border.layout.weak}",borderRadius:"lg",backgroundColor:"surface.foreground",marginBottom:"42px"});function NE({onPlaidLink:e}){return S(Ky,{children:S("div",{className:IE,children:S("div",{className:SE,children:S(EE,{showCloseButton:!1,onPlaidLink:e,inOverlay:!1})})})})}const RE=Ie("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),PE={queryClient:rr,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await RE).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await RE).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await RE).delete("queryClient",e)}(e)}}}(),maxAge:nr,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function DE({children:e}){return S(Se,{client:rr,persistOptions:PE,children:e})}const LE=An({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100%",height:"100%",minWidth:"100%",minHeight:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden",overscrollBehavior:{base:"contain",xl:"none"}}),ME=An({position:"fixed",inset:0,overflow:"hidden",boxSizing:"border-box",maxWidth:"100dvw",backgroundColor:{base:"transparent",xl:"overlay"},overscrollBehavior:{base:"contain",xl:"none"}}),OE=Bn(null,Pn.component,LE);function FE({children:e}){const t=g(null),n=g(null),r=jf();return E(()=>{const e=document.documentElement,t=e.style.overflow;return r&&(e.style.overflow="hidden"),()=>{e.style.overflow=t}},[r]),S(ve,{children:S(me,{lockScroll:!0,className:ME,children:S("div",{onMouseDown:e=>{n.current=e.target},onClick:e=>{const r=n.current===t.current,o=e.target===t.current;r&&o&&(n.current=null,Bt.getState().requestCloseAllDrawers())},ref:t,"data-testid":"drawerContainer",...OE,children:e})})})}const BE=v({closingQueue:[],drawerHistory:[]});function UE({children:e}){const t=Bt(e=>e.drawerHistory),n=Bt(e=>e.closingQueue),r=m(()=>({drawerHistory:t,closingQueue:n}),[t,n]),o=t.length>0||n.length>0;return S(BE.Provider,{value:r,children:o&&S(FE,{children:e})})}const VE=v({isActive:!0,isClosing:!1});function WE({Component:e,name:t}){const{drawerHistory:n,closingQueue:r}=b(BE),o=n.at(-1);if(void 0===o&&0===r.length)return null;const a=n.find(e=>void 0!==e[t]),i=r.find(e=>void 0!==e[t]),l=void 0!==o?.[t],s=void 0!==i,c=(a&&a[t])??(i&&i[t]);return S(VE.Provider,{value:{isActive:l,isClosing:s},children:c&&S(e,{...c.routeProps})})}const HE=An({position:"absolute",display:"flex",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},overscrollBehavior:{base:"contain",xl:"none"},_focus:{outline:"none"}}),qE=An({position:"absolute",right:0,top:0,width:1,minWidth:"100%",height:1,minHeight:"100%"});function jE({children:e}){const t=g(null),{isActive:n,isClosing:r}=b(VE),{onExitAnimationEnd:o,onInitialAnimationComplete:a}=function({isActive:e,isClosing:t,focusRef:n}){const[r,o]=y(!0),a=x(()=>{Bt.getState().confirmCloseDrawer()},[]),i=x(()=>{o(!1)},[o]);return T(()=>{r||!e||t||n.current?.focus()},[e,t,n,r]),{onExitAnimationEnd:a,onInitialAnimationComplete:i}}({isActive:n,isClosing:r,focusRef:t});return S(Ae,{onExitComplete:o,children:!r&&S(N,{children:R(Ee.div,{tabIndex:-1,ref:t,onAnimationComplete:()=>a(),transition:gx,initial:mx,animate:vx,exit:bx,className:HE,children:[e,!n&&S("div",{className:qE})]})})})}const zE=Nn({base:{display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"},variants:{background:{foreground:{backgroundColor:"surface.foreground"}}}});function _E({background:e,children:t}){return S("div",{className:zE({background:e}),children:t})}const KE=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function YE(e){return void 0!==KE[e]}function ZE(e){return KE[e]}const XE=Wi(e=>p.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,...e},p.createElement("defs",null,p.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),p.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"}),p.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),QE=An({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function GE({cldrShortName:e}){return S("div",{className:QE,children:ZE(e)})}const JE=Nn({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),$E=An({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"});function eI({reactions:e,type:t,handleClick:n}){return S("div",{className:$E,children:e.map((e,r)=>S("button",{className:JE({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:S(GE,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const tI=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:o},accessToken:t,endpointManager:Ua(n)};return await eo(a)},nI=async({data:e,accessToken:t,environment:n})=>{const{id:r,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:r,emojiCode:o},accessToken:t,endpointManager:Ua(n)};return await async function(e){return zm(e)}(a)};function rI(e,t,n){return Kn(Yl({id:e}),t,n)}async function oI(e){const t=Yl({id:e});return jr("mutation successful, invalidating messages queries"),rr.invalidateQueries({queryKey:t}).catch(e=>zr({error:e,severity:"error"}))}function aI(e,t,n){const r=[...e];return r[n]=t,r}const iI=An({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),lI=Object.keys(KE).filter(YE).map(e=>({emojiCode:e,authorInfo:[]}));function sI({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:o,setReactionIsOpen:a}){const{userId:i}=b(mc),{mutate:l}=function(e){const{userId:t,userEmail:n}=b(mc);return ku({mutationFn:tI,onMutateFn:({data:r,accessToken:o,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:o,userEmail:a}){const i=rI(n,t,r);await rr.cancelQueries({queryKey:i});const l=rr.getQueryData(i);return rr.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:aI(t,(r=t[n],i=e,l=o,s=a,{...r,reactions:[...r.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),n);var r,i,l,s}),{oldMessages:l}}({data:r,accessToken:o,conversationId:e,environment:a,userId:t,userEmail:n})},onSettled:()=>oI(e)})}(e);return R(js,{placement:"top-end",open:o,onOpenChange:a,blockInteraction:!0,children:[S(_s,{children:e=>S("button",{className:iI,...e,children:S(Yd,{Component:XE})})}),S(tc,{type:"reaction",children:S(eI,{reactions:lI,type:n,handleClick:e=>{r.some(t=>{const n=t.emojiCode===e,r=t.authorInfo.some(e=>e.userId===i);return n&&r})||(l({id:t,emojiCode:e}),a(!1))}})})]})}const cI=Nn({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function dI({reactions:e,type:t,handleClick:n}){const r=cI({type:t});return S("div",{className:r,children:S(eI,{reactions:e,handleClick:n,type:t})})}const uI=Nn({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),hI=Nn({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"}}}}),pI=An({position:"relative",display:"flex",flexDirection:"column"});function gI({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:o=[]}){const a=g(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=y(!1),[r,o]=y(!1);return T(()=>{if(null===a.current||!i||s)return;const e=a.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,a=e,s=r,l=n]),{isHover:t,reactionIsOpen:r,setIsHover:n,setReactionIsOpen:o};var a,i,l,s}(a),{mutate:d}=function(e){const{userId:t}=b(mc);return ku({mutationFn:nI,onMutateFn:({data:n,accessToken:r,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:n,environment:r,userId:o}){const a=rI(n,t,r);await rr.cancelQueries({queryKey:a});const i=rr.getQueryData(a);return rr.setQueryData(a,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return Zn(r)||0===r.reactions.length?t:aI(t,function(e,t,n){const r=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===n));return{...e,reactions:r}}(r,e.emojiCode,o),n)}),{oldMessages:i}}({data:n,accessToken:r,conversationId:e,environment:o,userId:t})},onSettled:()=>oI(e)})}(e),u=n?"sent":"received",h=o.filter(e=>YE(e.emojiCode)),p=h.length>0,m=Bn(Pn[`message-${u}`],hI({type:u}));return R("div",{className:uI({type:u,hasReactionsOnMessage:p}),ref:a,onMouseEnter:()=>"received"===u&&l(!0),children:[R("div",{className:pI,children:[S("div",{...m,children:r}),p&&S(dI,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&S(sI,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const mI=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{d:"M14.1641 9.87903V14.125H0.835876V9.87903",strokeMiterlimit:10}),p.createElement("path",{d:"M7.49988 10.4883V0.1875",strokeMiterlimit:10}),p.createElement("path",{d:"M11.7395 6.85162L7.4999 11.0913L3.26025 6.85162",strokeMiterlimit:10})),"Download"),vI=Nn({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}}}}),bI=An({position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"12px",borderRadius:"md",borderWidth:1,borderStyle:"solid",borderColor:"border.layout",backgroundColor:"surface.foreground",flexShrink:1}),fI=An({display:"flex",flexDirection:"column",gap:"4px",flex:1,minWidth:0}),yI=An({textDecoration:"none",color:"inherit",cursor:"pointer"});function xI({sentByCurrentUser:e,attachment:t}){const{fileName:n,fileSize:r,url:o}=t,a=jf();return S("div",{className:vI({type:e?"sent":"received"}),children:S("div",{onClick:async()=>{if(a)window.open(o,"_self","noopener,noreferrer");else try{if(o){const e=await fetch(o),t=await e.blob(),r=URL.createObjectURL(t),a=document.createElement("a");a.href=r,a.download=n??"attachment",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}}catch(e){await zr({error:new Error("error while downloading attachment"),severity:"error",extraData:{error:e}}),window.open(o,"_blank","noopener,noreferrer")}},className:yI,children:R("div",{className:bI,children:[R("div",{className:fI,children:[S(Ss,{children:n}),S(Ho,{children:`${r}`})]}),S(Yd,{Component:mI})]})})})}const TI=Bn(null,An({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function kI({children:e}){return S("div",{...TI,children:e})}const wI=Bn(null,An({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),CI=An({minHeight:1,width:"100%"}),AI=w(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},o){const a=g(null);t&&r?.current?.focus();const i=x(()=>{t&&Xn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){T(()=>{const r=e.current;if(null!==r){let e=r.scrollTop,o=Date.now();const a=()=>{if(t){const{scrollVelocity:t,currentScrollTop:a,currentTime:i}=function(e,t,n){const r=e.scrollTop,o=Date.now(),a=Math.abs(r-t),i=o-n;return{scrollVelocity:i>0?a/i:0,currentScrollTop:r,currentTime:o}}(r,e,o);t>5&&n(),e=a,o=i}};return r.addEventListener("scroll",a),()=>{r.removeEventListener("scroll",a)}}},[t,n,e])}(a,t,i),R("div",{tabIndex:-1,...wI,ref:a,children:[S("div",{className:CI,ref:o}),e]})}),EI=Object.freeze({message:{text:"",attachments:[]}});function II(e){const t=0==e?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,t)).toFixed(2)+" "+["B","kB","MB","GB","TB"][t]}const SI=An({display:"flex",flex:"1 1 0",flexDirection:"row",justifyContent:"space-between",backgroundColor:"surface.foreground",borderWidth:"1px",borderStyle:"solid",borderColor:"border.layout",padding:"8px 16px",marginBottom:"8px"}),NI=An({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px"}),RI=An({display:"grid",flexDirection:"column",minWidth:0});function PI({attachment:e,onRemove:t}){const n=(r=e).isPending?{text:"Uploading...",accent:"active"}:r.error?{text:r.error,intent:"danger"}:null===r.id?{text:"Failed to upload. Try uploading again.",intent:"danger"}:{text:II(r.size)};var r;return R("div",{className:SI,children:[R("div",{className:NI,children:[S(Yd,{Component:bc}),R("div",{className:RI,children:[S(Ss,{children:e.name}),S(Ho,{intent:n.intent,accent:n.accent,wrap:"wrap",children:n.text})]})]}),!e.isPending&&S(sc,{onClick:()=>t(e),children:S(Yi,{Component:Ks})})]})}const DI=An({width:"100%"});function LI({conversationId:e,addMessage:t,blockSubmit:n,isMobile:r,scrollRef:o,setActiveKeyboard:a,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:hm({defaultValues:t??EI,onSubmit:t=>{qh.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=g(null),d=x(e=>{s.setFieldValue("message",t=>({...t,attachments:[...t.attachments,...e]}))},[s]),u=x(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.map(t=>e.find(e=>e.localId===t.localId)||t)}))},[s]),{mutate:h}=ku({mutationFn:Lh,onSuccess:async()=>rr.invalidateQueries({queryKey:["files/attachments"]})}),p=x(e=>{s.setFieldValue("message",t=>({...t,attachments:t.attachments.filter(t=>t.localId!==e.localId)})),null!==e.id&&h({id:e.id})},[s,h]);return S("form",{className:DI,ref:c,onKeyDown:e=>function(e,t,n,r){if(!r&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!n)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,n,r),onSubmit:e=>{if(!n)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:S(s.Subscribe,{selector:e=>e.values.message.attachments,children:e=>R(N,{children:[e.map(e=>S(PI,{attachment:e,onRemove:p},e.localId)),S(s.AppField,{name:"message",children:t=>S(t.MessageAreaInput,{blockSubmit:n,scrollRef:o,setActiveKeyboard:a,ref:i,onFileSelect:d,onUploadComplete:u,hideFileUpload:e.length>=5})})]})})})}function MI(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text??"",reactions:[],attachments:[]}}async function OI(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return jr("mutation successful, invalidating messages queries"),Promise.all([rr.invalidateQueries({queryKey:e}),rr.invalidateQueries({queryKey:t}),rr.invalidateQueries({queryKey:n})]).catch(e=>zr({error:e,severity:"error"}))}const FI=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>yl({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),BI=async({data:e,accessToken:t,environment:n})=>yl({data:{data:[e]},accessToken:t,environment:n}),UI=An({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),VI=An({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),WI=An({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),HI="Marked As Resolved";function qI({resolver:e}){const t=e?`${e} ${HI}`:HI;return R("div",{className:VI,children:[S("div",{className:UI}),S("div",{className:WI,children:t}),S("div",{className:UI})]})}const jI=Nn({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function zI({width:e="md",height:t="md"}){return S(pa,{styles:jI({width:e,height:t})})}const _I=An({display:"flex",flexDirection:"row-reverse"});function KI(){return R(N,{children:[S(zI,{width:"lg",height:"lg"}),S("div",{className:_I,children:S(zI,{width:"md",height:"lg"})}),S("div",{className:_I,children:S(zI,{width:"lg",height:"xl"})}),S(zI,{width:"md",height:"lg"})]})}const YI=An({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function ZI({isConversationLoading:e,isFilling:t,message:n}){return e?n?S(kI,{children:S(gI,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):null:!e&&t?S(kI,{children:S(KI,{})}):R("div",{className:YI,children:[S(Vo,{textAlign:"center",wrap:"wrap",children:"Send your bookkeeper a message"}),S(Ss,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const XI=Bn(null,An({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",flexDirection:"column",position:"relative",backgroundColor:"surface.background",borderTop:"{borderWidths.lg} solid",borderTopColor:"border.layout",padding:"12px 15px"}));function QI({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:o=!1,attachedEntityId:a,defaultValues:i,defaultSubject:l}){const{userId:s}=b(mc),{mutate:c}=function(){const{userId:e}=b(mc);return ku({mutationFn:Ql,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const o=Kn(Yl({id:e.conversationId}),t,n);await rr.cancelQueries({queryKey:o});const a=rr.getQueryData(o);return rr.setQueryData(o,t=>[MI(e,r),...t]),{oldMessages:a}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:OI})}(),{query:{data:d},isFilling:u}=function(e){const t=Xn(e);return ir({queryKey:Yl({id:e??""}),queryFn:Xl,select:Zl,enabled:t})}(e),{mutate:h,isPending:p,variables:m}=(C=t,A=a,ku({mutationFn:BI,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(Zn(e)||Zn(t))return;C(t);const n=["conversations"],r=["banks/transactions",{}],o=["summaries",{}];let a=async()=>{},i=async()=>{};if(Xn(A)){const e={id:A};di(A,ci.BANK_TRANSACTION)?a=async()=>{const t=Hl(e);return await rr.invalidateQueries({queryKey:t})}:di(A,ci.FINANCIAL_SUMMARY)&&(i=async()=>await rr.invalidateQueries({queryKey:o}))}return jr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([rr.invalidateQueries({queryKey:n}),rr.invalidateQueries({queryKey:r}),a(),i()]).catch(e=>zr({error:e,severity:"error"}))}})),{mutate:v}=ku({mutationFn:FI,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return jr("mutation successful, invalidating conversations queries"),Promise.all([rr.invalidateQueries({queryKey:e}),rr.invalidateQueries({queryKey:t})]).catch(e=>zr({error:e,severity:"error"}))}}),[f,x]=y(!1),k=g(null),w=g(null);var C,A;T(()=>{n&&r&&e&&v({id:e,readStatus:"READ"})},[n,r,e,v]),T(()=>{Ph(w)},[d,w]);const E=Zn(e)||Zn(d)||u;return R(N,{children:[E?S(AI,{ref:w,inputRef:k,activeKeyboard:f,setActiveKeyboard:x,children:S(ZI,{isConversationLoading:p,isFilling:u,message:m?.message?.text})}):R(AI,{ref:w,activeKeyboard:f,setActiveKeyboard:x,inputRef:k,children:[n&&S(qI,{resolver:"Conversation"}),d.map((t,n)=>{const r=t[0].author.userId===s;return S(kI,{children:t.map(t=>R(N,{children:[t.attachments.filter(e=>!Zn(e)).map(e=>S(xI,{sentByCurrentUser:r,attachment:e},e?.id)),t.text&&S(gI,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id)]}))},n)})]}),S("div",{...XI,children:S(LI,{scrollRef:w,inputRef:k,conversationId:e,blockSubmit:p,isMobile:o,addMessage:({value:t})=>{const{text:n,attachments:r}=t.message,o=n.trim(),i=r.filter(e=>null!==e.id&&!e.isPending),s=i.map(e=>`att_${e.id}`),d=o.length>0,u=s.length>0;if(d||u)if(Zn(e)){const e=function(e,t,n){let r="";return Xn(e)?r=e:t.length>0?r=t:void 0!==n&&(r=n),r.slice(0,40)}(l,o,i[0]?.name),t=(p=o,g=s,{subject:e,status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...Xn(m=a)&&{attachedEntityId:m},message:{text:p,...g.length>0&&{attachmentIds:g}}});h(t)}else c({conversationId:e,text:o,...u&&{attachmentIds:s}});var p,g,m},setActiveKeyboard:x,defaultValues:i})})]})}function GI({conversationId:e,attachedEntityId:t,defaultSubject:n}){const[r,o]=y(e),{query:{data:a}}=fl(r),i="CLOSED"===a?.resolutionStatus;return R(_E,{children:[S(dx,{}),S(QI,{conversationId:r,setConversationId:o,isResolved:i,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t,defaultSubject:n})]})}const JI=Bn(Pn["form-body"],An({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"16px",overflowY:"auto",overflowX:"hidden",overscrollBehavior:{base:"contain",xl:"none"},minWidth:{base:0,sm:"512px"}}));function $I({children:e}){return S("div",{...JI,children:e})}const eS=Bn(null,An({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),tS=Bn(null,An({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),nS=An({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),rS=e=>{nh(e),rh(e)},oS=({children:e,onSubmit:t,Header:n,Footer:r,activeTab:o,conversationId:a,transactionId:i,transaction:l})=>S(jE,{children:R("div",{...eS,children:[S(_E,{children:R("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:rS,...tS,children:[n,S($I,{children:e}),r]})}),null!==o&&S("div",{className:nS}),"conversation"===o&&S(GI,{conversationId:a,attachedEntityId:i,defaultSubject:l?.description})]})}),aS=h.object({id:h.string(),type:h.enum(Object.values(pi)),reviewStatus:h.enum(Object.values(af)),amount:h.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:h.string("Required").refine(e=>(function(e,t){const n=Ze(e.getFullYear(),e.getMonth(),e.getDate()),r=Ze(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||pt(new Date(e),/* @__PURE__ */new Date))&&mt(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),customer:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),frequency:h.union([h.object({name:h.string(),value:h.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),h.undefined()]),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()})),bankAccount:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}),notes:h.string().nullable()}),iS=aS.extend({children:h.array(h.object({amount:h.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:h.object({id:h.string(),name:h.string().optional()},{message:"Required"}).nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),classSegments:h.array(h.object({id:h.string(),name:h.string().optional()}))})),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"})}),lS=aS.extend({id:h.string(),type:h.literal(Object.values(pi)),description:h.string(),displayName:h.string(),iconUrl:h.string().optional(),status:h.literal(Object.values(Wk)),reviewStatus:h.literal(Object.values(af)),apiName:h.literal(Object.values({PLAID:"PLAID",UNIT:"UNIT",STRIPE:"STRIPE",SHOPIFY:"SHOPIFY",SQUARE:"SQUARE",RUTTER:"RUTTER",UBER:"UBER",MOOV:"MOOV",QUALPAY:"QUALPAY",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",QBO:"QBO",XERO:"XERO",BENCH:"BENCH",WAVE:"WAVE"})),apiSourceId:h.string().nullable(),glAccount:h.object({id:h.string(),name:h.string().optional(),accountNo:h.string().optional()},{message:"Required"}),customer:h.object({id:h.string(),name:h.string().optional(),email:h.string().optional()}).nullable(),vendor:h.object({id:h.string(),name:h.string().optional()}).nullable(),invoice:h.object({id:h.string(),name:h.string(),date:h.string(),lineItems:h.array(h.object({id:h.string(),amount:h.number()}))}).nullable(),bill:h.object({id:h.string(),name:h.string().optional()}).nullable(),payroll:h.object({id:h.string(),date:h.string().optional(),checkDate:h.string().optional(),description:h.string().optional()}).nullable(),apiItemId:h.string().nullable()});lS.extend({});const sS=iS.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);s(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),cS=iS.extend({reconciliationMatch:h.object({id:h.string(),description:h.string().optional(),amount:h.number().optional(),date:h.string().optional(),apiInstitutionId:h.string().nullable().optional(),apiName:h.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",ADYEN:"ADYEN"}).optional()}).nullish()}).refine(e=>{const t=e.reconciliationMatch?.amount,n=e.amount;return!!Zn(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["reconciliationMatch"],when:e=>cS.pick({amount:!0,reconciliationMatch:!0}).safeParse(e.value).success});lS.extend({});const dS=iS.extend({});lS.extend({});const uS=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],hS=["FEDERAL","STATE","SALES"],pS=[{value:"FEDERAL",label:"Federal/Self-Employed Income Tax"},{value:"STATE",label:"State Income Tax"},{value:"SALES",label:"Sales Tax"}];function gS(e){if(!Zn(e))return pS.find(t=>t.value===e)?.label}const mS=h.object({tax:h.object({paymentInfo:h.object({region:h.enum(hS,{message:`Tax region must be one of: ${hS.join(", ")}`}),quarter:h.enum(["Q1","Q2","Q3","Q4"]).optional(),year:h.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${hS.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),vS=h.intersection(mS,iS);h.intersection(mS,lS);const bS={id:"",type:"EXPENSE",reviewStatus:"USER_REVIEW_REQUIRED",amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:Bl[0],notes:null,classSegments:[],children:[],reconciliationMatch:{id:"",description:"",amount:0,date:"",apiInstitutionId:"",apiName:void 0},tax:{paymentInfo:null}};function fS(e){const{mutate:t}=zb(),{query:{data:n}}=Pp(),r=e?{id:(o=e).id,type:o.type,reviewStatus:o.reviewStatus,amount:$h(o.amount),category:o.category,date:o.date,vendor:o.vendor,customer:o.customer,frequency:o.frequency,bankAccount:o.bankAccount,glAccount:o.glAccount,notes:o.notes,classSegments:o.classSegments,children:o.children.map(e=>({amount:$h(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),reconciliationMatch:o.reconciliationMatch,tax:o.tax}:bS;var o;return hm({defaultValues:r,validators:{onBlur:iS,onSubmit:({value:e})=>{const t=function(e){switch(e){case"EXPENSE":return sS;case"BANK_TRANSFER":case"TRANSFER_IN":case"TRANSFER_OUT":return cS;case"REVENUE":return dS;case"TAX_PAYMENT":case"TAX_EXPENSE":return vS;default:return}}(e.type);if(!t)return;const n=t.safeParse(e);if(!n.success){const e={};for(const t of n.error.issues){const n=t.path.join(".");e[n]||(e[n]={message:t.message})}return{fields:e}}}},onSubmit:r=>{if(!e)return;const o=function({payload:e,expenseCategories:t}){if("EXPENSE"===e.type){const n=t.find(t=>t.id===e.categoryId)?.accountId;return Zn(n)?e:{...e,glAccountId:ui({id:n,prefix:"GL_ACCOUNT"})}}return e}({payload:function(e,t){const n={id:e,amount:t.amount?ep(t.amount):0,date:t.date,bankAccountId:t.bankAccount.id,frequency:t.frequency?.value,notes:t.notes,classSegmentIds:t.classSegments.map(e=>e.id),children:t.children.map(e=>({amount:e.amount?ep(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:t.classSegments.map(e=>e.id)}))};switch(t.type){case"EXPENSE":return{...n,vendorId:t.vendor?.id,customerId:t.customer?.id,categoryId:t.category?.id};case"REVENUE":return{...n,customerId:t.customer?.id,glAccountId:t.glAccount?.id};case"BANK_TRANSFER":case"TRANSFER_IN":case"TRANSFER_OUT":return{...n,glAccountId:t.glAccount?.id,matchingBankTransactionId:t.reconciliationMatch?.id,reviewStatus:t.reviewStatus};case"TAX_PAYMENT":case"TAX_EXPENSE":return{...n,tax:t.tax};default:return n}}(e.id,r.value),expenseCategories:n?.data??[]});t(o),r.formApi.reset(r.value,{keepDefaultValues:!0})},onSubmitInvalid:()=>{}})}function yS({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const o=zs();return R(bp,{onClick:()=>{r&&o.close(),t()},children:[n&&S(Yd,{Component:n}),S(Vo,{children:e})]})}function xS({transaction:e}){const{mutate:t}=jb(),n=()=>t(Hk([e]));return S(yS,{onClick:()=>{return e=n,void gu({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:ou,label:"Cancel"},{key:au,label:"Delete",type:pu}]}).then(t=>{t===au&&e()});var e},children:"Delete"})}function TS({transaction:e}){const{mutate:t}=jb();return S(yS,{onClick:()=>{t([e].map(e=>({id:e.id,status:Wk.ACTIVE})))},children:"Restore"})}const kS=pm({defaultValues:bS,render:function({form:e}){return S(yS,{onClick:()=>{Ar()},closeOnClick:!0,children:"Attach Bill(s)"})}}),wS=pm({defaultValues:bS,render:function({form:e}){return S(yS,{onClick:()=>{Ar()},closeOnClick:!0,children:"Attach Payroll"})}}),CS=pm({defaultValues:bS,render:function({form:e}){return S(yS,{onClick:()=>{Ar()},Icon:cy,closeOnClick:!0,children:"Attach Invoice(s)"})}}),AS=Bl.filter(e=>"ONE_TIME"!=e.value);function ES({onClick:e}){const t=zs();return S(Zp,{triggerChildren:S(Gp,{displayLabel:"Make recurring"}),popupChildren:S(um,{frequencies:AS,onClick:n=>{e(n),t.close()}})})}function IS({active:e,icon:t,onClick:n,ariaLabel:r,popupTriggerProps:o}){return S(sc,{ariaLabel:r,onClick:n,active:e,popupTriggerProps:o,children:S(Hc,{Component:t})})}function SS({activeTab:e,onClick:t,popupTriggerProps:n}){return S(IS,{active:"conversation"===e,onClick:()=>t("conversation"),icon:ad,ariaLabel:"conversation-tab",popupTriggerProps:n})}const NS=An({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"});function RS({conversationId:e,attachedEntityId:t,defaultSubject:n}){const r=zs(),[o,a]=y(e),{query:{data:i}}=fl(o),l="CLOSED"===i?.resolutionStatus;return S(ax,{children:R("div",{className:NS,children:[S(dx,{children:R(lx,{children:[S(px,{Icon:Hi,handleClose:()=>r.setOpen(!1)}),S(Vo,{children:"Back"})]})}),S(QI,{conversationId:o,setConversationId:a,isResolved:l,isUnread:"UNREAD"===i?.readStatus,attachedEntityId:t,defaultSubject:n})]})})}const PS=pm({defaultValues:bS,props:{title:"Transaction",transaction:null,activeTab:null,tabOnClick:()=>{},conversationId:null,transactionId:""},render:function({form:e,title:t,transaction:n,activeTab:r,tabOnClick:o,conversationId:a,transactionId:i}){const l=Bt(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),s=De(),c=jf(),d=!Zn(n)&&tp(n)&&"EXPENSE"===n.type;return S(dx,{children:R(lx,{children:[S(px,{}),S(Vo,{children:t}),c?R(js,{children:[S(_s,{children:e=>S(SS,{onClick:o,activeTab:r,popupTriggerProps:e})}),S(RS,{conversationId:a,attachedEntityId:i})]}):S(SS,{onClick:o,activeTab:r}),S(EC,{shouldUseButtonDiscreteStyles:!0,children:R(dp,{children:[n?.status===Wk.ACTIVE&&S(xS,{transaction:n}),n?.status===Wk.INACTIVE&&S(TS,{transaction:n}),l&&R(N,{children:["EXPENSE"===n?.type&&S(kS,{form:e}),"EXPENSE"===n?.type&&S(wS,{form:e}),"REVENUE"===n?.type&&S(CS,{form:e})]}),d&&S(e.Subscribe,{selector:e=>e.values.frequency,children:t=>{return s&&!(null!=(n=t)&&"ONE_TIME"!=n.value)&&S(ES,{onClick:t=>e.setFieldValue("frequency",t)});var n}})]})})]})})}}),DS={EXPENSE:{value:"EXPENSE",label:"Expense"},REVENUE:{value:"REVENUE",label:"Income"},TAX_EXPENSE:{value:"TAX_EXPENSE",label:"Tax Pmt"},TRANSFER:{value:"TRANSFER_IN",label:"Transfer"}},LS=Object.values(DS);function MS(e){switch(e){case"EXPENSE":return DS.EXPENSE;case"REVENUE":return DS.REVENUE;case"TAX_PAYMENT":case"TAX_EXPENSE":return DS.TAX_EXPENSE;default:return DS.TRANSFER}}function OS({category:e,onClick:t,currentCategory:n}){return S(kx,{text:e.name??"",iconUrl:e.iconUrl,title:"All Categories",children:S(VS,{nestedCategories:e.children??[],listLabel:e.name??"",onClick:t,currentCategory:n,isFilling:!1,showSuggestedCategories:!1})})}function FS(e){const{onClick:t,showSuggestedCategories:n,listLabel:r,isFilling:o,currentCategory:a,categories:i}=e,l=Le();return o?S(Lx,{}):R(Ax,{children:[l&&n&&S(Vo,{children:"Suggested"}),S(Vo,{children:r}),S("div",{children:i.map(e=>{return e.hasChilds?S(OS,{category:e,onClick:t,currentCategory:a},e.id):S(ox,{text:e.name??"",iconUrl:e.iconUrl,handleClick:()=>t(e),RightIcon:(n=e.id,a?.id===n?of:void 0)},e.id);var n})})]})}const BS="Search expense categories...",US=[];function VS({listLabel:e="All Expense Categories",onClick:t,showSuggestedCategories:n,nestedCategories:r,currentCategory:o,isFilling:a}){const i=r??US,l=zs(),s=o?/* @__PURE__ */new Set([o.id]):/* @__PURE__ */new Set;return S(Jx,{placeholder:BS,onClick:e=>{t(e),l.close()},SearchList:Bx,DefaultList:FS,listLength:i.length,extraProps:{categories:i,listLabel:e,isFilling:a,showSuggestedCategories:n,currentCategory:o,selectedIds:s}})}function WS({onClick:e,showSuggestedCategories:t,glAccounts:n,listLabel:r,isFilling:o,currentGlAccount:a,selectedIds:i}){const l=Le();return o?S(Lx,{}):R(Ax,{children:[l&&t&&S(Vo,{children:"Suggested"}),S(Vo,{children:r}),S("div",{children:n?.map(t=>t.hasChilds?S(kx,{text:t.name,iconUrl:t.iconUrl,title:"All Categories",children:S(jS,{headerLabel:"All Categories",listLabel:t.name,nestedGlAccounts:t.children,onClick:e,currentGlAccount:a})},t.id):S(ox,{text:t.name,handleClick:()=>e(t),RightIcon:i.has(t.id)?of:void 0},t.id))})]})}const HS="Search income categories...",qS=[];function jS({listLabel:e="All Income Categories",onClick:t,showSuggestedCategories:n,nestedGlAccounts:r,currentGlAccount:o}){const{query:{data:a,isFetched:i},isFilling:l}=lg(),s=mg([...r??a??qS],gg),c=zs(),d=o?.id?/* @__PURE__ */new Set([o.id]):/* @__PURE__ */new Set;return S(Jx,{placeholder:HS,onClick:e=>{t(e),c.close()},SearchList:Vx,DefaultList:WS,listLength:s.length,extraProps:{glAccounts:s,listLabel:e,isFetched:i,isFilling:l,showSuggestedCategories:n,currentGlAccount:o,selectedIds:d},forceSearchVisible:!0})}function zS({onClick:e,showSuggestedCategories:t,currentRegion:n}){const r=Le(),o=zs();return R(Ax,{children:[r&&t&&S(Vo,{children:"Suggested"}),S(Vo,{children:"All Tax Categories"}),S("div",{children:pS.map(t=>S(ox,{text:t.label,handleClick:()=>(e(t.value),void o.close()),RightIcon:n===t.value?of:void 0},t.value))})]})}function _S({onClick:e,onNeedsMatchClick:t,showSuggestedCategories:n,bankTransfers:r,holdingAccount:o,listLabel:a,isFetched:i,isFilling:l,currentTransfer:s}){const c=Le(),d=!l&&i&&0===r.length;return l?S(Lx,{}):R(Ax,{children:[o&&S(ox,{text:"Needs Match",handleClick:t}),c&&n&&S(Vo,{children:"Suggested"}),!d&&R(N,{children:[S(Vo,{children:a}),S("div",{children:r?.map(t=>S(ox,{text:np(t),handleClick:()=>e(t),RightIcon:s?.id===t.id?of:void 0},t.id))})]})]})}const KS={keys:[{name:"description"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function YS({searchTerm:e,onClick:t,bankTransfers:n,isFilling:r,currentTransfer:o}){const a=m(()=>new Ce(n??[],KS),[n]),i=m(()=>n?a.search(e).map(e=>e.item):[],[n,e,a]);return r?S(Lx,{}):0===i.length?S(Fx,{singularSearchCTANoun:"matching bank transaction",pluralNounNotFound:"matching bank transactions",showSearchCTA:!0}):S(Ax,{children:S("div",{children:i.map(e=>S(ox,{text:np(e),handleClick:()=>t(e),RightIcon:o?.id===e.id?of:void 0},e.id))})})}const ZS=[];function XS({listLabel:e="All Matching Bank Transactions",onClick:t,showSuggestedCategories:n,transactionBankAccountId:r,transactionAmount:o,transactionDate:a,currentTransfer:i}){const l=yt(a),s=(c=r,{filter:{status:{in:["ACTIVE"]},type:{in:["BANK_TRANSFER",(d=o)>0?"EXPENSE":"REVENUE"]},amount:{equal:-d},date:{greaterThanEqual:xt(Et(u=l??/* @__PURE__ */new Date,-3)),lessThanEqual:xt(Et(u,3))},bankAccount:{id:{notIn:[c]}},reconciliationMatch:{id:{equal:null}}}});var c,d,u;const{query:{data:h,isFetched:p},isFilling:g}=jl(s,{enabled:null!==l}),m=h?.data??ZS,{query:{data:v}}=ig({select:e=>e.find(e=>"CLEARING_ACCOUNT"===e.assetType)}),b=zs();return S(Jx,{placeholder:"Search matching bank transfers...",onClick:e=>{t({transfer:e}),b.close()},SearchList:YS,DefaultList:_S,listLength:m.length??0,extraProps:{listLabel:e,bankTransfers:m,isFetched:p,isFilling:g,holdingAccount:v,showSuggestedCategories:n,transactionDate:a,onNeedsMatchClick:()=>{v&&t({glAccount:v}),b.close()},currentTransfer:i}})}const QS=pm({defaultValues:bS,props:{},render:function({form:e,...t}){const{transactionType:n,onExpenseClick:r,onRevenueClick:o,onTaxPaymentClick:a,onBankTransferClick:i,transaction:l}=t,{query:{data:s},isFilling:c}=Dp(),d=s?.data??[];switch(n){case"EXPENSE":return S(e.Subscribe,{selector:e=>e.values.category,children:e=>S(VS,{...t,nestedCategories:d,isFilling:c,onClick:r,currentCategory:e})});case"REVENUE":return S(e.Subscribe,{selector:e=>e.values.glAccount,children:e=>S(jS,{...t,onClick:o,currentGlAccount:e})});case"TAX_PAYMENT":case"TAX_EXPENSE":return S(e.Subscribe,{selector:e=>e.values.tax?.paymentInfo?.region,children:e=>S(zS,{...t,onClick:a,currentRegion:e})});case"BANK_TRANSFER":case"TRANSFER_IN":case"TRANSFER_OUT":return S(e.Subscribe,{selector:e=>e.values.reconciliationMatch,children:n=>S(XS,{...t,onClick:i,transaction:l,transactionBankAccountId:l?.bankAccount.id??e.store.state.values.bankAccount.id,transactionAmount:l?.amount??0,transactionDate:l?.date??e.store.state.values.date,currentTransfer:n})})}}}),GS=pm({defaultValues:bS,props:{},render:function({form:e,...t}){const{headerLabel:n="Back"}=t,r=Te(e.store,e=>e.values.type),[o,a]=y(r);return R(Tx,{title:n,children:[S(xg,{rows:1,cols:4,options:LS,handleClick:e=>a(e.value),selected:MS(o)}),S(QS,{form:e,transactionType:o,onExpenseClick:t=>{e.setFieldValue("category",t),e.setFieldValue("type","EXPENSE")},onRevenueClick:t=>{e.setFieldValue("glAccount",t),e.setFieldValue("type","REVENUE")},onTaxPaymentClick:t=>{e.setFieldValue("tax.paymentInfo.region",t),e.setFieldValue("type","TAX_EXPENSE")},onBankTransferClick:({transfer:t,glAccount:n})=>{Xn(t)&&e.setFieldValue("reconciliationMatch",t),Xn(n)&&(e.setFieldValue("glAccount",n),e.setFieldValue("reviewStatus","RECONCILIATION_AWAITING")),e.setFieldValue("type","BANK_TRANSFER")},...t})]})}}),JS=An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"}),$S=An({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}),eN=pm({defaultValues:bS,props:{},render:function({form:e,transaction:t}){return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(e.AppField,{name:"category",children:e=>S(dh,{label:"Category",popupTriggerProps:t,children:R("button",{className:JS,type:"button",children:[Xn(e.state.value)?R("div",{className:$S,children:[S("img",{src:e.state.value.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Ss,{wrap:"wrap",children:e.state.value.name})]}):S(Ss,{intent:"weak",children:"Select category"}),S(Yd,{Component:qi})]})})})}),S(GS,{form:e,transaction:t})]})}}),tN=pm({defaultValues:bS,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const r=De();return R(N,{children:[S(e.AppField,{name:"vendor",children:e=>S(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:n})}),S(e.AppField,{name:"customer",children:e=>S(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:n})}),S(e.Subscribe,{selector:e=>e.values.frequency,children:o=>{return r&&n&&(a=t.type,void 0!==(i=o)&&"ONE_TIME"!==i.value&&"EXPENSE"===a)&&S(e.AppField,{name:"frequency",children:e=>S(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})});var a,i}}),S(eN,{form:e,transaction:t}),n&&S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})})]})}}),nN=An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"}),rN=An({display:"flex",gap:"8px",alignItems:"center"}),oN=pm({defaultValues:bS,props:{},render:function({form:e,transaction:t}){return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(e.AppField,{name:"glAccount",children:e=>{const n=e.state.value;return S(dh,{label:"Category",popupTriggerProps:t,children:R("button",{className:nN,type:"button",children:[Xn(n)?R("div",{className:rN,children:[S("img",{src:n.iconUrl,alt:void 0,width:"15px",height:"15px"}),S(Ss,{children:n.name})]}):S(Ss,{intent:"weak",children:"Select category"}),S(Yd,{Component:qi})]})})}})}),S(GS,{form:e,transaction:t})]})}}),aN=pm({defaultValues:bS,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return R(N,{children:[S(e.AppField,{name:"customer",children:e=>S(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),S(oN,{form:e,transaction:t}),n&&S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})})]})}}),iN=Bn(null,An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),lN=pm({defaultValues:bS,props:{},render:function({form:e,transaction:t}){return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(e.AppField,{name:"reconciliationMatch",children:e=>{const n=e.state.value,r=n?np(n):"Select";return S(dh,{label:"Matching Bank Transfer",popupTriggerProps:t,children:R("button",{...iN,children:[S(Ss,{intent:n?"default":"weak",children:r}),S(Yd,{Component:qi})]})})}})}),S(GS,{form:e,transaction:t})]})}}),sN=pm({defaultValues:bS,props:{transaction:{}},render:function({form:e,transaction:t}){return R(N,{children:[S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})}),S(e.AppField,{name:"glAccount",children:e=>S(e.BankGlAccountField,{transaction:t})}),S(lN,{form:e,transaction:t})]})}}),cN=An({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"}),dN=pm({defaultValues:bS,props:{},render:function({form:e,transaction:t}){return R(js,{placement:"bottom-start",children:[S(_s,{children:t=>S(e.AppField,{name:"tax.paymentInfo.region",children:e=>S(dh,{label:"Category",popupTriggerProps:t,children:R("button",{className:cN,type:"button",children:[S(Ss,{children:gS(e.state.value)??"Select region..."}),S(Yd,{Component:qi})]})})})}),S(GS,{form:e,transaction:t})]})}}),uN=pm({defaultValues:bS,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return R(N,{children:[S(dN,{form:e,transaction:t}),S(e.AppField,{name:"tax.paymentInfo.quarter",children:e=>S(e.ButtonGroupField,{label:"Quarter",options:uS})}),S(e.AppField,{name:"tax.paymentInfo.year",children:e=>S(e.GenericSelectorField,{label:"Year",options:ht({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),n&&S(e.AppField,{name:"bankAccount",children:e=>S(e.ManualBankAccountField,{transaction:t})})]})}}),hN=An({display:"flex",flexDirection:"column",gap:"16px"}),pN=pm({defaultValues:bS,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const{startPrefetch:r,cancelPrefetch:o}=Fp();return S("div",{className:hN,onMouseEnter:r,onMouseLeave:o,children:S(e.Subscribe,{selector:e=>e.values.type,children:r=>{switch(r){case"EXPENSE":return S(tN,{form:e,transaction:t,isManual:n});case"REVENUE":return S(aN,{form:e,transaction:t,isManual:n});case"TRANSFER_IN":case"TRANSFER_OUT":case"BANK_TRANSFER":return S(sN,{form:e,transaction:t});case"TAX_PAYMENT":case"TAX_EXPENSE":return S(uN,{form:e,transaction:t,isManual:n});default:return null}}})})}}),gN=Bn(null,An({display:"flex",flexDirection:"column",justifyContent:"center",gap:"4px"}));function mN({transaction:e,bankAccount:t}){const n=e?e.description:"",r=Zn(t)||Zn(e)?"":((e,t)=>{const n=bi(t.type),r=xi(t.amount);return`${n?`${r} `:""}${si(e.name,e.mask)}`})(t,e);return R("div",{...gN,children:[S(Vo,{wrap:"wrap",children:n}),t&&S(Ho,{children:r})]})}function vN({transaction:e,form:t,bankAccount:n,isManual:r,conversationId:o,transactionId:a,initialTab:i,currentType:l}){const s=mi[l],[c,d]=y(i??null),u=S(PS,{form:t,transaction:e,title:s,activeTab:c,tabOnClick:e=>d(e===c?null:e),conversationId:o,transactionId:a}),h=S(t.Subscribe,{selector:e=>e.isDefaultValue,children:e=>S(zu,{disabled:e})});return R(oS,{onSubmit:t.handleSubmit,Header:u,Footer:h,activeTab:c,conversationId:o,transactionId:a,transaction:e,children:[e?.description&&S(mN,{transaction:e,bankAccount:n}),S(t.AppField,{name:"amount",children:e=>S(r?e.EditableAmountField:e.DiscreetAmountField,{label:"Total"})}),S(t.AppField,{name:"date",children:e=>S(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:r})}),S(pN,{form:t,transaction:e,isManual:r}),S(t.AppField,{name:"notes",children:e=>S(e.TextAreaInput,{label:"Note"})}),S(t.AppField,{name:"type",children:()=>null})]})}function bN({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:o,isManual:a,isLoading:i}=function({transactionId:e}){const{query:{data:t,isFetching:n},isFilling:r}=_l({id:e});return{transaction:t,form:fS(t),bankAccount:wi(t?.bankAccount?.id??""),isManual:!Zn(t)&&tp(t),isLoading:r||n&&!t}}({transactionId:e});if(i||!n)return null;const l=n?.conversation?.id??null;return S(r.Subscribe,{selector:e=>e.values.type,children:i=>S(vN,{transaction:n,form:r,bankAccount:o,isManual:a,conversationId:l,transactionId:e,initialTab:t,currentType:i})})}function fN({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=_l({id:e});return T(()=>{!r&&Zn(n)&&Ol()},[n,r]),Zn(n)?null:S(bN,{transactionId:e,initialTab:t})}const yN={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},xN=(e={})=>{const t=vn(yN,e);return yN.transform(t,mn)},TN=e=>An(xN(e));TN.raw=xN;const kN={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},wN=(e={})=>{const t=vn(kN,e);return kN.transform(t,mn)},CN=e=>An(wN(e));function AN({subject:e,children:t}){return R(dx,{children:[R(lx,{children:[S(px,{}),S(Vo,{children:e})]}),S("div",{className:CN({alignItems:"center",gap:15}),children:t})]})}function EN({conversationId:e,defaultValues:t}){const[n,r]=y(e),{query:{data:o}}=fl(n),a="CLOSED"===o?.resolutionStatus;return S(jE,{children:R(_E,{children:[S(AN,{subject:o?.subject??"Conversation"}),S(QI,{conversationId:n,setConversationId:r,isResolved:a,isUnread:"UNREAD"===o?.readStatus,defaultValues:t})]})})}CN.raw=wN;const IN=Wi(e=>p.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("g",{clipPath:"url(#clip0_18201_5557)"},p.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),p.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),p.createElement("defs",null,p.createElement("clipPath",{id:"clip0_18201_5557"},p.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function SN({onClick:e,active:t}){return S(vs,{type:"button",onClick:e,active:t,children:S(Yd,{Component:IN})})}const NN=An({display:"flex",flexDirection:"column"});function RN({label:e,data:t,isFilling:n,shimmerWidth:r}){return R("div",{className:NN,children:[S(Ho,{children:e}),n?S(zI,{width:r}):S(Vo,{wrap:"wrap",children:t??""})]})}function PN({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=_l({id:e}),o=wi(n?.bankAccount.id??"");if(Zn(n))return null;const a=TN({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return R("div",{"data-open":t,className:a,children:[R("div",{className:CN({justifyContent:"space-between"}),children:[S(RN,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),S(RN,{label:"Amount",data:Bo($h(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),S(RN,{label:"Bank Account",data:si(o?.name??"",o?.mask??""),isFilling:r,shimmerWidth:"lg"}),S(RN,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function DN({conversationId:e,transactionId:t}){const[n,r]=y(e),[o,a]=y(!0),{query:{data:i}}=fl(n),l="CLOSED"===i?.resolutionStatus;return S(jE,{children:R(_E,{children:[S(AN,{subject:i?.subject??"Conversation",children:Xn(t)&&S(SN,{onClick:()=>a(!o),active:o},"infoButton")}),Xn(t)&&S(PN,{transactionId:t,isOpen:o}),S(QI,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function LN(){const e=Fl().length>1;return S(jE,{children:R(_E,{background:"foreground",children:[S(dx,{children:R(lx,{children:[S(px,e?{Icon:Hi}:{}),S(Vo,{children:"Add New Connection"})]})}),S(hE,{})]})})}function MN(){return S(dx,{children:R(lx,{children:[S(px,{}),S(Vo,{children:"Financial Summary"})]})})}const ON=An({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),FN=jn.raw({body:"default"}),BN=An({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},FN);function UN({summaryText:e}){return S("div",{className:ON,children:S("div",{className:BN,children:e})})}const VN=An({display:"flex",flexDirection:"column",overflow:"auto"});function WN({summary:e}){return R("div",{className:VN,children:[S(MN,{}),S(UN,{summaryText:e})]})}const HN=An({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function qN({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return ir({queryKey:$l({id:e}),queryFn:ts})}({id:e});return S(jE,{children:R("div",{className:HN,children:[S(_E,{children:S(WN,{summary:n?.summary})}),S(qu,{}),S(GI,{conversationId:t??null,attachedEntityId:e})]})})}function jN(){return S(jE,{children:S(_E,{children:S(EE,{showCloseButton:!0,inOverlay:!0})})})}const zN=h.object({id:h.string(),name:h.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:h.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),type:h.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),_N={mergeDestination:Bg,selectedAccount:null};const KN=An({display:"flex",flexDirection:"column",gap:"20px"}),YN=An({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),ZN=An.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),XN=An(ZN,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),QN=An(ZN,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),GN=An(ZN,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),JN=An({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),$N=An({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),eR=An({width:"100%",display:"flex",justifyContent:"flex-start"}),tR=An({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),nR=An({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),rR=e=>{nh(e),rh(e)};function oR({account:e}){const t=zs(),n=function(e,t){const{mutateAsync:n}=Su();return hm({defaultValues:_N,onSubmit:async r=>{if(await Pu()===au&&Xn(e)&&Xn(r.value.selectedAccount)){const l=(o=e,a=r.value.mergeDestination,i=r.value.selectedAccount,a===Bg?{...Ti(i),duplicateBankAccountIds:[hi(o.id)]}:{...Ti(o),duplicateBankAccountIds:[hi(i.id)]});try{await n(l),t.close(),r.value.mergeDestination===Bg&&Ol()}catch{await Du()}}var o,a,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:o}=ai();if(!(r&&r.data||o))return null;const a=r?.data?.filter(t=>t.glAccountId&&t.isSupported&&t.id!==e?.id&&t.integration?.id!==e?.integration?.id);return R("form",{className:KN,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:rR,children:[S(Vo,{children:"Merge Accounts"}),S("div",{className:YN,children:S(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>R(N,{children:[R("div",{className:XN,children:[S("div",{className:eR,children:S(Vo,{children:"Duplicate Account"})}),t===Bg?S(Lg,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):S(n.AppField,{name:"selectedAccount",children:n=>S(Vg,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:a,isFilling:o,warningMessage:Wg(t,e,n.state.value)})})]}),R("div",{className:QN,children:[S("div",{className:tR,children:S(Vo,{children:"Into"})}),S(n.AppField,{name:"mergeDestination",children:e=>S("div",{className:$N,children:S(vs,{onClick:()=>e.handleChange(e.state.value===Bg?Fg:Bg),children:S(Yd,{Component:qi})})})})]}),R("div",{className:GN,children:[S("div",{className:nR,children:S(Vo,{children:"Destination Account"})}),t===Bg?S(n.AppField,{name:"selectedAccount",children:n=>S(Vg,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:a,isFilling:o,warningMessage:Wg(t,e,n.state.value)})}):S(Lg,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),R("div",{className:JN,children:[S(mm,{showIcon:!1,onClick:()=>{t.close()}}),S(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>S(Uu,{disabled:Zn(e),showIcon:!1,textContent:"Merge"})})]})]})}function aR({bankAccount:e}){return S(dp,{children:R(js,{placement:"right-start",modal:!0,children:[S(_s,{children:e=>R(bp,{...e,children:[S(Yd,{Component:qC}),S(Vo,{children:"Merge Account"})]})}),S(ax,{children:S(RC,{children:S(DC,{children:S(oR,{account:e})})})})]})})}const iR=An({width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"left",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discreet"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discreet.hover"}}}),lR=({tranStartDate:e})=>R(N,{children:[S(Ho,{children:"Start Date"}),Jn(e)?S(Vo,{children:`${At(yt(e))}`}):S(Vo,{children:"Set Start Date"})]});function sR({bankAccount:e}){return R(js,{placement:"right-start",modal:!0,children:[S(_s,{children:t=>S("button",{className:In(iR,zi),...t,type:"button",children:S(lR,{tranStartDate:e.tranStartDate})})}),S(ax,{children:S(RC,{children:S(DC,{width:"sm",children:S(VC,{bankAccounts:[e]})})})})]})}const cR=e=>["accounting/manualJournalEntry",e.id],dR=async e=>{const t=e.queryKey,n=t[2].accessToken,r=t[2].environment,o={path:"/accounting/manualJournalEntry?id={id}",pathParams:{id:t[1]},accessToken:n,environment:r};return await sl(o)};function uR({id:e}){return ir({queryKey:cR({id:String(hi(e))}),queryFn:dR,enabled:Xn(e)})}const hR=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>{const r={path:"/accounting/manualJournalEntry",bodyParams:{manualJournalEntry:e},accessToken:t,endpointManager:io(n)};return await to(r)})({data:e,accessToken:t,environment:n});const pR=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:io(n)};return await to(r)},gR=h.object({amount:h.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:h.string("Required")}),mR=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===hi(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},vR=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=uR({id:t??null}),r=function(){const{query:{data:e}}=sg();return mg(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:o}=ku({mutationFn:pR,onSuccess:async()=>{jr("beginning balance mutation successful, invalidating bank account queries");try{return rr.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&zr({error:e,severity:"error"})}}});const{mutate:a}=ku({onSuccess:async()=>{jr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([rr.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),rr.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&zr({error:e,severity:"error"})}},mutationFn:hR}),i=zs(),l=((e,t)=>{const n=mR(e,t);return{amount:Xn(e.beginningBalanceData.journalEntry?.id)?n:"",date:Xn(t?.date)?t.date:""}})(e,n);return hm({defaultValues:l,validators:{onBlur:gR},onSubmit:l=>{if(i.close(),Zn(t)||Zn(n))o({bankAccountId:hi(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,o)=>{if(Zn(e.id))return null;const a={...e,id:e.id},i=o.map(e=>hi(e.id));let l=0;return a.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===hi(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),Zn(l)?null:(a.transactions?.forEach(e=>{i.includes(e.glAccountId)&&(e.drAmount?e.drAmount=Number(e.drAmount)-l:e.crAmount&&(e.crAmount=Number(e.crAmount)-l))}),a.date=xt(t)??a.date,a)})(n,yt(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);Xn(t)&&a(t)}}})},bR=An({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),fR=An({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function yR({bankAccount:e}){const t=vR(e),n=zs(),r=()=>{n.close()};return R("form",{className:bR,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[S(Vo,{children:"Set Beginning Balance"}),S(t.AppField,{name:"date",children:e=>S(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),S(t.AppField,{name:"amount",children:e=>S(e.EditableAmountField,{label:"Beginning Balance Amount"})}),S(t.Subscribe,{selector:e=>e,children:e=>R("div",{className:fR,children:[S(mm,{showIcon:!1,onClick:r}),S(Uu,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const xR=Nn({base:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"8px",padding:"12px 16px",borderRadius:"md",textAlign:"right",cursor:"pointer",outline:"none",_focusVisible:{outline:"4px solid",outlineColor:"border.layout"},backgroundColor:{base:"surface.foreground",sm:"surface.intent.action.discreet"},borderWidth:"lg",borderStyle:"solid",borderColor:{base:"border.layout.strong",sm:"transparent"},_supportHover:{backgroundColor:{base:"surface.intent.action",sm:"surface.intent.action.discreet.hover"}}},variants:{layout:{left:{alignItems:"flex-start"},right:{alignItems:"flex-end"}}}}),TR=An({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function kR({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:o="left"}){const a=In(xR({layout:o}),zi),i=In(xR({layout:"right"}),zi),l=r&&At(r);return R(js,{placement:"right-start",modal:!0,children:[S(_s,{children:e=>R("div",{className:TR,children:[R("button",{className:a,...e,type:"button",children:[S(Ho,{children:"Beginning Balance"}),S(Vo,{children:Xn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&R("button",{className:i,...e,type:"button",children:[S(Ho,{children:"Migration Date"}),S(Vo,{children:l})]})]})}),S(ax,{children:S(RC,{children:S(DC,{width:"sm",children:S(yR,{bankAccount:e})})})})]})}const wR=Nn({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function CR({bankAccount:e,showStartDate:t}){const{query:{data:n}}=uR({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=mR(e,n),o=Xn(n?.date)?yt(n?.date):null,a=Xn(e.tranStartDate)?yt(e.tranStartDate):null,i=Xn(o)&&Xn(a)&&!pt(o,a),l=i?"left":t?"right":"left";return R("div",{className:wR({layout:i?"stacked":"inline"}),children:[t&&S(sR,{bankAccount:e}),S(kR,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:o})]})}const AR=An({marginTop:"15px",marginBottom:"15px"}),ER={id:"",name:"",mask:"",type:void 0};const IR=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],SR=e=>{nh(e),rh(e)};function NR({bankAccountId:e}){const t=wi(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:ER,[r,o]=y(n),a=function(e,t){const{mutate:n}=Su(),{mutateAsync:r}=Iu({mutationFn:Cu}),o=Jn(String(e.id));return hm({defaultValues:e,validators:{onBlur:zN},onSubmit:async e=>{if(o)n(Ti(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const n=await r((a=e.value,{apiAccountName:a.name,apiAccountNo:a.mask,apiAccountType:a.type||"DEPOSITORY",duplicateBankAccountIds:[]})),o={id:ui({id:n?.dataObject?.id,prefix:"BANK_ACCOUNT"}),name:n?.dataObject?.apiAccountName??"",mask:n?.dataObject?.apiAccountNo??"",type:e.value.type};t(o),e.formApi.reset(o,{keepDefaultValues:!0})}var a},onSubmitInvalid:()=>{}})}(r,o),i=!t||fi(t.apiName),l=!!t&&yi(t.apiName),s=si(r?.name??"",r?.mask??""),c=Jn(s)?s:"New Bank Account",d=l&&Xn(t?.tranStartDate),u=Xn(t)&&(d||!0);return S(jE,{children:S(_E,{children:R("form",{onSubmit:e=>{e.preventDefault(),a.handleSubmit()},onKeyDown:SR,children:[R(dx,{children:[R(lx,{children:[S(px,{Icon:Hi}),S(Vo,{children:c}),Xn(t)&&S(EC,{shouldUseButtonDiscreteStyles:!0,children:S(aR,{bankAccount:t})})]}),S(a.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:S(a.SaveButton,{})})]}),R($I,{children:[S(a.AppField,{name:"name",children:e=>S(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),S(a.AppField,{name:"mask",children:e=>S(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),S(a.AppField,{name:"type",children:e=>S(e.GenericSelectorField,{label:"Account Type",options:IR,disabled:!i})}),u&&R(N,{children:[S("div",{className:AR,children:S(qu,{alignment:"horizontal"})}),S(CR,{bankAccount:t,showStartDate:d})]})]})]})})})}function RR({model:e,setFilters:t,pendingFilters:n,setPendingFilters:r,filters:o}){const a=n.get(e.key)??Xy,i=e.selectedValues(o).length,l=Jy({modelName:e.name,numActiveFilters:i>0?1:0,pending:a});return R(js,{children:[S(_s,{children:e=>S(ox,{popupTriggerChildrenProps:e,text:l,RightIcon:qi})}),e.ModalComponent&&S(e.ModalComponent,{model:e,setFilters:t,pendingFilters:a,setPendingFilters:t=>{r(n=>Gy(n,e.key,t))},filters:o})]})}const PR=Wi(Eg,"Bank");function DR({value:e,handleClick:t,isActive:n,modelKey:r,singleSelect:o}){const a="bankAccount"===r,i=a?e.iconUrl:void 0,l=a&&Zn(i)?PR:void 0,s=o?void 0:n?of:void 0,c=o?S(UT,{isSelected:n}):void 0;return S(ox,{text:e.name,handleClick:t,RightIcon:s,rightElement:c,LeftIcon:l,rightIconSize:"lg-ish",leftIconSize:"lg",iconUrl:a?i:void 0})}function LR({values:e,model:t,filters:n,pendingFilters:r,onClick:o}){return R(Ax,{children:[S(Ho,{children:"Filter by"}),S("div",{children:e.length>0?e.map((e,a)=>{const l=r.get(t.key)??Xy,s=function(e,t,n){const r=[...t,...n.toApply].some(t=>i(t.value,e.value)),o=n.toRemove.some(t=>i(t.value,e.value));return r&&!o}(e,n,l);return S(DR,{handleClick:()=>o(e),value:e,isActive:s,modelKey:t.key,singleSelect:t.singleSelect},`${e.name}_${a}`)}):S(Fx,{showSearchCTA:!1,pluralNounNotFound:"results",singularSearchCTANoun:""})})]})}function MR({values:e,model:t,filters:n,pendingFilters:r,onClick:o,searchTerm:a}){const i=m(()=>new Ce(e,wp),[e]),l=m(()=>i.search(a).map(e=>e.item),[i,a]);return S(LR,{values:l,model:t,filters:n,pendingFilters:r,onClick:o})}function OR({values:e,model:t,filters:n,pendingFilters:r,onClick:o}){return S(Jx,{placeholder:`Search ${t.name.toLowerCase()}...`,SearchList:MR,DefaultList:LR,listLength:e.length,onClick:o,extraProps:{values:e,model:t,filters:n,pendingFilters:r}})}const FR=An({padding:"16px",flex:"1 1 0",overflowY:"auto"});function BR({filters:e,filterModels:t,setFilters:n}){const r=Fl().length>1,o=jf(),[a,i]=y(/* @__PURE__ */new Map);return S(jE,{children:R(_E,{children:[S(dx,{children:R(lx,{children:[S(px,r?{Icon:Hi}:{}),S(Ss,{children:"Back"})]})}),S("div",{className:FR,children:R(Ax,{children:[S(Ho,{children:"Filter by"}),S("div",{children:t.filter(e=>o||!o&&!e.hideInFilterListOnDesktop).map(t=>{const r=t.possibleValues?t.possibleValues():null;return Zn(r)?S(RR,{model:t,setFilters:n,pendingFilters:a,setPendingFilters:i,filters:e},t.key):S(UR,{model:t,filters:e,pendingFilters:a,setPendingFilters:i,setFilters:n},t.key)})})]})}),S(_x,{onClearAll:()=>{let n=/* @__PURE__ */new Map;t.forEach(t=>{const r=t.selectedValues(e);r.length>0&&(n=Gy(n,t.key,Qy(r)))}),i(n)},onApply:()=>{const{toApply:t,toRemove:r}=function(e){const t=[],n=[];return e.forEach(e=>{t.push(...e.toApply),n.push(...e.toRemove)}),{toApply:t,toRemove:n}}(a),o=$y(e,t,r);n(o),i(/* @__PURE__ */new Map),Ol()}})]})})}function UR({model:e,filters:t,pendingFilters:n,setPendingFilters:r,setFilters:o}){if(void 0===e.possibleValues)return;const{values:a,isFilling:i}=e.possibleValues();if(Zn(a)||!je(a))return;const l=n.get(e.key)??Xy,s=e.selectedValues(t).length,c=Jy({modelName:e.name,numActiveFilters:Xn(e.SimpleListComponent)?0:s,pending:l});return i?S(Rx,{}):R(js,{children:[S(_s,{children:e=>S(ox,{text:c,popupTriggerChildrenProps:e,RightIcon:qi})}),S(VR,{values:a,model:e,filters:t,pendingFilters:n,setPendingFilters:r,setFilters:o})]})}function VR({values:e,model:t,filters:n,pendingFilters:r,setPendingFilters:o,setFilters:a}){const l=zs(),s=e=>{const a=r.get(t.key)??Xy,l=t.selectedValues(n),s=t.singleSelect?function(e,t,n){if(t.some(t=>i(t.value,e.value)))return Xy;const r=t.map(e=>({name:e.name,value:e.value}));return{toApply:[n(e)],toRemove:r}}(e,l,t.createFilter):function(e,t,n,r){const o=t.toApply.some(t=>i(t.value,e.value)),a=n.some(t=>i(t.value,e.value)),l=t.toRemove.some(t=>i(t.value,e.value));return o?{...t,toApply:t.toApply.filter(t=>!i(t.value,e.value))}:l?{...t,toRemove:t.toRemove.filter(t=>!i(t.value,e.value))}:a?{...t,toRemove:[...t.toRemove,e]}:{...t,toApply:[...t.toApply,r(e)]}}(e,a,n,t.createFilter);o(e=>Gy(e,t.key,s))};return t.SimpleListComponent?S(Tx,{title:"Back",children:S(t.SimpleListComponent,{filters:n,pendingFilters:r,onToggle:s,model:t,setPendingFilters:o,setFilters:a})}):S(Tx,{title:"Back",Footer:S(_x,{onClearAll:()=>{const e=t.selectedValues(n);o(n=>Gy(n,t.key,Qy(e)))},onApply:()=>{const e=r.get(t.key);if(!e)return;const i=$y(n,e.toApply,e.toRemove);a(i),o(e=>function(e,t){const n=new Map(e);return n.delete(t),n}(e,t.key)),l.close()}}),children:t.NestedListComponent?S(t.NestedListComponent,{filters:n,pendingFilters:r,onToggle:s,model:t,setPendingFilters:o,setFilters:a}):S(OR,{values:e,model:t,filters:n,pendingFilters:r,onClick:s})})}function WR(){const{filters:e,filterPopupModels:t,setFilters:n}=tk();return S(BR,{filters:e,filterModels:t,setFilters:n})}function HR(){return R(UE,{children:[S(WE,{name:"BankTransactionFormRouter",Component:fN}),S(WE,{name:"Conversation",Component:EN}),S(WE,{name:"MobileConversation",Component:DN}),S(WE,{name:"FinancialSummary",Component:qN}),S(WE,{name:"BanksAndIntegrations",Component:jN}),S(WE,{name:"BankAccountForm",Component:NR}),S(WE,{name:"NewConnection",Component:LN}),S(WE,{name:"TransactionFilterList",Component:WR})]})}const qR=({environment:e,children:t})=>S(or.Provider,{value:e,children:t});function jR({children:e}){const{query:{data:t}}=dT(),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?ui({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName,clientId:t?.clientId,unitIntegrationBankName:t?.unitIntegrationBankName??null,supportedIntegrations:t?.supportedIntegrations??[]};return S(mc.Provider,{value:n,children:e})}const zR=e=>["whiteLabels",e??{}],_R=async e=>{const t=e.queryKey,n={path:"/v6/whiteLabels/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:Ua(t[3].environment)},r=await eo(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function KR({children:e}){const t=lT(),{query:{data:n}}=Za({queryKey:zR({filter:{name:{equal:t}}}),queryFn:_R}),r={icons:n?.data?.[0]?.icons};return S(Ui.Provider,{value:r,children:e})}const YR=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const ZR="SSE connection failed with status";function XR({companyId:e,customerPartnerId:t,sseTypes:n}){const r=ar();T(()=>{if(!t)return;const o=new AbortController,a=function(e,t,n,r){const o=new URL(`${a=e,ao[a]}/sse/v1/subscribe`);var a;return o.searchParams.append("customerPartnerId",n),t.forEach(e=>o.searchParams.append("events",e)),r&&o.searchParams.append("companyId",r),o.toString()}(r,n,t,e);let i=0;return Ne(a,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${ZR} ${e.status}`)}(e),onmessage:o=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:o,companyId:a}){switch(e){case YR.CONNECTED:return void jr("SSE connection established",{env:n,customerPartnerId:o,companyId:a,sseTypes:JSON.stringify(Array.from(r))});case YR.ERROR:throw zr({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case YR.CACHE_BUST:return jr("cache bust event received",{sseTypes:JSON.stringify(Array.from(r))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{rr.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>zr({error:e,severity:"error"}))},500*Math.random()),jr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void zr({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:o.event,data:o.data,env:r,sseTypes:n,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw zr({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(ZR))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:o.signal}).catch(e=>zr({error:e,severity:"error"})),()=>o.abort("Closing SSE connection")},[r,t,e,n])}const QR=[YR.CACHE_BUST];function GR({children:e}){const{companyId:t,customerPartnerId:n}=b(mc);return XR({companyId:t,customerPartnerId:n,sseTypes:QR}),e}const JR=v({dimensions:{width:null,height:null}}),$R="undefined"!=typeof window?E:T,eP="undefined"==typeof window;const tP=({children:e})=>{const{width:t,height:n}=function(e={}){let{initializeWithValue:t=!0}=e;eP&&(t=!1);const[n,r]=y(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),o=rk(r,e.debounceDelay,{leading:!0});function a(){(e.debounceDelay?o:r)({width:window.innerWidth,height:window.innerHeight})}return function(e,t,n,r){const o=g(t);$R(()=>{o.current=t},[t]),T(()=>{const t=window;if(!t||!t.addEventListener)return;const n=e=>{o.current(e)};return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}},[e,void 0,r])}("resize",a),$R(()=>{a()},[]),n}({debounceDelay:150}),r={dimensions:{width:t,height:n}};return S(JR.Provider,{value:r,children:e})},nP=({children:e})=>{const{dimensions:t}=b(JR),n=Xn(t.width)&&t.width<parseInt(_o("sizes.breakpoint-xl"));return S(qf.Provider,{value:n,children:e})};function rP({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return T(()=>{var e,r;e=n,r=t,Ur.setProperties(Hr),Wr=r,Vr=e},[n,t]),S(qR,{environment:t,children:S(DE,{children:S($n.Provider,{value:r,children:S(jR,{children:S(KR,{children:S(GR,{children:S(tP,{children:R(nP,{children:[S(fe.ConfirmationRoot,{}),e,S(HR,{})]})})})})})})})})}export{NE as BanksAndIntegrations,Yy as BusinessOwnerDashboard,rP as Tight,vC as TransactionsDashboard,Zt as useOptions};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|