@tight-embedded/react 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -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*as d from"zod";import{z as u}from"zod";import*as h from"react";import{useRef as p,useMemo as g,createContext as m,useContext as v,Component as b,useState as f,useCallback as y,useEffect as k,createElement as x,forwardRef as T,useReducer as w,useLayoutEffect as C,useImperativeHandle as A}from"react";import{jsx as E,Fragment as I,jsxs as S}from"react/jsx-runtime";import{QueryClient as N,useIsRestoring as P,useQuery as R,keepPreviousData as D,useMutation as M}from"@tanstack/react-query";import O from"yocto-queue";import L from"big.js";import{ResponsiveContainer as B,BarChart as F,Legend as U,CartesianGrid as W,XAxis as V,YAxis as H,Tooltip as q,Bar as j,ReferenceLine as z,Line as K}from"recharts";import{flexRender as Y,createColumnHelper as _,useReactTable as G,getCoreRowModel as Z,getExpandedRowModel as Q}from"@tanstack/react-table";import{useFloatingNodeId as X,useFloating as J,offset as $,flip as ee,shift as te,size as ne,autoUpdate as re,useClick as ae,useDismiss as oe,useRole as ie,useInteractions as le,useFloatingParentNodeId as se,FloatingTree as ce,FloatingNode as de,useMergeRefs as ue,FloatingOverlay as he,FloatingPortal as pe,FloatingFocusManager as ge}from"@floating-ui/react";import{ContextAwareConfirmation as me,confirmable as ve}from"react-confirm";import{createFormHookContexts as be,useStore as fe,createFormHook as ye}from"@tanstack/react-form";import{NumericFormat as ke}from"react-number-format";import xe from"fuse.js";import{v4 as Te}from"uuid";import{openDB as we}from"idb";import{PersistQueryClientProvider as Ce}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ae}from"@microsoft/fetch-event-source";function Ee(e,t){return`${e.trim()}:${t.trim()}`}const Ie=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_ATTACH_TO_GLSOURCE:!1,FEATUREFLAG_FREQUENCY_SELECTOR:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,Ee("featureFlags","updateFlags"))});function Se(){return We(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}const Ne="drawerNavigation",Pe=e=>({drawerHistory:[],openDrawer:(t,n={})=>e(e=>{const{replaceHistory:a,routeProps:o}=n,i={[t]:{routeProps:o}};if(a||0===e.drawerHistory.length)return{drawerHistory:[i]};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t}}},void 0,Ee(Ne,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1)}},void 0,Ee(Ne,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[]}),void 0,Ee(Ne,"closeAllDrawers"))}),Re=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Ee("externalOptions","setOptions"))});function De(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Me(e){return e[e.length-1]}const Oe="transactionsDashFilters",Le=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:[...e.transactionsDashFilters,...t]}),void 0,Ee(Oe,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:De(e.transactionsDashFilters,t)}),void 0,Ee(Oe,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:t}),void 0,Ee(Oe,"setFilters"))}),Be={label:"Connected Accounts",value:"connected"},Fe="banksAndIntegrationsState",Ue=e=>({banksAndIntegrationsSelectedTab:Be,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Ee(Fe,"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,Ee(Fe,"toggleExpandedIntegration"))}),We=e()(t(n((...e)=>({...Ie(...e),...Pe(...e),...Re(...e),...Le(...e),...Ue(...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})),Ve={SELECT:"select",EXPAND:"expand"},He={...Ve,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},qe=[He.COMMENTS,He.DATE,He.DESCRIPTION,He.AMOUNT,He.CATEGORY,He.CLASS_SEGMENT,He.REVIEW_STATUS],je=d.object({pageSize:d.optional(d.int32().positive()),columns:d.optional(d.array(d.enum(qe)))}),ze=d.optional(d.string().trim()),Ke=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ye=d.optional(d.array(d.string().trim())),_e=d.object({integrations:d.optional(d.array(d.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"])))}),Ge={transactionsDashboard:e=>{const t=je.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=ze.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Ye.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>Ke.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=_e.safeParse(e);return t.success?t.data:void 0}},Ze=(e,t)=>{if(void 0!==Ge[e])return(0,Ge[e])(t)};function Qe(e){const t=p(!1),n=We(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of a(e)){const e=Ze(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const o=We(e=>e.externalOptions);return{options:g(()=>r(o),[o]),setOptions:n}}function Xe(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function Je(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function $e(e){return String.fromCharCode(e+(e>25?39:97))}function et(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=$e(t%52)+n;return $e(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var tt=/\s*!(important)?/i;function nt(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var rt=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}},at=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function ot(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(at.has(n))return;const r=e[n],a=t[n];Xe(r)&&Xe(a)?e[n]=ot(r,a):e[n]=a}),e):e,{})}var it=e=>null!=e;function lt(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);it(u)&&(i[c]=u)}return i}var i;return t(n,o)}(e)}function st(e,t,n=!0){const{utility:r,conditions:a}=t,{hasShorthand:o,resolveShorthand:i}=r;return lt(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 ct={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},dt=/([A-Z])/g,ut=/^ms-/,ht=rt(e=>e.startsWith("--")?e:e.replace(dt,"-$1").replace(ut,"-ms-").toLowerCase()),pt=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),gt=`(?:${"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("|")})`,mt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${gt}$`),vt={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):Xe(e)?lt(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&pt.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&mt.test(e)},bt=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,Je(t))};const ft=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(",")),yt=/^@|&|&$/;function kt(e){return ft.has(e)||yt.test(e)}const xt=/^_/,Tt=/&|@/,wt=/* @__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(":");wt.set(t,n)});const Ct={conditions:{shift:function(e){return e.sort((e,t)=>{const n=kt(e),r=kt(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>ft.has(e)?e.replace(xt,""):Tt.test(e)?`[${nt(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${wt.get(e)||ht(e)}_${nt(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},At=function(e){const{utility:t,hash:n,conditions:r=ct}=e,a=e=>[t.prefix,e].filter(Boolean).join("-");return rt(({base:o,...i}={})=>{const l=st(Object.assign(i,o),e),s=/* @__PURE__ */new Set;return lt(l,(e,o)=>{if(null==e)return;const i="string"==typeof(u=e)&&tt.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(tt,"").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,et))}else i=[...r.finalize(e),a(o)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(Ct),Et=(...e)=>At(It(...e));Et.raw=(...e)=>It(...e);const{mergeCss:It}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>Xe(e)&&Object.keys(Je(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>st(t,e))}return{mergeCss:rt(function(...e){return ot(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(Ct);function St(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Nt=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Pt(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:a}=Nt(e),o=e=>({...r,...Je(e)});function i(e={}){const r=o(e);let i={...t};for(const[t,a]of Object.entries(r))n[t]?.[a]&&(i=It(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=It(n,e.css))}),n}(a,r);return It(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(rt(function(e){return Et(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const o=Nt(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 Pt({base:It(t,o.base),variants:Object.fromEntries(i.map(e=>[e,It(n[e],o.variants[e])])),defaultVariants:ot(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 Rt,Dt=((Rt=Dt||{}).component="component",Rt["dashboard-placeholder-table"]="dashboard-placeholder-table",Rt["dashboard-header"]="dashboard-header",Rt["dashboard-table"]="dashboard-table",Rt["dashboard-table-body"]="dashboard-table-body",Rt["dashboard-table-cell"]="dashboard-table-cell",Rt["dashboard-table-column-header"]="dashboard-table-column-header",Rt["dashboard-table-header"]="dashboard-table-header",Rt.label="label",Rt.popup="popup",Rt["popup-sort-row"]="popup-sort-row",Rt["progress-bar"]="progress-bar",Rt["progress-bar-fill"]="progress-bar-fill",Rt.summation="summation",Rt["table-parent-row"]="table-parent-row",Rt["table-row"]="table-row",Rt["table-sub-row"]="table-sub-row",Rt.tile="tile",Rt["tile-bar-label"]="tile-bar-label",Rt["tile-body"]="tile-body",Rt["tile-filter-button"]="tile-filter-button",Rt["tile-filter-list"]="tile-filter-list",Rt["tile-filter-row"]="tile-filter-row",Rt["tile-header"]="tile-header",Rt["tile-title"]="tile-title",Rt.title="title",Rt["business-owner-dashboard"]="business-owner-dashboard",Rt["business-owner-dashboard-header"]="business-owner-dashboard-header",Rt["business-owner-table"]="business-owner-table",Rt["transaction-type-label"]="transaction-type-label",Rt["selector-row"]="selector-row",Rt["popup-list"]="popup-list",Rt.badge="badge",Rt["date-cell"]="date-cell",Rt["expander-cell"]="expander-cell",Rt["vertical-divider"]="vertical-divider",Rt["horizontal-divider"]="horizontal-divider",Rt["table-cell-divider"]="table-cell-divider",Rt["checkbox-input"]="checkbox-input",Rt["bulk-select"]="bulk-select",Rt["button-base"]="button-base",Rt["button-discrete-small"]="button-discrete-small",Rt["button-primary"]="button-primary",Rt["button-secondary"]="button-secondary",Rt["button-tertiary"]="button-tertiary",Rt["button-danger"]="button-danger",Rt["button-warning"]="button-warning",Rt["button-action"]="button-action",Rt.text="text",Rt["cell-button"]="cell-button",Rt["month-picker-left-button"]="month-picker-left-button",Rt["month-picker-right-button"]="month-picker-right-button",Rt["filter-bar"]="filter-bar",Rt["filter-search-bar"]="filter-search-bar",Rt["filter-pill"]="filter-pill",Rt["discrete-form-input"]="discrete-form-input",Rt["editable-form-input"]="editable-form-input",Rt["category-text"]="category-text",Rt["amount-input-container"]="amount-input-container",Rt["amount-input"]="amount-input",Rt["modal-popup"]="modal-popup",Rt["drawer-header"]="drawer-header",Rt["drawer-header-border"]="drawer-header-border",Rt["form-body"]="form-body",Rt.body="body",Rt.heading="heading",Rt["sub-label"]="sub-label",Rt["strong-label"]="strong-label",Rt["strong-sub-label"]="strong-sub-label",Rt["metric-xl"]="metric-xl",Rt["metric-md"]="metric-md",Rt["large-icon"]="large-icon",Rt["medium-icon"]="medium-icon",Rt["small-icon"]="small-icon",Rt["tiny-icon"]="tiny-icon",Rt["neutral-badge"]="neutral-badge",Rt["highlight-badge"]="highlight-badge",Rt["success-badge"]="success-badge",Rt["warning-badge"]="warning-badge",Rt["critical-badge"]="critical-badge",Rt["button-group"]="button-group",Rt["alert-dialog"]="alert-dialog",Rt["alert-header"]="alert-header",Rt["emphasis-label"]="emphasis-label",Rt["profit-loss-graph"]="profit-loss-graph",Rt.banner="banner",Rt["banner-high"]="banner-high",Rt["banner-medium"]="banner-medium",Rt["banner-low"]="banner-low",Rt["banner-urgent"]="banner-urgent",Rt["banner-default"]="banner-default",Rt["banner-button"]="banner-button",Rt["banner-button-text"]="banner-button-text",Rt["banner-button-icon"]="banner-button-icon",Rt["empty-dashboard-layout"]="empty-dashboard-layout",Rt["zero-state-layout"]="zero-state-layout",Rt["emphasis-sub-label"]="emphasis-sub-label",Rt);const Mt="Tight-",Ot=e=>`${Mt}${e}`;function Lt(e){return e in Dt}function Bt(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Mt&&r in Dt}function Ft(e){return!Lt(e)&&!Bt(e)}const Ut=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Ot(e)),t.forEach(e=>{void 0!==e&&(Ft(e)?r.push(e):Lt(e)&&n.push(Ot(e)))}),{className:St(...n,...r)}},Wt=Ut(Dt["business-owner-dashboard-header"],Et({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80}));function Vt({children:e}){return E("div",{...Wt,children:e})}function Ht(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Bt(t)&&e.push(t),e),[])],[])}function qt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Ft(t)&&e.push(t),e),[])],[])}function jt(e){const t=Array.isArray(e)?e:[e];return{className:St(...Ht(t),...qt(t))}}const zt=Pt({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{sm:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:"heading",fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),Kt=Ut(Dt.heading,zt({heading:"default"}));function Yt({children:e,stylists:t=[]}){const n=jt([Kt,...t]);return E("div",{...n,children:e})}function _t(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Gt(e,t,n){return new Date(e,t,n)}function Zt(e,t){return _t(Gt(t,e,1))}const Qt={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},Xt=e=>{switch(e){case Qt.THIS_YEAR:return _t(Gt(/* @__PURE__ */(new Date).getFullYear(),0,1));case Qt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Zt(e.getMonth(),e.getFullYear())}();case Qt.LAST_YEAR:return _t(Gt(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case Qt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return _t(Gt(e.getFullYear(),e.getMonth()-1,1))}();case Qt.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return _t(Gt(e.getFullYear()-1,e.getMonth(),1))}();default:return""}},Jt=e=>{switch(e){case Qt.THIS_YEAR:return _t(Gt(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case Qt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return _t(Gt(e.getFullYear(),e.getMonth()+1,0))}();case Qt.LAST_YEAR:return _t(Gt(/* @__PURE__ */(new Date).getFullYear(),0,0));case Qt.PAST_YEAR:case Qt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return _t(Gt(e.getFullYear(),e.getMonth(),0))}();default:return""}},$t=e=>{return t=e,Object.values(Qt).includes(t)?{beginDate:Xt(e),endDate:Jt(e)}:{beginDate:_t((n=e).beginDate),endDate:_t(n.endDate)};var t,n},en=["SUN","MON","TUE","WED","THU","FRI","SAT"],tn=["January","February","March","April","May","June","July","August","September","October","November","December"];function nn({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 rn(e,t){return e.toDateString()===t.toDateString()}function an(e){return rn(e,/* @__PURE__ */new Date)}function on(e,t){const n=Gt(e.getFullYear(),e.getMonth(),e.getDate()),r=Gt(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function ln(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 sn(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=Gt(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 sn(o,i,l)?Gt(l,o-1,i):null}function dn(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 sn(i,l,o)?Gt(o,i-1,l):null}function un(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:null}function hn(e,t){return on(e,t)?t:e}function pn(e,t){return on(t,e)?t:e}const gn=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",n)},mn=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return an(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):gn(t,{abbreviateMonth:!0,abbreviateYear:!1})},vn=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function bn(e,t,n){return[...e,{accessToken:t,environment:n}]}function fn(e,t){return[...e,t]}const yn=e=>null==e,kn=e=>!yn(e);function xn(e){return""===e.trim()}function Tn(e){return yn(e)||xn(e)}function wn(e){return!Tn(e)}const Cn=m({activeToken:void 0,accountantToken:void 0});function An(){const{activeToken:e}=v(Cn);return e}const En=()=>{throw new Error("No access token provided")},In=72e5,Sn=new N({defaultOptions:{queries:{gcTime:In,staleTime:3e4,refetchInterval:6e4}}}),Nn=m("SANDBOX");function Pn(){return v(Nn)}function Rn({queryKey:e,queryFn:t,...n}){const r=An(),a=Pn(),o=wn(r),i=bn(e,r??"",a),l=P(),s=R({...n,queryKey:i,queryFn:o?t:En,placeholderData:n.keepPreviousDataPlaceholder?D:void 0,...o?{}:{retry:!1,staleTime:1/0}},Sn);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class Dn{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 Mn=Symbol("Circular"),On=Symbol("AccessError");function Ln(e,t,n){return Bn({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function Bn({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=Mn),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Fn(()=>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=Fn(()=>s[i]);e.push(Bn({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=Fn(()=>s[c]);e[c]=Bn({key:c,value:d,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function Fn(e){try{return e()}catch{return On}}const Un=Object.prototype.toString,Wn=Object.getPrototypeOf;function Vn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Hn=/^\s*at .*(\S+:\d+|\(native\))/m,qn=/^(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 zn(e,t){const n=Kn(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&Vn(n.metadata)&&(r={...r,[n.name]:n.metadata});const a=[Yn(n)];return a.push(...Zn(n).map(e=>Yn(e,{backtrace:!1}))),{exceptions:a,metadata:r}}function Kn(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===Un.call(t))return!0;t=Wn(t)}return!1}(e))return e;let n=function(e){if(!Vn(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 Yn(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:_n(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function _n(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(Hn)?e.split("\n").filter(e=>!!e.match(Hn)).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(qn)).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<Gn;){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 Gn=20;function Zn(e){const t=e;if(t.cause){const e=Kn(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Zn(e))}return[]}function Qn(...e){console.log}function Xn(...e){console.error}const Jn={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 $n=Date.now();const er=()=>{$n=Date.now()},tr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-$n,!0}),{reset:er})},nr=[["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\)$/]],rr=[["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/]],ar=(or=function(e){const t=""!==(n=e)&&nr.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 rr)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,...or(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 or;class ir{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 lr 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}=zn(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 E(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return E(I,{children:this.props.children})}}const sr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>E(lr,{client:e,onError:t,FallbackComponent:n,children:r})})},cr=new class{breadcrumbs=[];config;delivery=new Dn(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return Xn(),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}=zn(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=Ln(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){Xn()}}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 dr="",ur="";const hr="prod",pr=cr.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"1.3.1",appType:"browser",releaseStage:hr,plugins:[tr,ar,Jn,(()=>{const e=new ir(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),sr]}),gr=(e,t)=>{try{cr.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?mr({error:n,severity:"error"}):mr({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},mr=async e=>{try{await cr.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:dr,environment:ur}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await mr({error:t,severity:"error"}):await mr({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},vr=pr.getPlugin("react"),br=vr?.BugsnagErrorBoundary,fr=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,yr=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},kr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},xr={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function Tr(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?xr:{}}});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 wr({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:a,url:o}){const i=yr({extraHeaders:t,authorization:e});gr("HTTP POST Request",{url:o,accessToken:e});try{const e=await fetch(o,{method:r,headers:i,credentials:"include",body:JSON.stringify(a)});return gr("HTTP POST Response",{url:o,status:e.status,statusText:e.statusText}),kr(e)}catch(l){return Promise.reject(l)}}async function Cr(e){const{url:t,headers:n}=Tr(e);return wr({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function Ar(e){return Cr(e)}async function Er(e){return Cr(e)}const Ir=(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}),Sr={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},Nr={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Pr={...Nr,LOCAL:"http://localhost:8082"};function Rr(e){return Ir(`${t=e,Sr[t]}/v5`,"v5");var t}const Dr=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],Mr=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,a=t[2].environment,o={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...$t(n.filter),...n.grouping&&{grouping:n.grouping}},accessToken:r,endpointManager:Rr(a)};return await Er(o)};function Or({filter:e,grouping:t,select:n}){return Rn({queryKey:Dr({filter:e,grouping:t}),queryFn:Mr,select:n})}const Lr="noDataHeight";function Br(e){const t=function(e){const t=dn(e??"");return null!==t?gn(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}(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?L(t).minus(r).toNumber():0,loss:a,remainingExpenses:void 0!==n?L(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 Fr(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(yn(n))return t;for(const i of n){const{month:e,netIncome:n}=Br(i);t.total=L(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 Ur=Ut(Dt["tile-header"],Et({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Wr({title:e}){return E("div",{...Ur,children:E(Yt,{children:e})})}const Vr=Ut(Dt["tile-body"],Et({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderBottomRadius:"lg",borderTop:"hidden"}));function Hr({children:e}){return E("div",{...Vr,children:e})}const qr=Pt({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function jr({children:e,type:t,isSample:n=!1}){const r=Ut(Dt.tile,qr({type:t,isSample:n}));return E("div",{...r,children:e})}const zr=Et({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),Kr=Et.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),Yr=Et({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),_r=Ut(Dt.text,Et({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr);function Gr({children:e}){return E("div",{..._r,children:e})}const Zr=Ut(Dt["metric-xl"],zt({metric:"xl"}));function Qr(e){return E("div",{...Zr,children:e.children})}const Xr=Ut(Dt.summation,Et({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function Jr({title:e,label:t}){return S("div",{...Xr,children:[E(Qr,{children:e}),E(Gr,{children:t})]})}const $r=Ut(null,Et({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function ea({children:e}){return E("div",{...$r,children:e})}const ta=(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},na=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),ra=1e9;function aa(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<ra&&c>=1e3&&(c/=1e3),r>=ra?a="B":r>=1e6?a="M":(c=Math.round(c),a="K"),i=`${na(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=ta(o,a)):"always"===t?(a=n,l=n,e=ta(o,a)):"default"===t&&Math.abs(o)>=1e3?(a=r,l=r,e=ta(o,a)):(a=n,e=ta(o,a),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=na(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 oa(e){return aa(e,{condense:!0,dollarSign:!0})}function ia(e){return aa(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const la={"sm-sm":Ut(Dt.text,Et({fontSize:{sm:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr),"sm-med":Ut(Dt.text,Et({fontSize:{sm:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr),"sm-lg":Ut(Dt.text,Et({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr),"med-sm":Ut(Dt.text,Et({fontSize:{sm:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr),"med-med":Ut(Dt.text,Et({fontSize:{sm:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr),"med-lg":Ut(Dt.text,Et({fontSize:{sm:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),zr)};function sa({children:e,size:t,weight:n,stylists:r=[]}){const a=jt([la[`${t}-${n}`],...r]);return E("div",{title:e,...a,children:e})}const ca=Pt({variants:{wrap:{ellipsis:Kr,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function da({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(Tn(n))return null;const a=Ut(Dt["strong-label"],zt({label:"strongLabel"}),ca({wrap:e,textAlign:t}));return E(sa,{size:"med",weight:"med",stylists:[a,...r],children:n})}const ua=Pt({base:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px",fontStyle:"normal"},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:Kr,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}}}});function ha({intent:e,wrap:t="ellipsis",children:n,accent:r}){const a=void 0===e&&void 0===r?"normal":void 0,o=Ut(Dt["sub-label"],ua({intent:a,wrap:t,accent:r}),zr);return Tn(n)?null:E("div",{...o,children:n})}const pa=Ut(null,Et({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 ga({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===Lr)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),S("div",{...pa,children:[E(da,{children:t[0].name??""}),E(ha,{children:oa(Number(n))})]})}const ma={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"11px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"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:"0.3s ease-out both slide-in-right",variable:"var(--Tight-animations-slideIn-right)"},"animations.slideIn.up":{value:"0.3s ease-out both slide-in-up",variable:"var(--Tight-animations-slideIn-up)"},"animations.slideOut.right":{value:"0.3s ease-in both slide-out-right",variable:"var(--Tight-animations-slideOut-right)"},"animations.slideOut.down":{value:"0.3s ease-in both slide-out-down",variable:"var(--Tight-animations-slideOut-down)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(24, 36, 40, 0.10)",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discrete":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discrete)"},"colors.surface.intent.action.discrete.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discrete-hover)"},"colors.surface.intent.action.discrete.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discrete-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-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-strong)",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-green500)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.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.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discrete":{value:"var(--Tight-colors-colorPalette-intent-action-discrete)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete)"},"colors.colorPalette.action.discrete":{value:"var(--Tight-colors-colorPalette-action-discrete)",variable:"var(--Tight-colors-colorPalette-action-discrete)"},"colors.colorPalette.discrete":{value:"var(--Tight-colors-colorPalette-discrete)",variable:"var(--Tight-colors-colorPalette-discrete)"},"colors.colorPalette.intent.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)"},"colors.colorPalette.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-action-discrete-hover)"},"colors.colorPalette.discrete.hover":{value:"var(--Tight-colors-colorPalette-discrete-hover)",variable:"var(--Tight-colors-colorPalette-discrete-hover)"},"colors.colorPalette.intent.action.discrete.active":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-active)"},"colors.colorPalette.action.discrete.active":{value:"var(--Tight-colors-colorPalette-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-action-discrete-active)"},"colors.colorPalette.discrete.active":{value:"var(--Tight-colors-colorPalette-discrete-active)",variable:"var(--Tight-colors-colorPalette-discrete-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.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.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)"}};function va(e,t){return ma[e]?.value||t}va.var=function(e,t){return ma[e]?.variable||t};const ba=Ut(null,Et({borderRadius:"50%",flexShrink:0})),fa=Ut(null,Et({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),ya=va.var("colors.surface.foreground.disabled");function ka({color:e=ya,diameter:t=17,label:n}){return S("div",{...fa,"data-testid":"bullet-row",children:[E("div",{...ba,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&E(ha,{children:n})]})}const xa=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function Ta({payload:e}){return void 0===e?null:E("div",{...xa,children:e.map((e,t)=>"none"!==e.type&&E(ka,{color:e.color,label:e.value,diameter:17},t))})}const wa={right:20,left:20},Ca=["income","profit","expenses","loss"],Aa=e=>Ca.findIndex(t=>t===e.dataKey),Ea={paddingBottom:"20px",marginLeft:"-20px"},Ia={stackId:"stack",isAnimationActive:!1},Sa=Ut(Dt["profit-loss-graph"],Et({"& .recharts-surface":{outline:"none"}})),Na=va.var("colors.money"),Pa=va.var("colors.border.layout"),Ra=va.var("colors.border.layout.strong"),Da={fill:va.var("colors.typography.base"),fontSize:va.var("fontSizes.metric.sm")},Ma={profit:va.var("colors.money.positive"),income:va.var("colors.money.positive.weak"),loss:va.var("colors.money.negative"),expenses:va.var("colors.money.negative.weak")},Oa=[0,100],La=["auto","auto"];function Ba({data:e}){const[t,n]=f(!0);if(void 0===e)return null;const r=e.hasAnyData?La:Oa;return E(B,{width:"100%",height:"100%",...Sa,children:S(F,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:wa,children:[E(U,{verticalAlign:"top",itemSorter:Aa,wrapperStyle:Ea,content:({payload:e})=>E(Ta,{payload:e})}),E(W,{strokeDasharray:"0",vertical:!1,stroke:Pa}),E(V,{dataKey:"month",interval:0,tickLine:!1,stroke:Pa,tick:Da}),E(H,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:Pa,tick:Da,tickFormatter:e=>oa(e)}),E(q,{content:({active:e,payload:t})=>E(ga,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),E(j,{name:"Profit",dataKey:"profit",fill:Ma.profit,...Ia}),E(j,{name:"Income",dataKey:"income",fill:Ma.income,...Ia}),E(j,{name:"Loss",dataKey:"loss",fill:Ma.loss,...Ia}),E(j,{name:"Expenses",dataKey:"expenses",fill:Ma.expenses,...Ia}),E(j,{dataKey:Lr,fill:Pa,legendType:"none",...Ia}),E(z,{y:0,stroke:Ra}),E(K,{dataKey:"netIncome",fill:Na,stroke:Na,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const Fa=Et({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 Ua({styles:e}){const t=Ut(null,Fa,e);return E("div",{...t,"data-testid":"shimmer-block"})}const Wa=Et({width:"40%",minHeight:65});function Va({children:e}){return S(I,{children:[E(Ua,{styles:Wa}),E(ea,{children:e})]})}const Ha=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),qa=Et({width:"80px",height:"17px",marginBottom:"10px"}),ja=Et({width:"100%",height:"100%"});function za(){return S(I,{children:[S("div",{...Ha,children:[E(Ua,{styles:qa}),E(Ua,{styles:qa}),E(Ua,{styles:qa}),E(Ua,{styles:qa})]}),E(Ua,{styles:ja})]})}const Ka=Pt({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 Ya({size:e}){const t=Ka({size:e});return E("div",{className:t,children:"Sample"})}const _a=20200,Ga=5043,Za=Object.freeze({income:_a,expenses:Ga,netIncome:15157,absoluteSum:Math.abs(_a)+Math.abs(Ga)}),Qa=Object.freeze({total:Ga,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),Xa=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),Ja=[{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 $a({filter:e=Qt.PAST_YEAR,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return Or({filter:e,grouping:t,select:Fr})}({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=gn(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=Ja[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 S(jr,{type:"chart",children:[E(Wr,{title:"Profit + Loss"}),E(Hr,{children:r?E(Va,{children:E(za,{})}):S(I,{children:[E(Jr,{title:oa(a?.total??0),label:"Profit"}),E(ea,{children:E(Ba,{data:a})})]})}),t&&E(Ya,{size:"xl"})]})}const eo=Ut(null,Et({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}));function to({children:e}){return E("div",{...eo,children:e})}const no="conversations-section",ro="transactions-section",ao={MESSAGE_REVIEW:no,TRANSACTION_REVIEW:ro,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},oo={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},io={resolutionStatus:{in:["OPEN"]}},lo=[],so=[];function co(e){return Ir(`${t=e,Nr[t]}`,"v6");var t}const uo={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"},ho=e=>["tasks",e??{}],po={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},go=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:co(t[2].environment)},a=await Ar(r);return"SUCCESS"===a.result&&void 0!==a.data?{data:a.data}:{data:void 0}},mo=Pt({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 vo(e,t){const n=({size:t=24,fill:n="transparent",stylists:r})=>{const a=jt([Ut(null,mo()),...r]);return E(e,{...a,style:{minHeight:t,minWidth:t},width:t,height:t,fill:n})};return n.displayName=t,n}const bo=vo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),fo=vo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"#182428",strokeMiterlimit:10})),"ArrowRight"),yo=Et({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"}}),ko=Et({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),xo=Et({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});Et({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}});const To=Et({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}}),wo=m({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Co({Component:e,stylists:t}){return E(e,{stylists:[Ut(Dt["small-icon"]),...t??[]],size:12})}const Ao=Ut(null,Et({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{sm:"35px",base:"50px"},gap:{sm:0,base:20}})),Eo=Ut(null,Et({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{sm:"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"}}),ko),Io=Ut(null,Et({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center"})),So=Ut(null,Et({height:{sm:"12px",base:"20px"},width:{sm:"12px",base:"20px"}}));function No(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=v(wo);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return S("div",{...Ao,children:[E("div",{...Io,children:E("button",{...Eo,onClick:r,disabled:!t,children:E(Co,{Component:bo,stylists:[So]})})}),E("div",{...Io,children:E("button",{...Eo,onClick:n,disabled:!e,children:E(Co,{Component:fo,stylists:[So]})})})]})}const Po=Et({width:"100%",height:"50px"});function Ro(){return E(Ua,{styles:Po})}const Do=Ut(Dt["dashboard-placeholder-table"],Et({display:"flex",flexDirection:"column",gap:"4px"})),Mo=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Oo=Et({width:"100px",height:"20px"});function Lo({numColumns:e=6}){return S("div",{...Do,children:[E("div",{...Mo,children:Array.from({length:e},(e,t)=>E(Ua,{styles:Oo},t))}),E(Ro,{}),E(Ro,{}),E(Ro,{}),E(Ro,{}),E(Ro,{}),E(Ro,{})]})}function Bo(e,t){const n=An(),r=Pn();return y(a=>{const o=wn(n),i=o?{}:{retry:!1,staleTime:1/0};return Sn.prefetchQuery({queryKey:bn(e(a),n??"",r),queryFn:o?t:En,...i})},[e,t,n,r])}const Fo=Object.freeze({}),Uo=Object.freeze({cursor:"FINAL_PAGE"});function Wo({queryKey:e,queryFn:t,...n}){const[r,a]=f(Fo),o=p(e);i(o.current,e)||(o.current=e,a(Fo));const l=n.select,s=kn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=fn(e,r),d=Rn({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=g(()=>{return e=d.query.data?.cursor,t=a,{getFirstPage:()=>t(Fo),getLastPage:()=>t(Uo),hasNextPage:kn(e?.after),hasPreviousPage:kn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=Bo(y(t=>fn(e,t),[e]),t),m=Bo(y(t=>fn(e,t),[e]),t);return k(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{mr({error:e,severity:"error"})}),e.before&&m({cursor:e.before}).catch(e=>{mr({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,m]),{...d,paginationControls:u}}async function Vo({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:a,cache:o}){const i=yr({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=>fr(e,t)).join("&"):fr(e,t),n}).join("&");var a;return""!==r&&(n+=`?${r}`),n})({url:a,params:r});gr("HTTP GET Request",{url:a,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:o});return gr("HTTP GET Response",{url:a,status:e.status,statusText:e.statusText}),kr(e)}catch(s){return Promise.reject(s)}}async function Ho(e){const{url:t,headers:n}=Tr(e);return Vo({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function qo(e){return Ho({...e,endpointManager:co(e.environment)})}async function jo(e){return Ho({...e,endpointManager:Rr(e.environment)})}function zo({delay:e,callback:t}){const n=g(()=>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 k(()=>()=>{n.cancelCallback()},[n]),{startCallback:y(e=>{n.startCallback(e)},[n]),cancelCallback:y(()=>{n.cancelCallback()},[n])}}function Ko({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=zo({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const Yo={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"},_o={ASC:"ASC",DESC:"DESC"},Go=e=>["conversations",e??{}],Zo=e=>["conversations","conversation",e],Qo=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:co(t[3].environment)},r=await Ar(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Xo(e){return Wo({queryKey:e?Go(e):["conversations",{}],queryFn:Qo})}const Jo=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 qo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null};function $o(e){const t=kn(e);return Rn({queryKey:Zo({id:e??""}),queryFn:Jo,enabled:t})}const ei=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:co(n)};return await Ar(r)};function ti(){return Ko({prefetchFn:Bo(Zo,Jo)})}function ni(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function ri({header:e}){const t=ni(e.column);return E("div",{...Ut(Dt["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:Y(e.column.columnDef.header,e.getContext())})}const ai=Ut(Dt["dashboard-table-header"],Et({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function oi({headerGroups:e}){return E("div",{children:e.map(e=>x("div",{...ai,key:e.id},e.headers.map(e=>E(ri,{header:e},e.id))))})}const ii=Ut(Dt["dashboard-table-body"],Et({display:"flex",flexDirection:"column"}));function li({children:e}){return E("div",{...ii,children:e})}const si=Pt({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 ci({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=Ut("vertical"===e?Dt["vertical-divider"]:Dt["horizontal-divider"],n,si({alignment:e,color:t}));return E("div",{...r})}function di(){return E(ci,{additionalClassName:Dt["table-cell-divider"]})}function ui({cell:e,index:t,onCellClick:n,shouldDisplayDivider:r}){const a=ni(e.column),o=Ut(Dt["dashboard-table-cell"],Et({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Ut(null,Et({display:"flex",flexDirection:"row",height:"100%"})),l=r(t);return S("div",{...i,style:a,onClick:()=>{n&&n(e)},children:[l&&E(di,{}),E("div",{style:a,...o,children:Y(e.column.columnDef.cell,e.getContext())})]})}const hi=Ut(Dt["table-sub-row"],Et({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function pi({rowData:e,onCellClick:t,shouldDisplayDivider:n}){const r=e.getVisibleCells();return E("div",{...hi,children:r.map((e,r)=>E(ui,{cell:e,index:r,onCellClick:t,shouldDisplayDivider:n,isChild:!0},e.id))})}const gi=Et({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),mi=Et({background:"surface.background"}),vi=Ut(Dt["table-row"],Et({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{sm:"60px",base:"85px"},minWidth:"fit-content"}));function bi({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:a}){const o=e.getIsExpanded(),i=Ut(Dt["table-parent-row"],gi,e.index%2==0?mi:void 0),l=e.getVisibleCells();return S("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[E("div",{...vi,children:l.map((e,t)=>E(ui,{cell:e,index:t,onCellClick:r,shouldDisplayDivider:a},e.id))}),o&&E("div",{children:e.subRows.map(e=>E(pi,{rowData:e,onCellClick:r,shouldDisplayDivider:a},e.id))})]})}const fi=(e,t={})=>{We.getState().openDrawer(e,t)},yi=()=>{We.getState().closeDrawer()};function ki({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=bn(e,n,r);return Sn.fetchQuery({queryKey:a,queryFn:t})}function xi({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=bn(e,n,r);return Sn.prefetchQuery({queryKey:a,queryFn:t})}const Ti=[{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"}],wi={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},Ci={ASC:"ASC",DESC:"DESC"},Ai=e=>["banks/transactions",e??{}],Ei=e=>["banks/transactions",e.id],Ii=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:co(t[3].environment)},r=await Ar(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Si(e){return Wo({queryKey:Ai(e),queryFn:Ii})}const Ni=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 qo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Pi({id:e}){return Rn({queryKey:Ei({id:e}),queryFn:Ni})}function Ri(){return Ko({prefetchFn:Bo(Ei,Ni)})}const Di={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 Mi(e,t){return!Tn(e)&&e.startsWith(t)}function Oi({id:e,prefix:t}){return void 0!==e?`${Di[t]}_${e}`:""}function Li(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const Bi=e=>["conversations/messages",e];function Fi(e){if(yn(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 Ui=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 qo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null},Wi=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:co(n),accessToken:t};return await Ar(r)};function Vi(){return Ko({prefetchFn:Bo(Bi,Ui)})}const Hi=e=>["summaries",e??{}],qi=e=>["summaries",e.id],ji=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:co(t[2].environment)},r=await Ar(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const zi=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 qo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Ki({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=ti(),{startPrefetch:a,cancelPrefetch:o}=Vi(),{startPrefetch:i,cancelPrefetch:l}=Ri(),{startPrefetch:s,cancelPrefetch:c}=Ko({prefetchFn:Bo(qi,zi)}),d=y(()=>{kn(e.original.attachedEntityId)&&Mi(e.original.attachedEntityId,Di.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):kn(e.original.attachedEntityId)&&Mi(e.original.attachedEntityId,Di.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(()=>{kn(e.original.attachedEntityId)&&Mi(e.original.attachedEntityId,Di.BANK_TRANSACTION)?l():kn(e.original.attachedEntityId)&&Mi(e.original.attachedEntityId,Di.FINANCIAL_SUMMARY)&&c(),o(),r()},[l,c,r,o,e.original.attachedEntityId]);return E(bi,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?fi("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):kn(t)?Mi(t,Di.BANK_TRANSACTION)?fi("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Mi(t,Di.FINANCIAL_SUMMARY)&&(r=e,a=t,fi("FinancialSummary",{routeProps:{conversationId:r,summaryId:a}})):function(e){fi("Conversation",{routeProps:{conversationId:e}})}(e);var r,a})(e.original.id,e.original.attachedEntityId,t)})}const Yi=vo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),h.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),_i=Et({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}}),Gi=Et({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"}}),Zi=Et({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),Qi=Et({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),Xi=Et.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"}}),Ji=Pt({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%"}}}}),$i={default:Zi,small:Qi},el=e=>{const t=$i[e];return Ut(Dt["button-base"],t,_i,yo)},tl=["default","small"],nl={default:{className:""},small:{className:""}};for(const CA of tl)nl[CA]=el(CA);const rl=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=jt([nl[o],Ut(null,Ji({width:i})),...t]);return E("button",{ref:u,...h,type:n,onClick:r,disabled:a,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),al=Ut(Dt["button-primary"],Gi),ol=T(function({children:e,active:t,stylists:n=[],width:r,...a},o){return E(rl,{ref:o,stylists:[al,...n],active:t,width:r,...a,children:e})}),il=()=>{fi("Conversation",{routeProps:{conversationId:null}})};function ll(){return E(ol,{onClick:il,children:E(Co,{Component:Yi})})}const sl=Pt({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"10px",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg"}}}});function cl({children:e,dashboard:t}){const n=Ut(Dt["dashboard-table"],sl({dashboard:t}));return E("div",{...n,children:e})}const dl=m(null),ul="mobile",hl=Pt({base:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",maxWidth:"100%"},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:Kr,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function pl({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left"}){const a=Ut(Dt.label,hl({intent:t,wrap:n,alignment:r}));return Tn(e)?null:E("div",{title:"ellipsis"===n?e:void 0,...a,children:e})}const gl=Ut(Dt["emphasis-label"],Et({lineHeight:"16px"}));function ml({children:e}){return E(sa,{size:"med",weight:"lg",stylists:[gl],children:e})}function vl({text:e,isRead:t}){return E(t?pl:ml,{children:e})}const bl=Pt({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"}}},defaultVariants:{alignVariant:"flexStart"}});function fl({children:e,alignVariant:t="flexStart"}){const n=Ut(null,bl({alignVariant:t}));return E("div",{...n,children:e})}function yl({date:e,isRead:t=!1}){const n=mn(e);return E(vl,{text:n,isRead:t})}const kl=Ut(Dt["strong-sub-label"],zt({label:"strongSubLabel"}));function xl({children:e,stylists:t=[]}){return Tn(e)?null:E(sa,{size:"sm",weight:"med",stylists:[kl,...t],children:e})}const Tl=m(null),wl=Et({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),Cl=Ut(Dt["selector-row"],Et({borderRadius:"zero",backgroundColor:"surface.intent.action.discrete",boxShadow:"none",border:"{borderWidths.md} solid",borderColor:"border.layout",display:"flex",width:"100%",minHeight:"35px",height:"fit-content",padding:"10px",alignItems:"center",gap:"9px",flexShrink:0,textAlign:"start",cursor:"pointer","&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}));function Al(e,t,n){const[r,a]=f(e);return[t??r,n??a]}function El({children:e}){return null===se()?E(ce,{children:e}):e}function Il({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]=Al(e,a,o),p=X(),m=J({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:re,middleware:[$(n),ee({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),te({padding:8}),ne({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=m.context,b=ae(v,{enabled:i}),y=oe(v,{bubbles:{escapeKey:!0}}),k=ie(v),x=le([b,y,k]);return g(()=>({open:u,setOpen:h,...x,...m,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,x,m,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,enableClickMiddleware:s}),d=se(),u=l&&null===d,h=c.nodeId;return E(El,{children:E(de,{id:h,children:E(Tl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function Sl(){const e=v(Tl);if(null==e)throw new Error("Popup components must be wrapped in <PopupManager />");return e}function Nl({children:e}){const t=Sl(),n=t.refs.setReference,r=t.open?"open":"closed",a={...t.getReferenceProps(),ref:n,"data-state":r};return E(I,{children:e(a)})}const Pl=vo(e=>h.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),h.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Rl({Component:e,stylists:t}){return E(e,{stylists:[Ut(Dt["tiny-icon"]),...t??[]],size:9})}const Dl=vo(e=>h.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),h.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),h.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),Ml=Ut(null,Et({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"}}),yo),Ol=Ut(null,Et({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Ll=Ut(null,Et({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"}})),Bl=Ut(null,Et({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function Fl({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const a=n||"open"===r?.["data-state"];return S("div",{...Ml,"data-active":a,children:[S("button",{...Ol,...r,children:[E(xl,{children:t}),!a&&E("div",{...Bl,children:E(Rl,{Component:Dl})})]}),a&&E("button",{...Ll,onClick:e,children:E(Rl,{Component:Pl})})]})}const Ul=Pt({base:{border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function Wl({initialFocus:e=!0,style:t,ref:n,type:r,...a}){const{context:o,blockInteraction:i,...l}=Sl(),s=ue([l.refs.setFloating,n]),c=Ut(Dt.popup,Ul({type:r}));return o.open?S(I,{children:[i&&E(he,{lockScroll:!0}),E(pe,{children:E(ge,{context:o,modal:l.modal,initialFocus:e?void 0:-1,children:E("div",{ref:s,...c,style:{...l.floatingStyles,...t},...l.getFloatingProps(a),"aria-labelledby":l.labelId,"aria-describedby":l.descriptionId,children:a.children})})})]}):null}const Vl=Ut(Dt["popup-sort-row"],Et({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 Hl({onClick:e,children:t,active:n}){return E("button",{onClick:e,...Vl,children:E(ha,{accent:n?"active":"action",children:t})})}const ql=Ut(null,Et({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),jl=Ut(null,Et({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function zl({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:a}){const o=Sl(),i=e=>{r(e),o?.setOpen(!1)},l=a?.orderBy===e&&"ASC"===a?.direction,s=a?.orderBy===e&&"DESC"===a?.direction;return S("div",{...ql,children:[E(xl,{stylists:[jl],children:"Sort by:"}),E(Hl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),E(Hl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const Kl=Et(Xi,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}}),Yl=Ut(Dt["button-discrete-small"],Kl,yo);function _l({children:e,active:t,disabled:n,onClick:r,popupTriggerProps:a,ariaLabel:o,ariaExpanded:i}){const[l,s]=f(!1),c=t??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(a?.["data-state"]);return E("button",{type:"button",...Yl,onClick:e=>{void 0===c&&s(!l),r&&r(e)},"data-active":c??l,disabled:n,...a,"aria-label":o,"aria-expanded":i,children:e})}const Gl={minWidth:"140px"};function Zl({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const a=v(dl);if(!a)return null;const{sortInstance:o,setSortInstance:i}=a,l=o?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>E(Fl,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),E(Wl,{style:Gl,children:E(zl,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:o})})]}):E(_l,{disabled:!0,children:E(xl,{children:e})})}const Ql=Ut(null,Et({paddingLeft:"19px"}));function Xl({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){return E("div",{...Ql,children:E(Zl,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const Jl="Oldest to Newest",$l="Newest to Oldest";const es=m({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});function ts({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=v(es);let a="";return e===r?a="Me":"OWNER"===n?a="Bookkeeper":"ACCOUNTANT"===n&&(a="User"),E(vl,{text:a,isRead:t})}const ns=Ut(Dt.text,Et({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),zr);function rs({children:e,stylists:t=[]}){const n=jt([ns,...t]);return E("div",{...n,children:e})}const as=Ut(Dt["emphasis-sub-label"],zt({label:"emphasisSubLabel"}));function os({children:e}){return Tn(e)?null:E(sa,{size:"sm",weight:"lg",stylists:[as],children:e})}const is=Et({display:"grid",gridTemplateColumns:"3fr 1fr",border:"none",borderRadius:0,padding:"10px",width:"100%",cursor:"pointer",backgroundColor:"transparent",alignItems:"start"}),ls=St(Et({display:"flex",flexDirection:"column",alignItems:"start",gap:"2px",maxWidth:"100%"}),zr),ss=Et({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end",gap:"2px"});function cs({sender:e,subject:t,date:n,message:r,isRead:a,handleFormOpen:o}){return S("button",{className:is,onTouchEnd:o,children:[S("div",{className:ls,children:[E(ts,{authorUserId:e,isRead:a}),E(a?ha:os,{children:t}),E(ha,{children:r})]}),S("div",{className:ss,children:[E(yl,{date:n,isRead:a}),a?E(Co,{Component:fo}):E(rs,{children:E(Co,{Component:fo})})]})]})}const ds=_(),us=Ut(null,Et({paddingLeft:"25px"})),hs=[ds.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>E(fl,{children:E(ts,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>E(xl,{stylists:[us],children:"From"}),size:150,maxSize:150}),ds.accessor("subject",{id:"subject",cell:({row:e})=>E(fl,{children:E(vl,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>E(xl,{stylists:[us],children:"Subject"}),size:150}),ds.accessor("latestMessage.text",{id:"message",cell:({row:e})=>E(fl,{children:E(vl,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>E(xl,{stylists:[us],children:"Message"}),size:200}),ds.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>E(fl,{children:E(yl,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>E(Xl,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:$l,sortAscDisplay:Jl}),size:130,maxSize:130}),ds.display({id:ul,cell:({row:e})=>E(cs,{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 ps(e){return e?hs.filter(e=>e.id===ul):hs.filter(e=>e.id!==ul)}const gs=[],ms=Et({display:"flex",flexDirection:"column",height:"250px",width:"100%",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),vs=Ut(Dt["empty-dashboard-layout"],ms);function bs({children:e}){return E("div",{...vs,"data-testid":"empty-dashboard-layout",children:e})}function fs({Component:e,stylists:t}){return E(e,{stylists:[Ut(Dt["large-icon"]),...t??[]],size:25})}const ys=vo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),ks=()=>{fi("Conversation",{routeProps:{conversationId:null}})};function xs(){return S(I,{children:[E(fs,{Component:ys}),E(da,{wrap:"wrap",children:"Need help with your financials?"}),E(ol,{onClick:ks,children:E(da,{children:"Talk to a bookkeeper"})})]})}function Ts(){return S(I,{children:[E(fs,{Component:ys}),E(da,{wrap:"wrap",children:"All caught up"}),E(ha,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const ws=Ut(null,Et({display:"flex",flexDirection:"row",gap:"5px"}));function Cs({children:e}){return E("div",{...ws,children:e})}const As=Pt({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Es(e){return E(e?Ts:xs,{})}function Is({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:a,isMobile:o}){const i=function({conversations:e,isMobile:t}){return G({data:e??gs,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??gs.length,columns:ps(t),getCoreRowModel:Z(),getRowId:e=>e.id})}({conversations:n,isMobile:o}),{query:{data:l},isFilling:s}=Xo({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!yn(l?.data?.[0])&&!s;return S("div",{className:As({isMobile:o}),children:[E("div",{id:no}),S(wo.Provider,{value:r,children:[S(Vt,{children:[E(Yt,{children:"Conversations"}),S(Cs,{children:[E(No,{}),E(ll,{})]})]}),E(cl,{dashboard:"businessOwnerDashboard",children:a?E(Lo,{numColumns:4}):S(I,{children:[!o&&E(dl.Provider,{value:{sortInstance:e,setSortInstance:t},children:E(oi,{headerGroups:i.getHeaderGroups()})}),n.length>0?E(li,{children:i.getRowModel().rows.map(e=>E(Ki,{rowData:e,isMobile:o},e.id))}):E(bs,{children:Es(c)})]})})]})]})}const Ss=Ut(Dt.body,zt({body:"default"}));function Ns({children:e,stylists:t=[]}){if(Tn(e))return null;const n=jt([Ss,...t]);return E("div",{...n,children:e})}const Ps=Ut(null,Et({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),Rs=Pt({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),Ds=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function Ms(){return E("div",{...Ps,children:Ds.map((e,t)=>E(Ua,{styles:Rs({width:e?.width})},t))})}const Os=vo(e=>h.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),Ls=Et({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}"}),Bs=Et({position:"relative",width:"25px",height:"25px"});function Fs({hasUnread:e}){return S("div",{className:Bs,children:[E(fs,{Component:Os}),e&&E("div",{"data-testid":"unread-comment-badge",className:Ls,"aria-hidden":"true"})]})}const Us=Et({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout.strong}",boxSizing:"border-box"});function Ws({hasUnreadMessages:e=!1,showMessageIndicator:t}){return S("div",{className:Us,children:[E(da,{children:"Message Bookkeeper"}),t&&E(Fs,{hasUnread:e})]})}const Vs=Et({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function Hs(){return S("div",{className:Vs,children:[E(fs,{Component:ys}),E(da,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),E(ha,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),E(ol,{onClick:()=>fi("Conversation"),children:E(da,{children:"Talk to a bookkeeper"})})]})}const qs=Et({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function js({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=ti(),{startPrefetch:a,cancelPrefetch:o}=Vi(),i=y(()=>{a({id:t}),n({id:t})},[t,a,n]),l=y(()=>{o(),r()},[o,r]);return S("div",{className:qs,children:[E(fs,{Component:ys}),E(da,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),E(ha,{wrap:"wrap",children:"Pick up where you left off."}),E(ol,{onClick:()=>fi("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:E(da,{children:"Continue conversation"})})]})}const zs=Et({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ks({summaryId:e}){return S("div",{className:zs,children:[E(fs,{Component:ys}),E(da,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),E(ha,{wrap:"wrap",children:"Your bookkeeper will respond here."}),E(ol,{onClick:()=>fi("FinancialSummary",{routeProps:{summaryId:e}}),children:E(da,{children:"Talk to a bookkeeper"})})]})}function Ys({summaryId:e,conversationId:t}){const n=kn(t);return yn(e)?E(Hs,{}):n?E(js,{conversationId:t,summaryId:e}):E(Ks,{summaryId:e})}const _s=Et({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.strong}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),Gs=Et({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 Zs({summaryData:e}){const t=kn(e?.summary),n=kn(e?.conversation);return S("div",{className:_s,children:[E(Ws,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),E("div",{className:Gs,children:E(Ys,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const Qs=Et({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),Xs=Pt({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.strong}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),Js=Ut(null,Et({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),$s=Et({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function ec({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},Rn({queryKey:(t={limit:1,filter:{date:{equal:Zt(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Hi(t):["summaries",{}],queryFn:ji,...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 $${_a.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${Ga.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.";return S("div",{className:$s,children:[E("div",{"data-testid":"financial-summary-layout",className:Xs({isSample:e}),children:!e&&r?E(Ms,{}):S("div",{className:Qs,children:[E(Ns,{stylists:[Js],children:a}),e&&E(Ya,{size:"lg"})]})}),E(Zs,{summaryData:n})]})}const tc={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},nc={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."}},rc={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:nc.short.credentialsChanged,longMessage:nc.long.relinkCredentials,buttonType:tc.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:nc.short.credentialsChanged,longMessage:nc.long.relinkCredentials,buttonType:tc.RELINK},INVALID_MFA:{shortMessage:nc.short.credentialsChanged,longMessage:nc.long.relinkCredentials,buttonType:tc.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:nc.short.credentialsChanged,longMessage:nc.long.invalidUpdatedUsername,buttonType:tc.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:nc.short.accountLocked,longMessage:nc.long.accountLocked,buttonType:tc.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:nc.short.credentialsChanged,longMessage:nc.long.relinkCredentials,buttonType:tc.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:nc.short.supportChanged,longMessage:nc.long.supportChanged,buttonType:tc.CHAT},USER_SETUP_REQUIRED:{shortMessage:nc.short.updateNeeded,longMessage:nc.long.updateNeeded,buttonType:tc.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:nc.short.supportChanged,longMessage:nc.long.mfaUpdateNeeded,buttonType:tc.OPEN_BANK},NO_ACCOUNTS:{shortMessage:nc.short.noAccountsAvailable,longMessage:nc.long.noAccountsUnlink,buttonType:tc.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:nc.short.noAccountsAvailable,longMessage:nc.long.noAccountsUnlink,buttonType:tc.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:nc.short.connectionError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},ITEM_NOT_FOUND:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},PRODUCT_NOT_READY:{shortMessage:nc.short.serverError,longMessage:nc.long.productNotReady,buttonType:tc.CHAT},USER_PERMISSION_REVOKED:{shortMessage:nc.short.connectionError,longMessage:nc.long.permissionRevoked,buttonType:tc.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:nc.short.temporarilyDown,longMessage:nc.long.bankMaintenance,buttonType:tc.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:nc.short.serverDown,longMessage:nc.long.serverDown,buttonType:tc.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:nc.short.temporarilyDown,longMessage:nc.long.bankMaintenance,buttonType:tc.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:nc.short.supportChanged,longMessage:nc.long.supportChanged,buttonType:tc.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:nc.short.connectionError,longMessage:nc.long.connectionError,buttonType:tc.CHAT},PLANNED_MAINTENANCE:{shortMessage:nc.short.temporarilyDown,longMessage:nc.long.bankConnectionMaintenance,buttonType:tc.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:nc.short.requestError,longMessage:nc.long.connectionError,buttonType:tc.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:nc.short.inputError,longMessage:nc.long.connectionError,buttonType:tc.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:nc.short.volumeDown,longMessage:nc.long.bankMaintenance,buttonType:tc.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:nc.short.serverError,longMessage:nc.long.connectionError,buttonType:tc.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:nc.short.updateNeeded,longMessage:nc.long.partnerCredsChange,buttonType:tc.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:nc.short.credentialsExpiring,longMessage:nc.long.credentialsExpiring,buttonType:tc.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:nc.short.relinkNeeded,longMessage:nc.long.relinkForStatements,buttonType:tc.RELINK}},DEFAULT:{DEFAULT:{shortMessage:nc.short.connectionError,longMessage:nc.long.connectionError,buttonType:tc.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:nc.short.generic,longMessage:nc.long.generic,buttonType:tc.CHAT}}};function ac({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return mr({error:new Error("No bank error provided. Should not get here"),severity:"error"}),rc.DEFAULT.DEFAULT;const n=rc[e];if(!n)return mr({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),rc.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(mr({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),rc.DEFAULT.DEFAULT)}const oc={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 ic(e,t=!0){const n=ac({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 lc=Ut(null,Et({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),sc=Ut(Dt["month-picker-left-button"],Et({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),cc=Ut(Dt["month-picker-right-button"],Et({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),dc=Ut(null,Et({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function uc({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const a=Gt(e.year,e.month,1),o=gn(a,{abbreviateMonth:!0});return S("div",{...lc,children:[E(ol,{stylists:[sc],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:E(Co,{Component:bo})}),E("div",{...dc,children:E(da,{children:o})}),E(ol,{stylists:[cc],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:E(Co,{Component:fo})})]})}const hc=Et({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function pc({children:e}){return E("div",{className:hc,children:e})}const gc=Ut(Dt["progress-bar"],Et({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),mc=Ut(Dt["progress-bar-fill"],Et({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),vc=Ut(Dt["tile-bar-label"],Et({paddingLeft:"10px"}));function bc({label:e="",percentage:t,color:n,width:r}){const a=void 0===r?"100%":`${r}px`,o=t>=50,i=jt([mc,Ut(null,n)]);return S("div",{...gc,style:{width:a},children:[E("div",{...i,style:{width:`${t}%`},children:o&&E("div",{...vc,children:E(pl,{children:e})})}),!o&&E("div",{...vc,children:E(pl,{children:e})})]})}const fc=Ut(Dt["metric-md"],zt({metric:"md"}));function yc(e){return E("div",{...fc,children:e.children})}const kc=Ut(null,Et({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),xc=Ut(null,Et({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),Tc=({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 S("div",{...kc,children:[E(bc,{label:e,percentage:a,color:r}),E("div",{...xc,children:E(yc,{children:oa(t)})})]})},wc={netIncome:0,income:0,expenses:0,absoluteSum:0},Cc=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return wc;const t=e.json?.data?.[0];if(yn(t))return wc;const n=t.income?.total??0,r=t.expenses?.total??0,a=L(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:a}},Ac=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),h.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),h.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}),h.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 Ec({Component:e,stylists:t}){return E(e,{stylists:[Ut(Dt["medium-icon"]),...t??[]],size:15})}const Ic={},Sc=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return Ic[e]={loading:!1,error:null,scriptEl:t}},Nc="undefined"!=typeof window&&void 0!==window.document;function Pc({src:e,checkForExisting:t=!1,...n}){let r=Ic[e];!r&&t&&e&&Nc&&(r=Sc(e));const[a,o]=f(r?r.loading:Boolean(e)),[i,l]=f(r?r.error:null),[s,c]=f(!1);return k(()=>{if(!Nc||!e||s||i)return;let a;r=Ic[e],!r&&t&&(r=Sc(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=Ic[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 Ic[e])}},[e]),[a,i]}const Rc=e=>["integrations",e??{}],Dc=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:co(t[3].environment)},r=await Ar(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Mc(e,t){return Wo({...t,queryKey:Rc(e),queryFn:Dc})}function Oc(e){return Mc({filter:{apiName:{equal:"PLAID"}}},e)}function Lc(e){return Ir(`${t=e,Sr[t]}/v1`,"v1");var t}const Bc=[{displayName:"Chase",institutionName:"ins_56"},{displayName:"Bank of America",institutionName:"ins_127989"},{displayName:"Capital One",institutionName:"ins_128026"},{displayName:"Wells Fargo",institutionName:"ins_127991"}];async function Fc({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:Lc(n)},{url:a,headers:o}=Tr(r);return await Vo({url:a,includeCredentials:!0,extraHeaders:o,params:e?{institutionId:e}:void 0})}const Uc=Ut(Dt["button-danger"],Et({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 Wc({children:e,stylists:t=[],...n}){return E(rl,{stylists:[Uc,...t],...n,children:e})}const Vc=Ut(Dt["button-tertiary"],Et({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 Hc({children:e,stylists:t=[],...n}){return E(rl,{stylists:[Vc,...t],...n,children:e})}const qc="cancel",jc="danger",zc="success",Kc=Pt({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),Yc=Pt({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"}}),_c={transform:"none",willChange:"auto"};function Gc({show:e,role:t="dialog",children:n,size:r="sm",padding:a="md",outsidePress:o=!1,escapeKey:i=!0,className:l}){const{context:s}=J({open:e,strategy:"fixed"}),c=oe(s,{outsidePress:o,escapeKey:i}),d=ie(s,{role:t}),{getFloatingProps:u}=le([c,d]),h=[Yc({size:r,padding:a}),l].filter(Boolean).join(" ");return e?E(pe,{children:E(he,{lockScroll:!0,className:Kc(),children:E(ge,{context:s,modal:!0,returnFocus:!0,children:E("div",{...u(),className:h,style:_c,children:n})})})}):null}const Zc=Et({display:"flex",justifyContent:"flex-end",gap:"8px"}),Qc="success",Xc="danger",Jc=me.createConfirmation(ve(function({show:e,proceed:t,title:n,body:r,buttons:a=[{key:"ok",type:"default",label:"OK"}]}){return S(Gc,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:Dt["alert-dialog"],children:[E(da,{wrap:"wrap",stylists:[Ut(Dt["alert-header"])],children:n}),r&&"string"==typeof r?E(pl,{wrap:"wrap",children:r}):E(I,{children:r}),E("div",{className:Zc,children:a.map(e=>{const n=(e=>{switch(e){case Xc:return Wc;case Qc:return Hc;default:return ol}})(e.type);return E(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:E(da,{children:e.label})},e.key)})})]})}));function $c(e,t,n,r){const a=1===n?e:t;return r?`${n} ${a}`:a}function ed(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function td(e,t){return t?e?`${e} ${ed(t)}`:ed(t):e??""}const nd=e=>fi("Conversation",{routeProps:{conversationId:null,defaultValues:{message:e}}}),rd=Et({display:"flex",flexDirection:"column",gap:"12px"});async function ad(e){await Jc({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:qc,label:"Cancel"},{key:zc,label:"Chat",type:Qc}]})===zc&&nd(`Please help me with my bank issue (code: ${e}). Thanks!`)}const od=e=>["banks/accounts",e??{}],id=async e=>{const t=e.queryKey,n={path:"/v6/banks/accounts/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:co(t[3].environment)},r=await Ar(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function ld(e){const t=e?.params;return Wo({queryKey:t?od(t):["banks/accounts",{}],queryFn:id,enabled:e?.enabled,select:e?.select})}function sd(e,t){return ki({queryKey:fn(["banks/accounts",{}],{}),queryFn:id,accessToken:e,environment:t})}const cd=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{...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:Oi({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:Oi({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}},dd=Ut(Dt["button-secondary"],Et({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 ud({children:e,stylists:t=[],...n}){return E(rl,{stylists:[dd,...t],...n,children:e})}function hd({mutationFn:e,onMutateFn:t,...n}){const r=An(),a=Pn(),o=!Tn(r);return M({...n,mutationFn:o?t=>e({data:t,accessToken:r,environment:a}):En,onMutate:o&&kn(t)?e=>t({data:e,accessToken:r,environment:a}):void 0},Sn)}const pd=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:Rr(n)};return await Er(r)},gd=async({data:e,accessToken:t,environment:n})=>pd({data:e,accessToken:t,environment:n}),md=async({data:e,accessToken:t,environment:n})=>pd({data:e,accessToken:t,environment:n}),vd=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:Rr(n)};return await Er(r)})({data:{accounts:e},accessToken:t,environment:n});function bd(e){return hd({onSuccess:async()=>{gr("mutation successful, invalidating bank account queries");try{return Sn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&mr({error:e,severity:"error"})}},...e})}function fd(){return bd({mutationFn:md})}function yd(){return hd({onSuccess:async()=>{gr("mutation successful, invalidating bank account queries");try{return Sn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&mr({error:e,severity:"error"})}},mutationFn:vd})}const kd=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,xd=e=>"PLAID"===e,Td=e=>e>0?"Deposited to":"Withdrawn from",wd=e=>({id:Li(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),Cd=Et({display:"flex",flexDirection:"column",gap:"16px"}),Ad=async()=>Jc({title:"Merge Accounts",body:S("div",{className:Cd,children:[E(pl,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),E(pl,{wrap:"wrap",children:"This action can't be undone."}),E(pl,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:qc,label:"Cancel"},{key:jc,label:"Continue",type:Xc}]}),Ed=()=>Jc({title:"Merge Failed",body:E(pl,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:qc,label:"OK"}]}),{formContext:Id,fieldContext:Sd,useFieldContext:Nd,useFormContext:Pd}=be(),Rd=vo(e=>h.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{id:"icon/check"},h.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function Dd({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return S(Hc,{type:"submit",disabled:n,children:[e&&E(Co,{Component:Rd}),E(da,{children:t})]})}const Md=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Od=[Ut(null,Et({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Ld=Ut(null,Et({display:"flex",alignItems:"center",gap:"4px"}));function Bd({errorMessage:e}){return S("div",{...Ld,children:[E(Ec,{Component:Md,stylists:Od}),E(ha,{intent:"danger",wrap:"wrap",children:e})]})}const Fd=Et({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"}}),Ud=Et({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Wd=Et({display:"flex",justifyContent:"space-between",alignItems:"center"});function Vd({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=Ut(i||null,Fd,l,Ud,ko),[m,v]=f(!0);return S(I,{children:[S("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:[S("div",{className:Wd,children:[void 0!==r&&E(ha,{children:r}),kn(p)&&E(ha,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),o&&d&&E(Bd,{errorMessage:d})]})}const Hd=Et({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 qd({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:a}){const o=Nd(),i=fe(o.store,e=>e.meta.errors[0]?.message),l=fe(o.store,e=>e.meta.isDefaultValue),s=fe(o.store,e=>e.meta.isTouched);return E(Vd,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:Dt["discrete-form-input"],additionalStyles:Hd,errorMessage:i,onClick:a,onBlur:o.handleBlur,children:e})}function jd(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 zd(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function Kd(e){"Enter"===e.key&&e.currentTarget.blur()}const Yd=Ut(Dt["amount-input"],zt({body:"default"}),Et({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),_d=Ut(null,Et({display:"flex",alignItems:"center",gap:"2px"}));function Gd({value:e,onChange:t,inputRef:n,onClick:r,onBlur:a,autofocus:o=!1}){return S("div",{..._d,children:[E(Ns,{children:"$"}),E(ke,{...Yd,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:Kd,autoFocus:o})]})}const Zd=Et({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),Qd=Pt({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function Xd({kind:e,label:t,children:n,inputRef:r,disabled:a,popupTriggerProps:o,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Nd(),u=fe(d.store,e=>e.meta.errors[0]?.message),h=fe(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=kn(c)?c-p:void 0,m=a?Zd:Qd({kind:e});return E(Vd,{label:t,inputRef:r,popupTriggerProps:o,className:Dt["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:n})}const Jd=m(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function $d(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 eu(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 tu(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 nu(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 ru(e){const[t,n]=f(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:a,isMousing:o,isScrolling:i}=function(e,t){const n=p(null),[r,a]=f(!0),[o,i]=f(!1),l=v(Jd),[s,c]=w($d,{focusedIndex:null,maxIndex:e});k(()=>{const e=n.current,t=()=>{null==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=p(null);return k(()=>{c({type:"max",max:e})},[e]),k(()=>{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=Sl(),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=g(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(eu)),n},[e,t]),r=g(()=>{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){k(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=nu(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&&tu(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.setOpen(!1))};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:m}=zo({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&tu(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return b=a.focusedIndex,k(()=>{const e=A.current;if(null===b||x)return;const{node:t,metadata:n}=nu(b,T,C);return E.lastOpenedIndex!==b&&n?.hasCascading&&(E.closeCurrentCascade(),I({focusedIndex:b,node:t,listElement:e})),()=>S()},[b,x=o,A=r,E=e,S=m,T=d,C=u,I=h]),function(e,t,n,r){k(()=>{const{metadata:a}=nu(e,t,n);null===e||a?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(a.focusedIndex,d,u,e),g(()=>({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 b,x,T,C,A,E,I,S}const au=m(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function ou({style:e,children:t}){const n=Ut(Dt["popup-list"],wl,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=ru(r);return E("div",{...n,onScroll:r.onScroll,ref:a.listRef,tabIndex:0,children:E(Jd.Provider,{value:a,children:E(au.Provider,{value:r,children:t})})})}const iu=St(zt({body:"default"}),Et({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}}));function lu({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=p(null);return k(()=>{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)}},[]),E("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:iu})}function su({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i,getSearchActiveStyles:l}){const s=Sl(),[c,d]=f(""),u=i||o>=5,h=wn(c),p=l?.(h),g=t=>{e?.(t),s?.setOpen(!1)};return E(Wl,{children:S(ou,{style:p,children:[u&&E(lu,{searchTerm:c,setSearchTerm:d,placeholder:t}),u&&h?E(n,{...a??{},onClick:g,searchTerm:c}):E(r,{...a??{},onClick:g})]})})}const cu=()=>["expenses/categories"],du=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await jo(n);return{...r,data:r.data?(a=r.data,a.map(e=>({...e,id:Oi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?Oi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var a};function uu(e){return Rn({...e,queryKey:["expenses/categories"],queryFn:du})}function hu(){return uu({select:e=>({...e,data:e.data?mu(e.data):void 0})})}function pu(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 gu(e){if(0===e.length)return[];const t=pu(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function mu(e){if(0===e.length)return[];const t=pu(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function vu({hasCascading:e=!1}={}){const t=p(null),{register:n,unregister:r,map:a,focusedIndex:o,isMousing:i,listRef:l}=v(Jd);C(()=>{const a=t.current;if(a)return n(a,{index:0,hasCascading:e}),()=>{r(a)}},[n,r,e]);const s=g(()=>void 0!==a&&null!==t.current?a.get(t.current)?.index??-1:-1,[a]),c=s===o;C(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=y(()=>{l?.current?.focus()},[l]),u=g(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const bu=T(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:a},o){return E("button",{...Cl,onClick:e,"data-listitem":!0,"data-index":t,...a,...r,ref:o,children:n})}),fu=T(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:a,itemProps:o,itemRef:i}=vu(),l=ue([i,r]);return E(bu,{...Cl,onClick:e,index:a,...n,itemProps:o,ref:l,children:t})}),yu=e=>({id:e.id,name:e.name});function ku({text:e}){return E("div",{...Cl,children:e?E(da,{children:e}):E(Ua,{styles:Et({width:"100%",height:"16px"})})})}const xu=Ut(Dt["popup-list"],wl),Tu=()=>S("div",{...xu,children:[E(ku,{}),E(ku,{}),E(ku,{}),E(ku,{}),E(ku,{})]}),wu=Ut(Dt.text,zt({label:"strongLabel"}),Et({maxWidth:"100%"}),zr);function Cu({children:e,stylists:t=[]}){const n=jt([wu,...t]);return E("div",{...n,children:e})}function Au(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}const Eu=Ut(null,Et({whiteSpace:"normal"})),Iu=[Ut(null,Et({marginLeft:"6px",marginRight:"6px"}))],Su={keys:[{name:"name"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function Nu({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:a}=uu({select:e=>({...e,data:e.data?gu(e.data):void 0})}),o=n?.data,i=!a&&r&&(void 0===o||0===o.length),l=g(()=>new xe(o??[],Su),[o]),s=g(()=>o?function(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?Au(a,r,n):o?Au(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{Au(e,n,t)})}(r,n)}),n}(l.search(e),o):[],[o,e,l]);return a?E(Tu,{}):i?E(ku,{text:"No data"}):0===s.length?E(ku,{text:"No results found"}):E(I,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return E(fu,{onClick:()=>t(yu(n)),children:E(Cu,{stylists:[Eu],children:r?n.name:S(I,{children:[e.name,E(Co,{Component:fo,stylists:Iu}),n.name]})})},`${e.id}_${n.id}`)})})}const Pu=T(function({index:e,popupTriggerProps:t,children:n,itemProps:r},a){const o=ue([a,t?.ref]);return E(bu,{index:e,ref:o,itemProps:r,popupTriggerProps:t,children:n})});function Ru({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:a}=v(au),{itemRef:o,index:i,itemProps:l}=vu({hasCascading:!0}),{isScrolling:s}=v(Jd);return S(Il,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[E(Nl,{children:t=>E(Pu,{itemProps:l,index:i,ref:o,popupTriggerProps:t,children:e})}),E(Wl,{initialFocus:a,children:t})]})}const Du=Ut(null,Et({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Mu({icon:e,displayLabel:t}){return S("div",{...Du,children:[e,E(da,{wrap:"wrap",children:t}),E(Co,{Component:fo})]})}function Ou({category:e,handleCategoryChange:t}){return E(ou,{children:e.children?.map(e=>E(fu,{onClick:()=>t(yu(e)),children:E(da,{wrap:"wrap",children:e.name})},e.id))})}function Lu({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=hu(),a=t?.data,o=!r&&n&&void 0===a;return r?E(Tu,{}):o?E(ku,{text:"No data"}):E(I,{children:a?.map(t=>t.hasChilds?E(Ru,{triggerChildren:E(Mu,{displayLabel:t.name}),popupChildren:E(Ou,{category:t,handleCategoryChange:e})},t.id):E(fu,{onClick:()=>e(yu(t)),children:E(da,{wrap:"wrap",children:t.name})},t?.id))})}const Bu=({onClick:e})=>{const{query:{data:t}}=hu();return E(su,{onClick:e,placeholder:"Search expense categories...",SearchList:Nu,DefaultList:Lu,listLength:(t?.data??[]).length})},Fu=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),Uu=vo(e=>h.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.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}),h.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),Wu=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),Vu=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),Hu=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),qu=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),ju=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),zu=vo(e=>h.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function Ku(e){switch(e){case"Advertising":case"Advertising and Marketing":return Fu;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return Vu;case"Health & Fitness":case"Sports":case"Sporting Goods":return Hu;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return qu;case"Plane / Train / Bus":case"Airlines":case"Airfare":return ju;case"Vehicle":case"Taxi":case"Rental Car":case"Rental Cars":case"Car Payment":case"Auto Insurance":case"Other Vehicle Expenses":case"Parking and Tolls":case"Parking & Tolls":case"Transportation (Taxi, Rideshare, Train)":return zu;case"Meals & Entertainment":case"Meals":case"Business Meals":case"Food & Dining":case"Groceries":case"Restaurants":case"Other Food & Dining":case"Lead Gen - Meals":case"PAX Food & Drink":return Wu;default:return Uu}}const Yu=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),h.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}),h.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"),_u=[Ut(null,Et({"& path":{stroke:"surface.foreground"}}))];function Gu({onClick:e}){return S(ud,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),e()},children:[E(Co,{stylists:_u,Component:Yu}),E(ha,{intent:"primary",children:"Add Split"})]})}const Zu=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0})),Qu=Ut(null,Et({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function Xu({options:e,onSelect:t,selectedLabel:n}){const r=Sl();return E("div",{...Qu,children:e.map(e=>E(Hl,{onClick:()=>{return n=Number(e.value),r?.setOpen(!1),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const Ju=vo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2922)"},h.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_9779_2922"},h.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),$u=Ut(null,Et({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"}}),yo);function eh({selectedLabel:e,options:t,onSelect:n}){return S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>S("div",{...$u,...t,children:[E(da,{children:e}),E(Rl,{Component:Ju})]})}),E(Wl,{children:E(Xu,{options:t,onSelect:n,selectedLabel:e})})]})}const th=Ut(null,Et({display:"flex",alignItems:"center",gap:"15px"})),nh=tn.map((e,t)=>({value:t,label:e})),rh=nn({}).map(e=>({value:e,label:String(e)}));function ah({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),a=(e,n)=>{const r=new Date(e,n,1);t(r)};return S("div",{...th,children:[E(eh,{selectedLabel:tn[r],options:nh,onSelect:e=>a(n,e)}),E(eh,{selectedLabel:String(n),options:rh,onSelect:e=>a(e,r)})]})}const oh=Ut(null,Et({background:"surface.foreground",padding:"25px",gap:"15px"})),ih=Ut(null,Et({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),lh=Ut(null,Et({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"}}),yo),sh=Ut(null,Et({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),ch=Ut(null,Et({padding:"8px",textAlign:"center"})),dh=Ut(null,Et({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"}}),yo),uh=Ut(null,Et({color:"typography.base"}));function hh({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:a,minDate:o}){const i=t&&rn(e,t),l=an(e),s=e.getMonth()!==n,c=!!a&&on(e,a),d=!!o&&on(o,e);return E("button",{...dh,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:E(da,{stylists:s||c||d?[uh]:[],children:e.getDate().toString()})})}function ph({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:a,minDate:o}){const i=Sl(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=Gt(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=Me(d),h=void 0===a||u&&on(a,u),p=yn(o)||d.length>0&&on(d[0],o),g=e=>{t(e),i.setOpen(!1)},m=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return S("div",{...oh,children:[S("div",{...ih,children:[E("button",{...lh,onClick:()=>m(-1),disabled:!p,children:E(Co,{Component:bo})}),E(ah,{currentMonthYear:l,onMonthYearChange:r}),E("button",{...lh,onClick:()=>m(1),disabled:!h,children:E(Co,{Component:fo})})]}),S("div",{...sh,children:[en.map(e=>E("div",{...ch,children:E(ha,{children:e})},e)),d.map(t=>E(hh,{date:t,selectedDate:e,currentMonth:c,onClick:g,maxDate:a,minDate:o},t.toISOString()))]})]})}const gh=Ut(null,zt({body:"default"}),Et({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),mh=Ut(null,zt({body:"default"}),Et({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"}})),vh=u.object({message:u.string().refine(e=>""!==e,{message:"Required"})});function bh(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const fh=Et.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),yh=Et.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"}),kh=Et(yh,fh),xh=Et.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Th=Et(xh,fh,zt.raw({body:"default"})),wh=Et({display:"block",width:"100%"}),Ch=Et({position:"relative"}),Ah=Et({display:"flex",justifyContent:"flex-end"}),Eh=Et({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Ih=T(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n},r){const a=Nd(),o=p(null),{startCallback:i}=zo({delay:50,callback:e=>n(e)});A(r,()=>o.current);const l=!e&&vh.safeParse(a.form.state.values).success;return E(Xd,{kind:"text",inputRef:o,disableHover:!0,onClick:()=>(bh(t),void i(!0)),children:S("div",{className:wh,children:[S("div",{className:Ch,children:[S("pre",{className:kh,children:[a.state.value,E("br",{})]}),E("textarea",{ref:o,placeholder:"Message...",value:a.state.value,className:Th,onChange:e=>a.handleChange(e.target.value)})]}),E("div",{className:Ah,children:E(ol,{disabled:!l,type:"submit",children:E("span",{className:Eh,children:E(Ec,{Component:ys})})})})]})})}),Sh=Ut(Dt["category-text"],Et({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-medium-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),xo),Nh=Ut(null,Et({color:"inherit"})),Ph=Ut(Dt["amount-input-container"],Et({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"}}),xo),Rh=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Dh=e=>{const t=e?.description;return`${t} | ${aa(Number(e?.amount),{dollarSign:!0})} | ${ln(dn(e?.date||""))}`};function Mh({promptText:e}){return S(I,{children:[E(Co,{Component:Yi}),E(pl,{children:e})]})}function Oh({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?E(Tu,{}):S(I,{children:[r&&E(fu,{onClick:()=>fi("BankAccountForm"),children:E(Mh,{promptText:"Add bank account"})}),e?.map(e=>E(fu,{onClick:()=>t(e),children:E(da,{wrap:"wrap",children:td(e?.name,e?.mask)})},e?.id))]})}const Lh={keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Bh({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:a=!1}){const o=g(()=>new xe(e??[],Lh),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Tu,{}):S(I,{children:[a&&E(fu,{onClick:()=>fi("BanksAndIntegrations"),children:E(Mh,{promptText:"Add bank account"})}),0===i.length?E(ku,{text:"No results found"}):i.map(e=>E(fu,{onClick:()=>n(e),children:E(da,{wrap:"wrap",children:td(e?.name,e?.mask)})},e?.id))]})}function Fh({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return E(su,{onClick:e,placeholder:"Search bank accounts...",SearchList:Bh,DefaultList:Oh,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const Uh=Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function Wh({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:a,onClick:o}){return S(Il,{placement:"bottom-start",children:[E(Nl,{children:r=>E(Xd,{label:e,popupTriggerProps:r,disabled:t,children:E("button",{className:Uh,type:"button",disabled:t,children:E(da,{children:td(n?.name??"",n?.mask??"")})})})}),E(Fh,{bankAccounts:r,isFilling:a,onClick:o,showAddButton:!0})]})}const Vh=(e,t)=>e?.find(e=>e.glAccountId===t),Hh=e=>{const{query:t}=ld({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},qh=e=>{if(yn(e))return!1;const t=e.filter(e=>xd(e.apiName)&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||kn(e.lastSyncedDate))},jh=()=>{const e=ld({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function zh(e){return e?.filter(e=>kd(e.apiName)&&"ACTIVE"===e.status)}function Kh(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function Yh(e){return ld({select:t=>({...t,data:Kh(t?.data,e)})})}const _h=()=>["accounting/glAccounts"],Gh=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await jo(n);return Jh(r)};function Zh(e){return Rn({...e,queryKey:["accounting/glAccounts"],queryFn:Gh})}function Qh(){return Zh({select:tp})}function Xh(){return Zh({select:np})}const Jh=e=>e.map(e=>({...e,id:Oi({id:e.id,prefix:"GL_ACCOUNT"})}));function $h(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>$h(e,t))}const ep=e=>!e.parentAccountNo;function tp(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(ep).map(e=>({...e,children:$h(e,t)}))}function np(e){return tp(e).flatMap(e=>[e,...e.children])}const rp=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function ap(e,t){return g(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const op=e=>({id:e.id||"",name:e.name,accountNo:e.accountNo});function ip(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}function lp(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}const sp=[Ut(null,Et({marginLeft:"6px",marginRight:"6px"}))],cp=Ut(null,Et({whiteSpace:"normal"})),dp={keys:[{name:"accountNo",weight:.3},{name:"name",weight:.7}],threshold:.3,includeScore:!0,minMatchCharLength:1};function up({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:a}=Xh(),o=ap(r,e),i=g(()=>new xe(o,dp),[o]),l=g(()=>function(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=>{lp(e,n,t)})}(r,n):a&&lp(a,r,n)}),n}(i.search(n),o),[o,n,i]);return a?E(Tu,{}):l.map(({parent:e,child:n})=>E(fu,{onClick:()=>t(n),children:S(Cu,{stylists:[cp],children:[ip(e.accountNo,e.name),E(Co,{Component:fo,stylists:sp}),ip(n.accountNo,n.name)]})},`${n.accountNo}`))}function hp({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:a}=Qh(),o=ap(n,e);return a?E(Tu,{}):a||r||void 0!==n?o.map(e=>{const n=ip(e.accountNo,e.name);return E(Ru,{triggerChildren:E(Mu,{displayLabel:n}),popupChildren:E(pp,{glAccount:e,onClick:t})},e.accountNo)}):E(ku,{text:"No data"})}function pp({glAccount:e,onClick:t}){return E(ou,{children:e.children.map(e=>E(fu,{onClick:()=>t(e),children:E(da,{children:ip(e.accountNo,e.name)})},e.accountNo))})}const gp=Et({maxWidth:"420px",width:"fit-content"});function mp({onClick:e,types:t}){const{query:{data:n}}=Qh(),r=ap(n,t);return E(su,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?gp:void 0,SearchList:up,DefaultList:hp,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}const vp=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0,cursor:"pointer"})),bp={filter:{type:{in:["BANK_TRANSFER"]}}},fp=Ut(null,Et({whiteSpace:"normal"}));function yp({onClick:e,transactionId:t}){const{query:{data:n},isFilling:r}=Si(bp),a=n?.data?.filter(e=>e.id!==t),o=Sl();return E(Wl,{children:E(ou,{children:r?E(Tu,{}):a?.map(t=>E(fu,{onClick:()=>(e(t),void o?.setOpen(!1)),children:E(da,{stylists:[fp],children:Dh(t)})},t.id))})})}const kp=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),xp=Ut(null,Et({color:"typography.base.weak"})),Tp=Ut(null,Et({display:"grid",textWrap:"nowrap"}));function wp({children:e,rows:t,cols:n}){return E("div",{...Tp,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const Cp=Pt({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function Ap({option:e,handleClick:t,selected:n,width:r,backgroundColor:a}){const o=St(Cp({width:r,backgroundColor:a}),Zi,_i,Gi,yo);return void 0===e?null:E("button",{type:"button",className:o,onClick:()=>t(e),"data-active":n?.value===e.value,children:E(pl,{wrap:"wrap",alignment:"center",children:e.label})})}function Ep({options:e,handleClick:t,selected:n,rows:r,cols:a}){return E(wp,{rows:r,cols:a,children:e?.map(e=>E(Ap,{option:e,handleClick:t,selected:n},e.value))})}function Ip({options:e}){const t=Sl(),n=Nd();return E(Wl,{children:E(ou,{children:e.map(e=>E(fu,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.setOpen(!1)},children:E(pl,{children:e.label})},e.value))})})}const Sp=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),Np=Ut(null,Et({color:"typography.base.weak"})),Pp=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Rp=Et({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=Et({display:"flex",flexDirection:{base:"row",md:"column"},alignItems:{base:"center",md:"start"},justifyContent:"flex-start",textAlign:"start",gap:"5px",maxWidth:"100%",flexWrap:"wrap"});function Mp({accountName:e,accountNo:t,syncText:n,active:r=!0}){return S("div",{className:Dp,children:[n&&E(ha,{intent:r?"normal":"danger",children:n}),E(da,{wrap:"wrap",children:e}),t&&E(da,{children:ed(t)})]})}const Op=e=>["plaidInstitutionLogo",e??{}];function Lp(e){const t=An(),n=Pn();return R({queryKey:Op({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await Fc({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const Bp=Et({display:"flex",gap:"10px",maxWidth:"100%"});function Fp({accountName:e,accountNo:t,institutionId:n,syncText:r,active:a=!0,showIcon:o=!0}){const i=Lp(n);return S("div",{className:Bp,children:[i&&o?E("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):E(fs,{Component:Vu}),E(Mp,{accountName:e,accountNo:t,active:a,syncText:r})]})}const Up=Et({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function Wp({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return E(ol,{...r,disabled:n,width:"fill-parent",children:E(Cu,{children:e?td(e.name,e.mask):S("div",{className:Up,children:[E(pl,{children:t}),E(Co,{Component:Yi})]})})})}const Vp="TRIGGER_ACCOUNT",Hp="FORM_SELECTABLE_ACCOUNT",qp=Et({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function jp({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:a,warningMessage:o}){return S("div",{className:qp,children:[S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>E(Wp,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===Vp?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),E(Fh,{bankAccounts:r,isFilling:a,onClick:t})]}),o&&E(Bd,{errorMessage:o})]})}const zp=(e,t,n)=>{if(!n)return;const r=e===Hp?t:n,a=e===Hp?n:t,o=(i=r?.mask,l=a?.mask,!i||!l||i!==l);var i,l;const s=(c=r?.apiName,d=a?.apiName,xd(c)&&kd(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},Kp=Et({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),Yp=Et({display:{base:"block",sm:"none"}}),_p=Et({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),Gp=Et({display:"flex",justifyContent:"center",alignItems:"center"}),Zp=Et({display:{base:"none",sm:"block"}}),Qp=Et({display:{base:"block",sm:"none"}});function Xp({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:a}){const o=n&&n.length>0;return S("div",{className:Kp,children:[S("div",{className:_p,children:[o?E(jp,{selectedAccount:t,setSelectedAccount:a,mergeDestination:Vp,bankAccounts:n,isFilling:r,warningMessage:zp(Vp,e,t??null)}):E(Wp,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),S("div",{className:Gp,children:[E("div",{className:Zp,children:E(Ec,{Component:fo})}),E("div",{className:Qp,children:E(Ec,{Component:Ju})})]}),E(Fp,{accountName:e.name,accountNo:e.mask,institutionId:e.integration.apiInstitutionId??""})]}),E("div",{className:Yp,children:E(ci,{alignment:"horizontal"})})]})}const Jp=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await jo(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Oi({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:a}};function $p(){return Rn({queryKey:["expenses/vendors"],queryFn:Jp})}const eg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:Rr(n)};return await Er(r)},tg=St(zt({body:"default"}),Et({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),ng=Et({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),rg=Et({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"});function ag({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:a,inputRef:o}){return S("div",{className:ng,children:[E("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:tg}),E("button",{type:"button",onClick:r,className:rg,children:E(ha,{children:"Add"})})]})}function og({promptText:e,placeholderText:t,onSubmit:n}){const[r,a]=f(!1),[o,i]=f(""),l=p(null);return k(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),E(fu,{onClick:r?void 0:()=>{a(!0)},children:r?E(ag,{placeholder:t,value:o,onChange:i,onSubmit:()=>{o.trim()&&(n(o.trim()),i(""),a(!1))},onCancel:()=>{i(""),a(!1)},inputRef:l}):E(Mh,{promptText:e})})}const ig={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function lg({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:a}){const o=g(()=>new xe(e??[],ig),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Tu,{}):S(I,{children:[E(og,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:a}),0===i.length?E(ku,{text:"No results found"}):i.map(e=>E(fu,{onClick:()=>n(e),children:E(pl,{children:e.name})},e.id))]})}function sg({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?E(Tu,{}):S(I,{children:[E(og,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>E(fu,{onClick:()=>t(e),children:E(pl,{children:e.name})},e.id))]})}function cg({onClick:e}){const{query:{data:t,isLoading:n}}=$p(),{mutate:r}=hd({mutationFn:eg,onSuccess:async()=>Sn.invalidateQueries({queryKey:["expenses/vendors"]})}),a=t?.data??[];return E(su,{onClick:e,placeholder:"Search vendors...",SearchList:lg,DefaultList:sg,extraProps:{vendors:a,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:a.length})}const dg=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await jo(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Oi({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:a}};function ug(){return Rn({queryKey:["clientMgmt/clients"],queryFn:dg})}const hg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:Rr(n)};return await Er(r)},pg={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function gg({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:a}){const o=g(()=>new xe(e??[],pg),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Tu,{}):S(I,{children:[E(og,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:a}),0===i.length?E(ku,{text:"No results found"}):i.map(e=>E(fu,{onClick:()=>n(e),children:E(pl,{children:e.name})},e.id))]})}function mg({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?E(Tu,{}):S(I,{children:[E(og,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>E(fu,{onClick:()=>t(e),children:E(pl,{children:e.name})},e.id))]})}function vg({onClick:e}){const{query:{data:t,isLoading:n}}=ug(),{mutate:r}=hd({mutationFn:hg,onSuccess:async()=>Sn.invalidateQueries({queryKey:["clientMgmt/clients"]})}),a=t?.data??[];return E(su,{onClick:e,placeholder:"Search customers...",SearchList:gg,DefaultList:mg,extraProps:{customers:a,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:a.length})}function bg({frequencies:e,onClick:t}){const n=Sl();return E(Wl,{children:E(ou,{children:e.map(e=>E(fu,{onClick:()=>(t(e),void n.setOpen(!1)),children:E(da,{children:e.name})},e.value))})})}const{useAppForm:fg,withForm:yg}=ye({formContext:Id,fieldContext:Sd,formComponents:{SaveButton:Dd},fieldComponents:{DiscreteAmountField:function({label:e}){const t=p(null),n=Nd();return E(qd,{inputRef:t,label:e,children:E(Gd,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const n=p(null),r=Nd();return E(Xd,{inputRef:n,label:e,children:E(Gd,{value:r.state.value,onChange:r.handleChange,inputRef:n,autofocus:t})})},ExpenseCategoryField:function({category:e,onClick:t,childrenField:n,totalAmount:r,glAccount:a}){const o=()=>{const t=Math.floor(r/2*100)/100,o=r-t;n?.pushValue({amount:t,category:e,classSegments:[],glAccount:a}),n?.pushValue({amount:o,category:e,classSegments:[],glAccount:a})};return S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>S(Xd,{label:"Category",popupTriggerProps:t,children:[S("button",{...Zu,type:"button",children:[E(Ec,{Component:Ku(e?.name)}),E(da,{children:e?.name||"Uncategorized"})]}),n&&E(Gu,{onClick:o})]})}),E(Bu,{onClick:t})]})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:a=!1}){const o=Nd(),i=fe(o.store,e=>e.meta.isDefaultValue),l=p(null),[s,c]=f(()=>o.state.value?dn(o.state.value):/* @__PURE__ */new Date),d=o.state.value?dn(o.state.value):null,[u,h]=f(""),g=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=pn(hn(a,t),n):t?e=hn(a,t):n&&(e=pn(a,n)),o.handleChange(un(e)),c(e)}else o.handleChange("")},m=u||(d?ln(d):""),[v,b]=f(!1),y=e=>{v&&(()=>{if(d&&!i){const e=cn(u);(t&&e&&on(e,t)||n&&e&&on(n,e))&&h(ln(d))}})(),b(e)},k=e=>{"Enter"===e.key&&(e.preventDefault(),y(!v))},x=a?Xd:qd;return S(Il,{placement:"bottom-start",onOpenChange:y,open:v,children:[E(Nl,{children:t=>E(x,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>b(!0),children:E("input",{...gh,ref:l,type:"text",id:o.name,value:m,onChange:g,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:k,autoComplete:"off"})})}),E(Wl,{initialFocus:!1,children:E(ph,{selectedDate:d,onDateSelect:e=>{o.handleChange(un(e)),h(ln(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=Nd(),o=p(null);return E(Xd,{label:e,inputRef:o,children:E("textarea",{...mh,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:Ih,SplitExpenseCategoryField:function({value:e,onChange:t}){return S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>S("button",{...Sh,...t,type:"button",children:[E(Ec,{Component:Ku(e?.name)}),E(da,{stylists:[Nh],children:e?.name||"Uncategorized"})]})}),E(Bu,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,a]=f(!1);return E("div",{...Ph,"data-clicked":r,children:E(Gd,{value:e,onChange:t,onClick:()=>a(!0),onBlur:()=>(a(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Nd(),r=Hh(t.id),{query:{data:a},isFilling:o}=ld({select:e=>({...e,data:zh(e?.data)})}),i=a?.data,l=yn(e)||!Rh(e);return E(Wh,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:o})},GlAccountField:function(){const e=Nd(),t=e.state.value;return S(Il,{placement:"bottom-start",children:[E(Nl,{children:e=>E(Xd,{label:"Account",popupTriggerProps:e,children:E("button",{...vp,type:"button",children:E(da,{children:ip(t.accountNo,t.name)})})})}),E(mp,{onClick:t=>{const n=op(t);e.handleChange(n)},types:rp})]})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Nd(),{query:{data:r}}=Xh(),a=function(e){const{query:t}=ld({select:t=>({...t,data:Vh(t.data,e)})});return t.data?.data}(t?.id),{query:{data:o},isFilling:i}=ld({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?Td(e.amount):"";return E(Wh,{label:s,onClick:e=>{const t=(a=r,o=e,a?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===o.glAccountId?.split("_")[1]));var a,o;t&&n(op(t))},bankAccount:a,bankAccountOptions:l,isFilling:i})},MatchingBankTransferField:function({transaction:e}){const t=Nd(),n=t.state.value,r=n?Dh(n):"Select",a=n?[]:[xp];return S(Il,{placement:"bottom-start",children:[E(Nl,{children:e=>E(Xd,{label:"Matching Bank Transfer",popupTriggerProps:e,children:E("button",{...kp,children:E(da,{stylists:a,children:r})})})}),E(yp,{onClick:e=>{const n={id:(r=e).id,description:r?.description,amount:r?.amount,date:r?.date,bankAccountId:r?.bankAccount?.id,apiName:r?.apiName};var r;t.handleChange(n),t.handleBlur()},transactionId:e?.id})]})},ButtonGroupField:function({label:e,options:t}){const n=Nd(),r=t.find(e=>e.value===n.state.value);return E(Xd,{label:e,disableHover:!0,children:E(Ep,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Ep,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=Nd();return S(Il,{placement:"bottom-start",children:[E(Nl,{children:a=>E(Xd,{label:t,popupTriggerProps:a,disabled:n,children:E("button",{...Sp,type:"button",children:r.state.value?E(da,{children:Pp(e,r.state.value)}):E(da,{stylists:[Np],children:`Select ${t}...`})})})}),E(Ip,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:a="Enter value..."}){const o=Nd(),i=p(null);return E(Xd,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:E("input",{className:Rp,value:o.state.value,onChange:e=>o.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:a})})},BulkMergeAccountRowField:Xp,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const a=p(null),o=r?Xd:qd;return S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>E(o,{inputRef:a,label:e,popupTriggerProps:t,children:E(da,{children:n?.name??"Select a vendor..."})})}),E(cg,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const a=p(null),o=r?Xd:qd;return S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>E(o,{inputRef:a,label:e,popupTriggerProps:t,children:E(da,{children:n?.name??"Select a customer..."})})}),E(vg,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=p(null),a=`${n?.name??Ti[0].name}`;return S(Il,{placement:"bottom-start",children:[E(Nl,{children:t=>E(Xd,{inputRef:r,label:e,popupTriggerProps:t,children:E(da,{children:a})})}),E(bg,{frequencies:Ti,onClick:t})]})}}});const kg=[Ut(null,Et({"& path":{stroke:"icon.base"}}))];function xg({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return S(ol,{type:"button",onClick:n,children:[e&&E(Co,{Component:Pl,stylists:kg}),E(da,{children:t})]})}const Tg=Et({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),wg=Et({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),Cg=Et({maxWidth:"600px"}),Ag=Et({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),Eg=Et({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Ig=Et({display:"flex",justifyContent:"flex-start",alignItems:"center"}),Sg=Et({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),Ng=Et({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),Pg=Et({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),Rg=e=>{jd(e),zd(e)};function Dg({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:a}=ld(),o={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=yd(),a=An(),o=Pn(),i=kn(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,xi({queryKey:fn(Ai({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:Ii,accessToken:n,environment:r}))}),fg({defaultValues:l,onSubmit:async e=>{if(await Ad()===jc){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!a)return void(await Ed());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=fn(Ai({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),a=await ki({queryKey:r,queryFn:Ii,accessToken:t,environment:n});return a?.data?.[0]?.date}(t.id,a,o);var r,i,l;return un((r=dn(e.tranStartDate||""),i=dn(n||""),l=dn(e.tranMinStartDate||""),yn(i)?r:kn(l)?pn(i,l):(kn(r)&&pn(i,r),r)))})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...wd(t),duplicateBankAccountIds:[Li(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await Ed()}}},onSubmitInvalid:()=>{}})}(o,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return S("form",{className:Tg,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:Rg,children:[S("div",{className:wg,children:[E(da,{children:"Merge Accounts"}),E("div",{className:Cg,children:E(pl,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),S("div",{className:Ag,children:[S("div",{className:Eg,children:[E("div",{className:Ig,children:E(da,{children:"Duplicate Account"})}),E("div",{className:Sg,children:E(da,{children:"Into"})}),E("div",{className:Ng,children:E(da,{children:"Destination Account"})})]}),E(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>E(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)&&kd(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return E(Xp,{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))})]}),E("div",{className:Pg,children:E(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return S(I,{children:[E(xg,{showIcon:!1,onClick:()=>n()}),E(ud,{onClick:()=>i.reset(o),disabled:!t,children:E(da,{children:"Clear Selections"})}),E(Dd,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const Mg=Et({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"}),Og=me.createConfirmation(ve(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const a=n?n.map(e=>e.destinationAccount):r;return E(Gc,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:E("div",{className:Mg,children:E(Dg,{destinationAccounts:a,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function Lg({plaidItemAccounts:e,matchingAccountPairs:t}){await Og({matchingAccountPairs:t,plaidItemAccounts:e})}const Bg=Et({display:"flex",flexDirection:"column",gap:"12px"}),Fg=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:Lc(n)},{url:a,headers:o}=Tr(r);return Vo({url:a,includeCredentials:!0,extraHeaders:o,params:t?{plaidItemId:t}:void 0})}({plaidItemId:e,accessToken:t,environment:n});return r.link_token?(gr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(mr({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),ad("NO_LINK_TOKEN"))}catch(r){return mr({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),ad("LINK_TOKEN_FAILED")}};async function Ug(e,t,n){const r=await async function(e,t){const n=fn(Rc({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await ki({queryKey:n,queryFn:Dc,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function Wg(e,t,n,r){gr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||gr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const a=await async function(e,t,n){if(e){r=t,a=n,xi({queryKey:fn(["banks/accounts",{}],{}),queryFn:id,accessToken:r,environment:a});const o=await Ug(e,t,n);if(o){const e=await sd(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:Lc(r)},{url:o,headers:i}=Tr(a);return await wr({url:o,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(gr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([Sn.invalidateQueries({queryKey:["integrations"]}),Sn.invalidateQueries({queryKey:["banks/accounts",{}]}),Sn.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=kn(e.apiErrorType)&&kn(e.apiErrorCode),n="RELINK"===ac({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(o))return mr({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 sd(n,r),s=i?.data?.filter(e=>kd(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?(mr({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await Jc({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:qc,label:"Cancel"},{key:zc,label:"Chat",type:Qc}]})===zc&&nd(`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`)}(o||"my bank")):void mr({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 mr({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),Jc({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${o} account.`,buttons:[{key:qc,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return mr({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 Jc({title:"All set! Ready to track your transactions?",body:S("div",{className:rd,children:[E(pl,{wrap:"wrap",children:`Your ${n} ${t} ${$c("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),E(pl,{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.`}),E("ul",{children:e.map(e=>E("li",{children:E(pl,{wrap:"wrap",children:td(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:zc,label:"Get Started",type:Qc}]})}(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:cd(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 Jc({title:"Your transactions are being categorized",body:S("div",{className:Bg,children:[E(pl,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),E(pl,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),S("ul",{children:[r.map(({duplicateAccount:e})=>E("li",{children:E(pl,{wrap:"wrap",children:td(e?.name??"",e?.mask??"")})},e?.id)),a&&E("li",{children:E(pl,{wrap:"wrap",children:"and more..."})})]}),E(pl,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:qc,label:"No thanks"},{key:zc,label:"Review",type:Qc}]})===zc&&await Lg({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:o??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(mr({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=o,u=e.plaidItemAccounts.length,Jc({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${$c("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:zc,label:"Get started",type:Qc}]})):void 0;var d,u}(o,a,t,e,s),{}}catch(a){return mr({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:a}}),await async function(e){await Jc({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:qc,label:"Cancel"},{key:zc,label:"Chat",type:Qc}]})===zc&&nd(`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`)}(t.institution?.name||"my bank"),{}}}async function Vg(e,t,n){return yn(e)?(gr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(gr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(mr({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&&(mr({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 Jc({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:qc,label:"Cancel"},{key:"chat",label:"Chat"},{key:zc,label:"Banks & Integrations",type:Qc}]});"chat"===t?nd("Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!"):t!==zc||(e=>{const t=We.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||fi("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const Hg="PLAID_LINK_NEW",qg="PLAID_LINK_UPDATE",jg="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 Kg=m({});function Yg({onPlaidLink:e,children:t}){return E(Kg.Provider,{value:{onPlaidLink:e},children:t})}function _g(){return v(Kg)}async function Gg(e){const{url:t,headers:n}=Tr(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:a}=e,o=yr({extraHeaders:n,authorization:t});gr("HTTP DELETE Request",{url:a,accessToken:t});try{const e=await fetch(a,{method:"DELETE",headers:o,credentials:"include",body:JSON.stringify(r)});return gr("HTTP DELETE Response",{url:a,status:e.status,statusText:e.statusText}),kr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const Zg=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:Rr(n)};return await Er(r)};function Qg(){return hd({mutationFn:Zg,onSuccess:()=>{const e=["integrations"];return Sn.invalidateQueries({queryKey:e})}})}const Xg=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:Rr(t)};return await Er(n)};function Jg(){return hd({mutationFn:Xg,onSuccess:()=>{const e=["integrations"];return Sn.invalidateQueries({queryKey:e})}})}const $g=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String(Li(e.id)),removeFromApi:!0},accessToken:t,endpointManager:Rr(n)};return await async function(e){return Gg(e)}(r)};function em(){const{mutate:e}=Jg();return hd({mutationFn:$g,onSuccess:()=>{const e=["integrations"];return Sn.invalidateQueries({queryKey:e})},onError:async t=>{mr({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await Jc({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:qc,label:"Cancel"},{key:zc,label:"Try Again",type:Qc}]})===zc&&e()}})}function tm(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)=>{gr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function nm(e,t,n,r){const a=await Fg(e,t,n);if(!a)return;const o=await tm(a);if("success"===o?.status){const{public_token:e,metadata:a}=o;gr("Plaid link successful",{public_token:e,metadata:a});const i=await Wg(e,a,t,n);if(i.relinkPlaidItemId)return nm(i.relinkPlaidItemId,t,n,r)}else if("exit"===o?.status){const{metadata:e,error:t}=o;gr("Plaid link exited",{metadata:e,error:t}),await Vg(t,e,a)&&r()}else mr({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:o,token:a}})}function rm(){const[e,t]=Pc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=An(),r=Pn(),{mutate:a}=Jg(),{onPlaidLink:o}=_g();return{linkPlaid:e=>{if(kn(o)){const t=zg(e);o(t)}else nm(e.plaidItemId?Li(e.plaidItemId):void 0,n,r,a)},loading:e||kn(t),hasOnPlaidLinkOverride:kn(o)}}function am(){const[e,t]=Pc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=An(),r=Pn(),{mutate:a}=Jg(),{apiPartnerName:o}=v(es),{onPlaidLink:i}=_g();return{linkPlaid:e=>{if(kn(i)){const t=zg(e);i(t)}else!async function(e,t,n,r,a){const o=await Fg(e,t,n);if(!o)return;const i=await tm(o);if("success"===i?.status){const{public_token:e,metadata:o}=i;gr("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 Ug(t.institution.institution_id,n,r);if(i)return mr({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(o=a,Jc({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:qc,label:"Cancel"},{key:zc,label:"Relink",type:Qc}]}))===zc?{relinkPlaidItemId:Li(i.id)}:{}}var o;return gr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),Wg(e,t,n,r)}(e,o,t,n,r);l.relinkPlaidItemId&&nm(l.relinkPlaidItemId,t,n,a)}else if("exit"===i?.status){const{metadata:e,error:t}=i;gr("Plaid link from search exited",{metadata:e,error:t}),await Vg(t,e,o)&&a()}}(e.plaidItemId?Li(e.plaidItemId):void 0,n,r,o,a)},loading:e||kn(t),hasOnPlaidLinkOverride:kn(i)}}const om=Ut(null,_i,Et({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"}}}}),yo);function im(){const{linkPlaid:e,loading:t}=rm();return S("button",{onClick:()=>e({plaidEvent:Hg,message:"Tile Plaid Link button pressed"}),...om,disabled:t,children:[E(Ec,{Component:Ac}),E(pl,{intent:"primary",children:"Link Account"})]})}const lm=Et({width:266,minHeight:32});function sm(){return E(Ua,{styles:lm})}const cm=Et({backgroundColor:"money.positive.weak"}),dm=Et({backgroundColor:"money.negative.weak"}),um=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),hm=({defaultRange:e=Qt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:a}=function({filter:e}){return Or({filter:e,select:Cc})}({filter:e});let o;return o=t?Za:r??um,S(jr,{isSample:t,children:[E(Wr,{title:"Profit + Loss"}),E(Hr,{children:a?S(Va,{children:[E(sm,{}),E(sm,{})]}):S(I,{children:[E(Jr,{title:oa(o.netIncome),label:"Profit"}),S(ea,{children:[E(Tc,{amount:o.income,total:o.absoluteSum,colorCss:cm,label:"Income"}),E(Tc,{amount:o.expenses,total:o.absoluteSum,colorCss:dm,label:"Expenses"})]})]})}),t&&E(Ya,{size:"sm"}),n&&E(im,{})]})},pm=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],gm={moneyIn:0,moneyOut:0,netMoneyIn:0};const mm=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,a=t[3].environment,o={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...$t(n.filter)},accessToken:r,endpointManager:Rr(a)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||yn(n)||yn(n.operatingActivities)||!n.operatingActivities.children?gm:function(e){let t=new L(0),n=new L(0);for(const r of e.children)r.total<0?n=n.plus(L(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await Er(o))},vm=Et({backgroundColor:"money.positive.weak"}),bm=Et({backgroundColor:"money.negative.weak"}),fm=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),ym=({defaultRange:e=Qt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:a},isFilling:o}=function({filter:e}){return Rn({queryKey:pm({filter:e}),queryFn:mm})}({filter:e});let i;i=t?Xa:r??fm;let l=0;return(t||a)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),S(jr,{isSample:t,children:[E(Wr,{title:"Cash Flow"}),E(Hr,{children:o?S(Va,{children:[E(sm,{}),E(sm,{})]}):S(I,{children:[E(Jr,{title:oa(i.netMoneyIn),label:"Change in Cash"}),S(ea,{children:[E(Tc,{amount:i.moneyIn,total:l,colorCss:vm,label:"Money In"}),E(Tc,{amount:i.moneyOut,total:l,colorCss:bm,label:"Money Out"})]})]})}),t&&E(Ya,{size:"sm"}),n&&E(im,{})]})},km=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),xm=Ut(null,Et({display:"flex",justifyContent:"end"}));function Tm({color:e,bulletLabel:t,moneySummary:n}){return S("div",{...km,children:[E(ka,{color:e,label:t}),E("div",{...xm,children:E(pl,{children:n})})]})}const wm={total:0,children:[]},Cm=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||yn(n)||yn(n.expenses)||!n.expenses.children?wm:{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},Am=Ut(null,Et({display:"flex",gap:"10px",alignItems:"center"})),Em=Et({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),Im=Ut(null,Em);function Sm({bulletAmount:e=3,shimmer:t=!1}){return E(I,{children:Array.from({length:e},(e,n)=>S("div",{...Am,children:[E(ka,{color:va.var("colors.brand.secondary")}),t?E(Ua,{styles:Em}):E("div",{...Im})]},n))})}const Nm=Ut(null,Et({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),Pm=[va.var("colors.brand.primary"),va.var("colors.brand.success"),va.var("colors.brand.action")],Rm=Object.freeze({total:0,children:[]});function Dm({defaultRange:e=Qt.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const a=We(e=>e.externalOptions).dataVisualizationColors??Pm,{query:{data:o},isFilling:i}=function({filter:e}){return Or({filter:e,select:Cm})}({filter:e});let l;l=n?Qa:o??Rm;const s=void 0===t?"Total Expenses":`${tn[t]} Total`,c=l.children.length>0;return S(jr,{isSample:n,children:[E(Wr,{title:"Expenses"}),E(Hr,{children:i?E(Va,{children:E(Sm,{shimmer:!0})}):S(I,{children:[E("div",{...Nm,children:E(Jr,{title:oa(l.total),label:s})}),E(ea,{children:c?l.children.map((e,t)=>E(Tm,{color:a[t],bulletLabel:e.name,moneySummary:oa(e.total)},t)):E(Sm,{})})]})}),n&&E(Ya,{size:"sm"}),r&&E(im,{})]})}const Mm=Ut(null,Et({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Om({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:a}){const o=(i=e.month,{beginDate:Gt(l=e.year,i,1),endDate:Gt(l,i+1,0)});var i,l,s,c,d,u,h,p;return S("div",{...Mm,children:[S(Vt,{children:[E(Yt,{children:"Monthly Review"}),E(uc,{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})]}),S(pc,{children:[E(hm,{defaultRange:o,isSample:r,showLinkAccountButton:a}),E(ym,{defaultRange:o,isSample:r,showLinkAccountButton:a}),E(Dm,{defaultRange:o,monthIndex:e.month,isSample:r,showLinkAccountButton:a})]})]})}const Lm="Oldest to Newest",Bm="Newest to Oldest",Fm="A-Z",Um="Z-A",Wm="Lowest to Highest",Vm="Highest to Lowest",Hm="A-Z",qm="Z-A";function jm(){const[e,t]=f(void 0),n=g(()=>{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 wi)??!1,n=(e.direction&&e.direction in Ci)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const zm=Et({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"}}}),Km=Et({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Ym=Et({background:"brand.primary.strong",border:"none"});function _m({checked:e,onClick:t}){const[n,r]=f(e??!1),a=void 0===e?n:e;return E("button",{...Ut(Dt["checkbox-input"],zm,a?Ym:Km,ko),type:"button",onClick:a=>{void 0===e&&r(!n),t&&t(a)},"data-is-checked":a,children:a&&E(Rl,{Component:Rd})})}const Gm=Ut(null,Et({paddingLeft:"20px",paddingRight:"5px"}));function Zm({checked:e,onClick:t}){return E("div",{...Gm,children:E(_m,{checked:e,onClick:t})})}const Qm=Ut(Dt.text,Et({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),zr);function Xm({children:e}){return E("div",{...Qm,children:e})}const Jm=Ut(Dt["date-cell"],Et({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function $m({date:e,annotation:t}){return S("div",{...Jm,children:[t&&E(Xm,{children:t}),E(pl,{children:e})]})}const ev=Et({color:"money.negative"}),tv=Et({color:"money.positive"}),nv=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>xn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" ");function rv({transaction:e}){const t=(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?tv:ev}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?ev:tv}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?ev:tv};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?ev:tv};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:ev};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=tv;return e.amount<0&&(t="Invoice Payment Refund",n=ev),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:nv(e.type),css:e.amount<0?ev:tv}))(e)}return t})(e),n=Ut(Dt["transaction-type-label"],t.css),r=E("span",{...n,children:t.displayName});return E($m,{date:e.date,annotation:r})}function av({label:e,subLabel:t}){return S(I,{children:[E(da,{children:e}),E(ha,{children:t})]})}function ov({bankTransaction:e}){return E(av,{label:e.description,subLabel:e.bankAccount?.name})}function iv(e){return new L(e).div(100).toNumber()}function lv(e){return new L(e).times(100).toNumber()}function sv(e){return ia(iv(e.amount))}function cv({transaction:e}){return E(pl,{children:sv(e)})}const dv=Ut(null,Et({padding:"0 25px",height:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}));function uv({annotation:e,accountName:t}){return S("div",{...dv,children:[e&&E(ha,{children:e}),t&&E(da,{children:t})]})}const hv=Ut(Dt["cell-button"],Et({border:"none",backgroundColor:"transparent",padding:"0 25px",gap:"10px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"row",flex:1,outline:"none",borderRadius:"md",boxShadow:"0 0 0 0 transparent","&:focus-visible":{transition:"none",position:"relative"},"&:focus-visible::before":{content:"''",position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"md",outline:"4px solid",outlineColor:"border.layout",pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.hover"},"&[data-state='open']":{backgroundColor:"surface.intent.action.active"},"& .Tight-text":{position:"relative"},"& .Tight-text::after":{content:"''",position:"absolute",bottom:0,left:0,width:0,height:"1px",backgroundColor:"currentColor",transition:"width 100ms ease-out",_supportHover:{width:"100%",transition:"width 300ms ease-out"}},"&[data-state='open'] > .Tight-text::after":{width:"100%",transition:"width 300ms ease-out"}}),ko),pv=T(function({children:e,...t},n){return E("button",{ref:n,...hv,...t,children:e})}),gv=async({data:e,accessToken:t,environment:n})=>vv({data:{data:e},accessToken:t,environment:n}),mv=async({data:e,accessToken:t,environment:n})=>gv({data:[e],accessToken:t,environment:n}),vv=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:co(n)};return await Ar(r)};function bv(){return hd({onSuccess:async()=>{const e=["banks/transactions"];return gr("mutation successful, invalidating BT queries"),Sn.invalidateQueries({queryKey:e}).catch(e=>mr({error:e,severity:"error"}))},mutationFn:gv})}function fv(){return hd({onSuccess:async()=>(gr("mutation successful, invalidating BT queries"),Sn.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>mr({error:e,severity:"error"}))),mutationFn:mv})}function yv({transaction:e,parentTransaction:t,accountNo:n,accountName:r}){const{startPrefetch:a,cancelPrefetch:o}=Ko({prefetchFn:Bo(_h,Gh)}),{mutate:i}=fv(),l=void 0!==t;return S(Il,{placement:"bottom-start",children:[E(Nl,{children:e=>E(pv,{...e,onMouseEnter:a,onMouseLeave:o,children:E(da,{children:ip(n,r)})})}),E(mp,{onClick:l?n=>{if(n?.id&&l){const{id:r,children:a}=t,{id:o}=e,l=a.map(e=>e.id===o?{...e,glAccountId:n.id.toString()}:e);i({id:r,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:rp})]})}function kv({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=Ko({prefetchFn:Bo(cu,du)}),a=e.category?.name??"Uncategorized",{mutate:o}=fv(),i=void 0!==t;return S(Il,{placement:"bottom-start",children:[E(Nl,{children:e=>S(pv,{...e,onMouseEnter:n,onMouseLeave:r,children:[E(Ec,{Component:Ku(a)}),E(da,{children:a})]})}),E(Bu,{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()})}})]})}const xv=Ut(null,Et({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Tv=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function wv({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),n=new Set(t),r=[...n].join(", "),a=$c("Category","Categories",n.size,!0);return E(fl,{children:S("div",{...Tv,children:[E(Ec,{Component:Yu}),S("div",{...xv,children:[E(da,{children:a}),E(ha,{children:r})]})]})})}function Cv({transaction:e,parentTransaction:t}){return e.children?.length>0?E(wv,{transaction:e}):E(kv,{transaction:e,parentTransaction:t})}function Av({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return E(Cv,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return E(uv,{annotation:Td(e.amount),accountName:e.bankAccount?.name});default:return E(yv,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Ev({name:e}){return E(I,{children:e&&E(pl,{children:e})})}const Iv={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"},Sv=[{name:"Partner Review Required",value:Iv.PARTNER_REVIEW_REQUIRED},{name:"User Review Required",value:Iv.USER_REVIEW_REQUIRED},{name:"Accountant Review Required",value:Iv.ACCOUNTANT_REVIEW_REQUIRED},{name:"Reconciliation Staged",value:Iv.RECONCILIATION_STAGED},{name:"Reconciled",value:Iv.RECONCILED},{name:"Reconciliation Discrepancy",value:Iv.RECONCILIATION_DISCREPANCY}],Nv=vo(e=>h.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),Pv=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),Rv=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),Dv=Et({maxWidth:"100%",width:"fit-content",display:"inline-flex",padding:"4px 5px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{},"& .Tight-sub-label":{color:"typography.base"},"& .Tight-medium-icon > path":{stroke:"icon.base"}}),Mv=Et({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary"},_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}}}),Ov=Et({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}}}),Lv=Et({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success"},_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}}}),Bv=Et({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning"},_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}}}),Fv=Et({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger"},_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}}}),Uv=Ut(Dt.badge,Dv),Wv=Ut(null,Yr),Vv=Ut(null,ko),Hv=Ut(Dt["neutral-badge"],Mv),qv=Ut(Dt["highlight-badge"],Ov),jv=Ut(Dt["success-badge"],Lv),zv=Ut(Dt["warning-badge"],Bv),Kv=Ut(Dt["critical-badge"],Fv);function Yv({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:a}){let o;switch(e){case"critical":o=Kv;break;case"warning":o=zv;break;case"neutral":o=Hv;break;case"success":o=jv;break;case"highlight":o=qv}const i=jt([Uv,Wv,o,Vv]);return E("button",{...i,onClick:n,disabled:r,...a,children:t})}const _v=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],Gv=[{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 Zv({onClick:e}){const t=Sl(),{userRole:n}=v(es),r=(e=>{switch(e){case"OWNER":default:return _v;case"ACCOUNTANT":return Gv}})(n)||[];return E(Wl,{children:E(ou,{children:r.map(({status:n,displayName:r})=>E(fu,{onClick:()=>(e(n),void t.setOpen(!1)),children:r},n))})})}function Qv({status:e,transactionId:t}){const[n,r]=f(!1),{mutate:a}=fv(),o=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=v(es),{text:s,type:c,Icon:d}=((e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Iv.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===Iv.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===Iv.ACCOUNTANT_REVIEW_REQUIRED),a=((e,t)=>"ACCOUNTANT"===t&&e===Iv.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=E(Ec,{Component:Rv}),d="neutral"):a?(s="Pending User Review",c=E(Ec,{Component:Rv}),d="neutral"):n?(s="Needs Review",c=E(Ec,{Component:Nv}),d="warning"):o?(s="Discrepancy",c=E(Ec,{Component:Md}),d="critical"):i?(s="Reconciled",c=E(Ec,{Component:Pv}),d="success"):(s="Processing",c=E(Ec,{Component:Rv}),d="neutral"),{text:s,type:d,Icon:c}})(e,l);return!t||((u=t).startsWith(Di.TRANSACTION_LINE_ITEM)||u.startsWith(Di.PROCESSOR_TRANSACTION))?null:S(Il,{open:n,blockInteraction:!1,onOpenChange:o,enableClickMiddleware:!1,children:[E(Nl,{children:e=>S(Yv,{type:c,popupTriggerProps:e,onClick:i,children:[d,E(ha,{children:s})]})}),E(Zv,{onClick:e=>{a({id:t,reviewStatus:e}),o()}})]});var u}function Xv({status:e,transactionId:t}){return E(Qv,{status:e,transactionId:t},t)}const Jv=vo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2940)"},h.createElement("path",{d:"M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997",stroke:"#182428",strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_9779_2940"},h.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowUp");function $v({row:e}){const t=e.getIsExpanded();return e.getCanExpand()?E(_l,{"aria-label":t?"Collapse row":"Expand row","aria-expanded":t,children:E(Co,{Component:t?Jv:Ju})}):E(_l,{active:!1,children:E(Co,{Component:fo})})}function eb({row:e}){return E($v,{row:e})}const tb=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),nb=Ut(null,Et({stroke:"icon.base.weak"}));function rb({hasConversation:e,hasUnread:t=!1}){return E(I,{children:e?E(Fs,{hasUnread:t}):E("div",{"data-testid":"no-conversations-dash",children:E(Rl,{Component:tb,stylists:[nb]})})})}function ab({conversationId:e}){const{query:{data:t}}=$o(e??null),{startPrefetch:n,cancelPrefetch:r}=ti(),{startPrefetch:a,cancelPrefetch:o}=Vi(),i=kn(t),l=i&&"READ"==t?.readStatus,s=y(()=>{kn(e)&&(n({id:e}),a({id:e}))},[e,n,a]),c=y(()=>{kn(e)&&(r(),o())},[e,r,o]);return E("div",{onMouseEnter:s,onMouseLeave:c,children:E(rb,{hasConversation:i,hasUnread:!l})})}const ob=_(),ib=[ob.display({id:He.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?E(Zm,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),ob.accessor("date",{id:He.DATE,cell:e=>E(fl,{children:E(rv,{transaction:e.row.original})}),header:()=>E(Xl,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Lm,sortDescDisplay:Bm}),size:130,maxSize:144}),ob.accessor("description",{id:He.DESCRIPTION,cell:e=>E(fl,{children:E(ov,{bankTransaction:e.row.original})}),header:()=>E(Xl,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Fm,sortDescDisplay:Um}),size:180}),ob.accessor("amount",{id:He.AMOUNT,cell:e=>E(fl,{children:E(cv,{transaction:e.row.original})}),header:()=>E(Xl,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:Wm,sortDescDisplay:Vm}),size:130,maxSize:180}),ob.accessor("category.id",{id:He.CATEGORY,cell:({row:e})=>E(Av,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>E(Xl,{columnName:"Category"}),size:130,meta:{clickable:!0}}),ob.accessor(e=>e.classSegments[0]?.id,{id:He.CLASS_SEGMENT,cell:e=>E(fl,{children:E(Ev,{name:e.row.original.classSegments[0]?.name})}),header:()=>E(Xl,{columnName:"Business"}),size:130}),ob.accessor("reviewStatus",{id:He.REVIEW_STATUS,cell:e=>E(fl,{children:E(Xv,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>E(Xl,{columnName:"Reviewed",sortDef:"REVIEW_STATUS",sortAscDisplay:Hm,sortDescDisplay:qm}),size:130,maxSize:160,meta:{clickable:!0}}),ob.display({id:He.COMMENTS,cell:e=>{const t=e.row.original;return E(fl,{alignVariant:"center",children:E(ab,{conversationId:t.conversation?.id})})},header:()=>E(Xl,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),ob.display({id:He.EXPAND,cell:e=>E(eb,{row:e.row}),size:40,maxSize:60})];function lb(e){return e?ib.filter(t=>e.includes(t.id)):ib}function sb(e){if(e)return Object.values(He).reduce((t,n)=>(t[n]=e.includes(n),t),{})}const cb=[];function db({transactions:e,columns:t}){return G({data:e??cb,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??cb.length,columns:lb(t),getCoreRowModel:Z(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,matchingBankTransaction:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],conversation:null};var t}),getExpandedRowModel:Q(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:t,columnVisibility:sb(t)}})}const ub=[He.COMMENTS,He.DATE,He.DESCRIPTION,He.AMOUNT,He.CATEGORY,He.REVIEW_STATUS];function hb(e,t){return fi("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function pb(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);if("comments"===e.column.id){const e=t.getParentRow();hb(e?.original.id??t.original.id,"conversation")}else if(!n||o)if(r)t.toggleExpanded();else{const e=t.getParentRow();hb(e?.original.id??t.original.id)}}function gb({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Ri(),a=y(()=>n({id:e.original.id}),[n,e.original]);return E(bi,{rowData:e,onMouseEnter:a,onMouseLeave:r,onCellClick:pb,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 mb(){return S(I,{children:[E(fs,{Component:Pv}),E(da,{wrap:"wrap",children:"All caught up"}),E(ha,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const vb=Ut(Dt["button-warning"],Et({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 bb({children:e,stylists:t=[],...n}){return E(rl,{stylists:[vb,...t],...n,children:e})}function fb(){const{linkPlaid:e,loading:t}=rm();return E(bb,{onClick:()=>e({plaidEvent:Hg,message:"Plaid Link button pressed"}),disabled:t,children:E(da,{children:"Link your bank"})})}const yb=Ut(null,Et({whiteSpace:"wrap"}));function kb(){return S(I,{children:[E(fs,{Component:Vu}),E(da,{stylists:[yb],children:"Your bank transactions will be categorized for you"}),E(ha,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),E(fb,{})]})}const xb=Et({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Tb(){return S(I,{children:[E("div",{className:xb,children:E(Ec,{Component:Rv})}),E(da,{children:"Transactions are being processed"}),E(ha,{children:"Any transactions that require review will show up here."})]})}const wb=Et({minWidth:"900px"});function Cb({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:a,transactions:o}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return db({transactions:e,columns:t?[...t,He.EXPAND]:void 0})}({transactions:e,columns:ub})}({transactions:o}),{query:{data:l},isFilling:s}=Si({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=!yn(l?.data?.[0])&&!s,d=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=E(mb,{})):r=E(Tb,{}):r=E(kb,{}),r}(e??!1,o.length>0,c);return S("div",{className:wb,children:[E("div",{id:ro}),S(wo.Provider,{value:a,children:[S(Vt,{children:[E(Yt,{children:"Transactions For Your Review"}),E(Cs,{children:E(No,{})})]}),E(cl,{dashboard:"businessOwnerDashboard",children:r?E(Lo,{}):S(I,{children:[E(dl.Provider,{value:{sortInstance:t,setSortInstance:n},children:E(oi,{headerGroups:i.getHeaderGroups()})}),yn(d)?E(li,{children:i.getRowModel().rows.map(e=>E(gb,{rowData:e,hasSelect:!1},e.id))}):E(bs,{children:d})]})})]})]})}function Ab(){const{sortInstance:e,setSortInstance:t,apiSort:n}=jm(),{query:{data:r},isFilling:a,paginationControls:o}=Si({filter:oo,sort:n,limit:10}),i=r?.data??lo,{hasPlaidLinkedBankAccount:l,isFilling:s}=jh();return E(Cb,{sortInstance:e,setSortInstance:t,isFilling:a||s,paginationControls:o,transactions:i,hasLinkedAccount:l??!1})}const Eb=Ut(Dt["button-action"],Et({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 Ib({children:e,stylists:t=[],...n}){return E(rl,{stylists:[Eb,...t],...n,children:e})}const Sb=vo(e=>h.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),h.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),Nb=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Os,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:Nv,buttonText:"Review"};case"LINK_BANK":return{Icon:Vu,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:Vu,buttonText:"Fix"};case"RELINK":return{Icon:Vu,buttonText:"Relink"};case"CHAT":return{Icon:Md,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Sb,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:Pv,buttonText:""};default:return{Icon:Md,buttonText:""}}},Pb=Ut(null,Et({display:"flex",alignItems:"center",gap:"15px"})),Rb=Ut(null,Et({width:"20px",height:"20px"}));function Db({title:e,type:t}){const{Icon:n}=Nb(t);return S("div",{...Pb,children:[E(Ec,{Component:n,stylists:[Rb]}),E(da,{wrap:"wrap",children:e})]})}const Mb=Ut(null,Et({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"5px",flex:"1 1 0",minWidth:"200px",width:"100%"}));function Ob({title:e,description:t,type:n}){return S("div",{...Mb,children:[E(Db,{title:e,type:n}),E(ha,{wrap:"wrap",children:t})]})}const Lb=Ut(Dt["banner-button"],Et({display:"flex",width:"202px",justifyContent:"flex-end",alignItems:"center",gap:"15px",flexShrink:"0"})),Bb=Ut(Dt["banner-button-text"]),Fb=Ut(Dt["banner-button-icon"]);function Ub({priority:e,type:t,handleClick:n}){const{buttonText:r}=Nb(t),{Button:a}=(e=>{switch(e){case"URGENT":return{Button:Wc};case"HIGH":return{Button:bb};case"MEDIUM":return{Button:Ib};default:return{Button:rl}}})(e);return S(a,{onClick:n,stylists:[Lb],children:[E(da,{stylists:[Bb],children:r}),E(Co,{stylists:[Fb],Component:fo})]})}const Wb=Pt({base:{display:"flex",flexDirection:"row",padding:"15px",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",minWidth:"350px",borderRadius:"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"}}}}),Vb=m({dimensions:{width:null,height:null}});function Hb(){const{dimensions:e}=v(Vb);return kn(e.width)&&e.width<parseInt(va("sizes.breakpoint-sm"))}const qb={HIGH:Dt["banner-high"],MEDIUM:Dt["banner-medium"],LOW:Dt["banner-low"],URGENT:Dt["banner-urgent"]};function jb({task:e,handleClick:t}){const{name:n,description:r,shortDescription:a,type:o,priority:i}=e,l=Hb()?a:r,s=Ut(Dt.banner,qb[i],Wb({priority:i}));return S("div",{...s,children:[E(Ob,{title:n,description:l,type:o}),E(Ub,{priority:i,type:o,handleClick:t})]})}function zb(e,t){nd(`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`)}function Kb(e,t,n,r,a){return()=>Jc({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:a})}function Yb(e,t,n,r,a,o){return{alert:Kb(e,t,a,o,[{key:qc,label:"Cancel"},{key:tc.CHAT,label:"Chat",type:Qc}]),actions:{[tc.CHAT]:()=>zb(t,r)}}}function _b(e){const{mutateAsync:t}=em(),n=An(),r=Pn(),{apiPartnerName:a}=v(es),o=Hb(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=rm(),{linkPlaid:c,loading:d}=rm();if(yn(e))return Yb(ac({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=ac({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case tc.DELETE_OR_RELINK:case tc.RELINK:return l?null:(g=i,m=a,b=o,{alert:Kb(u,(p=e).apiInstitutionName,m,b,[{key:qc,label:"Cancel"},{key:zc,label:"Relink",type:Qc}]),actions:{success:()=>{g({plaidEvent:qg,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case tc.UNLINK_RELINK:return d?null:function(e,t,n,r,a,o,i){return{alert:Kb(e,t.apiInstitutionName,a,o,[{key:qc,label:"Cancel"},{key:tc.CHAT,label:"Chat"},{key:zc,label:"Unlink and Relink",type:Qc}]),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"})},[tc.CHAT]:()=>zb(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,a,o,s);case tc.OPEN_BANK:return l?null:function(e,t,n,r,a,o,i,l){return{alert:Kb(e,t.apiInstitutionName,i,l,[{key:qc,label:"Cancel"},{key:tc.CHAT,label:"Chat"},{key:tc.RELINK,label:"Relink"},{key:zc,label:"Go To Bank",type:Qc}]),actions:{success:async()=>{const e=await Fc({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:a}),o=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(o,"_blank")},[tc.RELINK]:()=>{o({plaidEvent:qg,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[tc.CHAT]:()=>zb(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,a,o);case tc.UNLINK_ONLY:return function(e,t,n,r,a,o,i){return{alert:Kb(e,t.apiInstitutionName,a,o,[{key:qc,label:"Cancel"},{key:zc,label:"Unlink",type:Qc}]),actions:{success:()=>{i?r({plaidEvent:jg,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 Yb(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,a,o)}var p,g,m,b}const Gb=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){mr({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function Zb({task:e}){const{linkPlaid:t,loading:n}=rm(),{loading:r}=am(),a=_b(e?.meta?.plaidItem),o=n&&"RELINK"===e.type,i=r&&"LINK_BANK"===e.type&&!1,l="RELINK"!==e.type&&"LINK_BANK"!==e.type&&yn(a);return o||i||l?null:E(jb,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:qg,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?fi("NewConnection"):kn(a)&&(gr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),Gb(a))}})}const Qb=Ut(Dt.banner,Dt["banner-default"],Wb({priority:"DEFAULT"}));function Xb(){const e=Hb()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return E("div",{...Qb,children:E(Ob,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const Jb=Ut(Dt.banner,Dt["banner-default"],Wb({priority:"DEFAULT"}));function $b(){const e=Hb()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return E("div",{...Jb,children:E(Ob,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const ef=Et({width:"100%",height:72,minWidth:"300px"});function tf(){return S(I,{children:[E(Ua,{styles:ef}),E(Ua,{styles:ef}),E(Ua,{styles:ef})]})}function nf({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const a=e.length>0;return r?E(tf,{}):a?e.map(e=>{if(void 0===uo[e.type]||"ONBOARDING_FORM"===e.type&&yn(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(tc).includes(e.type))return E(Zb,{task:e},e.id);const n=e.actionLink,r=kn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return E(jb,{task:e,handleClick:r},e.id)}):E(n?$b:Xb,{})}function rf(){const e=ld({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return S(ol,{onClick:()=>{fi(e?"BanksAndIntegrations":"NewConnection")},children:[E(Co,{Component:Ac}),E(xl,{children:"Banks & Integrations"})]})}function af(){return Mc({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 of=Ut(Dt["business-owner-dashboard"],Et({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),lf=Et({display:"flex",width:"100%",justifyContent:"center"}),sf=e=>{const t=ao[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},cf={status:{in:["ACTIVE","INACTIVE"]}},df={filter:{status:{in:["ACTIVE"]}}};function uf({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 Yo)??!1,n=(e.direction&&e.direction in _o)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:o},isFilling:i,paginationControls:l}=Xo({limit:10,sort:a,filter:io}),s=o?.data??so,c=Hb(),{query:{data:d},isFilling:u}=(h={select:e=>((e,t)=>{const n=yn(r=e)||yn(r.data)?[]:[...r.data].sort((e,t)=>po[e.priority]-po[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n})(e,c)},p=df,Rn({...h,queryKey:p?ho(p):["tasks",{}],queryFn:go}));var h,p;const{query:{data:m}}=ld({select:e=>{return{...e,plaidItemAccountsReadyToSync:qh(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>xd(e.apiName)))};var t}}),{query:{data:v}}=Oc({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})}),b=Hb(),k=g(()=>{let e=[];const t=v?.data;t&&(e=t.map(e=>ic(e)));let n=[];!1===m?.hasPlaidLinkedBankAccount&&(n=[oc]);const r=d??[];return[...e,...n,...r]},[d,m,v]),x=function(){const{query:{data:e}}=Si({filter:cf,limit:1});return(e?.data?.length??0)>0}(),T=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(x,m),w=/* @__PURE__ */new Date,C={month:w.getMonth(),year:w.getFullYear()};const[A,N]=Al(C,e,t),P=(R=A.month,{beginDate:Gt((D=A.year)-1,R+1,1),endDate:Gt(D,R+1,0)});var R,D;return E("div",{className:lf,children:S("div",{...of,children:[S(Vt,{children:[E(Yt,{children:"Action Items"}),E(rf,{})]}),E(to,{children:E(nf,{taskBanners:k,handleScrollAction:sf,isWaitingForPlaidItemAccountsSync:!x&&!0===m?.plaidItemAccountsReadyToSync,isFilling:u})}),!b&&S(I,{children:[E(Om,{period:A,handleDateChange:e=>{var t,n;(t=C).year===(n=e).year&&n.month>t.month||n.year>t.year||N(e)},todayPeriod:C,showSamples:T,showLinkAccountButton:T&&!m?.plaidItemAccountsReadyToSync}),E(Vt,{children:E(Yt,{children:"Financial Summary"})}),E(ec,{isSample:T,period:A}),E($a,{filter:P,isSample:T})]}),E(Is,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:b}),!b&&E(Ab,{})]})})}function hf(e){return E(br||I,{children:e.children})}function pf({children:e}){return E(hf,{children:E("div",{className:Ot(Dt.component),children:e})})}function gf(e){return E(pf,{children:E(uf,{...e})})}function mf(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:Te()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}function vf(e,t){return e?{...e,...t}:t}function bf(e){return mf({key:"category",name:"Category",possibleValues:e})}function ff(){const e="in";return{values:[...Sv].map(t=>({name:t.name,value:{reviewStatus:{name:t.name,value:{[e]:[t.value]}}}}))}}const yf=({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}}}}))},kf=u.object({amount:u.number({message:"Required"}),amountOperator:u.object({value:u.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:u.enum(["Equals","Does not equal","Greater than","Less than","Greater than or equal to","Less than or equal to"])})}),xf=Ut(null,Et({display:"flex",flexDirection:"column",gap:"15px",marginInline:"40px",marginTop:"35px"})),Tf=Ut(null,Et({display:"flex",flexDirection:"row",gap:"16px",justifyContent:"right",marginBottom:"20px"}));function wf({children:e,title:t,onCancelClick:n,onSubmit:r}){return S("form",{onSubmit:e=>{e.preventDefault(),r()},...xf,children:[E(da,{children:t}),e,S("div",{...Tf,children:[E(xg,{showIcon:!1,onClick:n}),E(Dd,{showIcon:!1,textContent:"Apply"})]})]})}function Cf({model:e,handleFilterClick:t}){const n=Sl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{amount:null,amountOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:kf},onSubmit:n=>{if(null===n.value.amount)return;const r={displayInput:aa(n.value.amount,{cents:"always",dollarSign:!0,signage:"default"}),parsedInput:lv(n.value.amount),operator:n.value.amountOperator,model:e,handleFilterClick:t};yf(r)}});var n}({model:e,handleFilterClick:t});return S(wf,{title:"Amount...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"amountOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),E(r.AppField,{name:"amount",children:e=>E(e.EditableAmountField,{label:"Total",autofocus:!0})})]})}const Af=[{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"}],Ef=u.object({date:u.string().refine(e=>""!==e,{message:"Required"}),dateOperator:u.object({value:u.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:u.enum(["On","Not on","After","Before","On or after","On or before"])})});function If({model:e,handleFilterClick:t}){const n=Sl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{date:"",dateOperator:n||{value:"equal",label:"On"}}),validators:{onSubmit:Ef},onSubmit:n=>{const r={displayInput:ln(dn(n.value.date)),parsedInput:n.value.date,operator:n.value.dateOperator,model:e,handleFilterClick:t};yf(r)}});var n}({model:e,handleFilterClick:t});return S(wf,{title:"Date...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"dateOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Date",autofocus:!0,editable:!0})})]})}const Sf=[{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"}],Nf=u.object({description:u.string().refine(e=>""!==e,{message:"Required"}),descriptionOperator:u.object({value:u.enum(["equal","notEqual","contain"]),label:u.enum(["Equals","Does not equal","Contains"])})});function Pf({model:e,handleFilterClick:t}){const n=Sl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{description:"",descriptionOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Nf},onSubmit:n=>{const r={displayInput:`"${n.value.description}"`,parsedInput:n.value.description,operator:n.value.descriptionOperator,model:e,handleFilterClick:t};yf(r)}});var n}({model:e,handleFilterClick:t});return S(wf,{title:"Description...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"descriptionOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),E(r.AppField,{name:"description",children:e=>E(e.TextAreaInput,{label:"Description",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Rf=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function Df(e){return mf({key:"bankAccount",name:"Bank Account",possibleValues:e})}const Mf=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await jo(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Oi({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:a}};function Of(e){return mf({key:"classSegments",name:"Business",possibleValues:e})}function Lf(e){return mf({key:"customer",name:"Customer",possibleValues:e})}function Bf(e){return mf({key:"vendor",name:"Vendor",possibleValues:e})}const Ff={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"},Uf=[{name:"Expense",value:Ff.EXPENSE},{name:"Income",value:Ff.REVENUE},{name:"Bank Transfer",value:Ff.BANK_TRANSFER},{name:"Tax Payment",value:Ff.TAX_PAYMENT},{name:"Invoice Payment",value:Ff.INVOICE_PAYMENT},{name:"Payout",value:Ff.PAYOUT},{name:"Payroll Payment",value:Ff.PAYROLL_PAYMENT},{name:"Bill Payment",value:Ff.BILL_PAYMENT},{name:"Loan Payment",value:Ff.LOAN_PAYMENT}];function Wf(){return{values:[...Uf].map(e=>function(e){const t="in";return{name:e.name,value:{type:{name:e.name,value:{[t]:[e.value]}}}}}(e))}}const Vf={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},Hf=[{name:"Active",value:Vf.ACTIVE},{name:"Inactive",value:Vf.INACTIVE},{name:"Removed",value:Vf.REMOVED}],qf=e=>e.map(e=>({id:e.id,status:Vf.INACTIVE}));function jf(){const e="in";return{values:[...Hf].map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[t.value]}}}}))}}const zf=u.object({notes:u.string().refine(e=>""!==e,{message:"Required"}),notesOperator:u.object({value:u.enum(["equal","notEqual","contain"]),label:u.enum(["Equals","Does not equal","Contains"])})});function Kf({model:e,handleFilterClick:t}){const n=Sl(),r=function({model:e,handleFilterClick:t}){return fg({defaultValues:(n=e?.operators?.[0],{notes:"",notesOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:zf},onSubmit:n=>{const r={displayInput:`"${n.value.notes}"`,parsedInput:n.value.notes,operator:n.value.notesOperator,model:e,handleFilterClick:t};yf(r)}});var n}({model:e,handleFilterClick:t});return S(wf,{title:"Notes...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"notesOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Yf=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],_f=(Gf={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,matchingBankTransaction:!0,invoiceItem:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(Gf));var Gf;function Zf(e){return mf({key:"glAccount",name:"GL Account",possibleValues:e})}function Qf(){const{filters:e,addFilters:t,removeFilter:n}={filters:We(e=>e.transactionsDashFilters),addFilters:We(e=>e.addTransactionsDashFilters),removeFilter:We(e=>e.removeTransactionsDashFilter)},{getCategories:r,getBankAccounts:a,getClassSegments:o,getVendors:i,getCustomers:l,getGlAccounts:c}=function(){const e=function(){const{query:{data:e},isFilling:t}=uu(),n=e?.data,r=g(()=>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}=ld(),n=e?.data,r=g(()=>n?.map(e=>{const t=e?.name,n=e?.mask,r=td(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}=ug(),n=e?.data,r=g(()=>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}=$p(),n=e?.data,r=g(()=>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}=Rn({queryKey:["clientMgmt/businesses","classSegments"],queryFn:Mf}),n=e?.data,r=g(()=>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])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:a,getGlAccounts:function(){const{query:{data:e},isFilling:t}=Xh(),n=g(()=>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])}()}}(),d=g(()=>({reviewStatus:mf({key:"reviewStatus",name:"Review Status",possibleValues:ff}),amount:mf({key:"amount",name:"Amount",operators:Af,ModalComponent:Cf}),bankAccount:Df(a),category:bf(r),classSegments:Of(o),customer:Lf(l),date:mf({key:"date",name:"Date",operators:Sf,ModalComponent:If}),description:mf({key:"description",name:"Description",operators:Rf,ModalComponent:Pf}),glAccount:Zf(c),notes:mf({key:"notes",name:"Notes",operators:Yf,ModalComponent:Kf}),status:mf({key:"status",name:"Status",possibleValues:jf}),vendor:Bf(i),type:mf({key:"type",name:"Type",possibleValues:Wf})}),[a,o,r,i,l,c]),u=g(()=>[d.reviewStatus,d.amount,d.bankAccount,d.category,d.classSegments,d.customer,d.date,d.description,d.glAccount,d.notes,d.status,d.type,d.vendor],[d.reviewStatus,d.amount,d.bankAccount,d.category,d.classSegments,d.customer,d.date,d.description,d.glAccount,d.notes,d.status,d.type,d.vendor]),h=g(()=>function(e){const t={...e};return _f.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(e.reduce(Xf,{})),[e]),p=y(e=>d[e],[d]);return{filters:e,filterModels:u,addFilters:t,removeFilter:n,apiFilters:h,getModel:p}}function Xf(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 vf(e,t)}(e.category,r.category.value)),r.reviewStatus&&(n.reviewStatus=function(e,t){return e?{...e,...t}:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return vf(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return vf(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return vf(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.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return vf(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return vf(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}const Jf=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),$f=Ut(Dt["filter-search-bar"],Et({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),ey=Ut(null,Et({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),ty=Ut(null,Et({display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",border:"none",outline:"none",background:"transparent",height:"100%",fontSize:"sm",fontWeight:"sm"}));function ny({search:e,setSearch:t}){return S("div",{...$f,children:[E(Co,{stylists:[ey],Component:Jf}),E("input",{...ty,value:e,onChange:e=>t(e.target.value),placeholder:"Filter and Search",onKeyDown:zd})]})}const ry={transform:"none",willChange:"auto"};function ay({children:e}){return E(Wl,{style:ry,children:e})}const oy=Et({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),iy=Ut(null,oy);function ly({children:e,clickHandler:t}){const n=Sl();return t||(t=()=>{n.setOpen(!1)}),E(he,{lockScroll:!0,...iy,onClick:t,children:e})}const sy=Pt({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 cy({width:e="lg",children:t}){const n=Ut(Dt["modal-popup"],sy({width:e}));return E("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}function dy({model:e,handleFilterClick:t}){return S(Il,{placement:"right-start",modal:!0,children:[E(Nl,{children:t=>E(fu,{...t,children:E(da,{children:e.name})})}),E(ay,{children:E(ly,{children:E(cy,{children:e.ModalComponent&&E(e.ModalComponent,{model:e,handleFilterClick:t})})})})]})}function uy({filterModels:e,addFilters:t}){const n=Sl(),r=e=>{t([e]),n.setOpen(!1)};return E(Wl,{children:E(ou,{children:e.map(e=>{const t=e.possibleValues?e.possibleValues():null;return yn(t)?E(dy,{model:e,handleFilterClick:r},e.key):E(hy,{model:e,handleFilterClick:r},e.key)})})})}function hy({model:e,handleFilterClick:t}){if(void 0===e.possibleValues)return;const{values:n,isFilling:r}=e.possibleValues();return E(Ru,{triggerChildren:E(Mu,{icon:e.icon,displayLabel:e.name}),popupChildren:r?E(Tu,{}):E(py,{values:n,handleValueClick:n=>{const r=e.createFilter(n);t(r)}})},e.key)}function py({values:e,handleValueClick:t}){return E(ou,{children:e.length>0?e.map(e=>E(gy,{handleClick:()=>t(e),value:e},e.name)):E(ku,{text:"No data"})})}function gy({value:e,handleClick:t}){return E(fu,{onClick:t,children:E(da,{children:e.name})})}const my=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.41733 2.125L10.422 6.32154L14.9393 6.98978L11.6783 10.2508L12.4535 14.875L8.41733 12.7099L4.38116 14.875L5.15632 10.2508L1.89532 6.98978L6.41261 6.32154L8.41733 2.125Z",stroke:"#182428",strokeMiterlimit:10})),"Star"),vy=Ut(Dt["filter-bar"],Et({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",cursor:"pointer"})),by=Ut(null,Et({display:"flex",alignItems:"center",gap:"7px"})),fy=[Ut(null,Et({display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",width:"17px",height:"17px",paddingLeft:"2px",paddingRight:"2px",paddingBottom:"5px"}))],yy=Ut(null,Et({cursor:"pointer",border:"none",background:"none",padding:0}));function ky({filterModels:e,addFilters:t}){const[n,r]=f("");return S(I,{children:[S("div",{...by,children:[E("button",{...yy,children:E(Ec,{Component:my})}),E("button",{...yy,children:E(Co,{Component:Ju,stylists:fy})})]}),S(Il,{modal:!1,placement:"bottom-start",children:[E(Nl,{children:e=>E("div",{...vy,...e,children:E(ny,{search:n,setSearch:r})})}),E(uy,{filterModels:e,addFilters:t})]})]})}const xy=Et({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),Ty=Ut(Dt["filter-pill"],Et({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"})),wy=Ut(null,Et({border:"none",background:"none",padding:0,cursor:"pointer"})),Cy=Ut(null,Et({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function Ay({text:e,onClickRemove:t}){return S("div",{...Ty,children:[E("div",{...Cy,children:e}),E("button",{...wy,onClick:t,children:E(Rl,{Component:Pl,stylists:[Ut(null,xy)]})})]})}function Ey({filters:e,getModel:t,removeFilter:n}){return e.map((e,r)=>{const a=t(e.modelKey),o=`${a?.name}: ${e.name}`;return E(Ay,{text:o,onClickRemove:()=>{n(r)}},e.id)})}const Iy=Ut(Dt["dashboard-header"],Et({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),Sy=Ut(null,Et({display:"flex",alignItems:"center",gap:"20px",padding:"15px 15px 0 15px",width:"100%"})),Ny=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%"}));function Py({filterModels:e,filters:t,addFilters:n,removeFilter:r,getModel:a}){return S("div",{...Iy,children:[S("div",{...Sy,children:[E(ky,{filterModels:e,addFilters:n}),E(No,{})]}),E("div",{...Ny,children:E(Ey,{filters:t,getModel:a,removeFilter:r})})]})}const Ry=qe.filter(e=>e!=He.COMMENTS),Dy=Ut(null,Et({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function My(){return E("div",{...Dy,children:E(No,{})})}const Oy=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2768)"},h.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"}),h.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"}),h.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");function Ly(){return S(I,{children:[E(Ec,{Component:Oy}),E(da,{wrap:"wrap",children:"No transactions found"}),E(ha,{wrap:"wrap",children:"Try a different set of filters."})]})}const By=m({resetSelected:void 0});function Fy({Icon:e,label:t,children:n,onClick:r}){return n?S(Il,{placement:"bottom-start",children:[E(Nl,{children:n=>S(_l,{popupTriggerProps:n,children:[e&&E(Ec,{Component:e}),E(xl,{children:t})]})}),n]}):S(_l,{onClick:r,children:[e&&E(Ec,{Component:e}),E(xl,{children:t})]})}const Uy=vo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),h.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}),h.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function Wy({transactions:e,id:t,label:n}){const{mutate:r}=bv(),a=Sl(),{resetSelected:o}=v(By);return t in Iv?E(fu,{onClick:()=>(t=>{if(e.length>0){const n=((e,t)=>e.map(e=>({id:e.id,reviewStatus:t})))(e,t);r(n)}a.setOpen(!1),o&&o()})(t),children:n}):null}const Vy=vo(e=>h.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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"}),h.createElement("path",{d:"M7.63599 3.36011V4.63392",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M7.63599 8.45532V9.72913",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.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"),Hy=[{id:"delete",label:"Delete",Icon:Uy,component:function({transactions:e,...t}){const{mutate:n}=bv(),r=()=>{const t=qf(e);n(t)};return E(Fy,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&Jc({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:qc,label:"Cancel"},{key:jc,label:"Delete",type:Xc}]}).then(e=>{e===jc&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:Vy,filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=bv(),a=e.length;return a>0&&E(Fy,{label:`${t} ${$c("Expense","Expenses",a,!0)}`,...n,children:E(Bu,{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:Pv,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:Wy},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:Wy},{id:"RECONCILED",label:"Reconciled",component:Wy}]},{id:"more",label:"More",Icon:Oy,subActions:[{id:"recategorize-revenue",component:function({transactions:e}){const t=Sl(),{mutate:n}=bv(),{resetSelected:r}=v(By),a="Recategorize "+$c("Revenue","Revenues",e.length,!0);return E(Ru,{triggerChildren:E(Mu,{displayLabel:a}),popupChildren:E(mp,{onClick:function(a){var o,i;n((o=e,i=a.id,o.map(e=>({id:e.id,glAccountId:i})))),t.setOpen(!1),r&&r()},types:rp})})},filter:e=>"REVENUE"===e.type}]}];function qy({subActionList:e}){return E(ou,{children:e})}function jy({subActions:e,transactions:t,label:n,Icon:r}){const a=g(()=>e.map(e=>{const{component:n,id:r,filter:a,label:o}=e,i=t.filter(e=>!a||a(e));return i.length>0?E(n,{id:r,transactions:i,label:o},r):null}).filter(e=>null!==e),[e,t]);return E(Fy,{label:n,Icon:r,children:E(Wl,{children:a.length>0?E(qy,{subActionList:a}):E(fu,{children:E(pl,{children:"No Actions Available for Selection"})},"no-actions")})})}const zy=Ut(Dt["bulk-select"],Et({display:"flex",gap:"15px",flexDirection:"row",alignItems:"center",height:"20px",justifyContent:"flex-start"}));function Ky({table:e}){const t=e.getSelectedRowModel(),n=g(()=>t.rows.map(e=>e.original),[t]),r=t.rows.length,a=r>0,o=g(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]);return S("div",{...zy,children:[E(Zm,{checked:e.getIsAllRowsSelected(),onClick:e.getToggleAllRowsSelectedHandler()}),E(By.Provider,{value:o,children:a&&S(I,{children:[E(da,{children:`${r} selected`}),Hy.map(e=>{const{component:t,subActions:r,id:a,filter:o,...i}=e,l=n.filter(e=>!o||o(e));return r?E(jy,{subActions:r,transactions:n,...i},a):t&&E(t,{transactions:l,...i},a)})]})})]})}function Yy({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const a=function({transactions:e,columns:t}){const n=db({transactions:e,columns:t?[He.SELECT,...t,He.EXPAND]:void 0});return function(e,t){const n=!yn(t.getColumn(Ve.SELECT)),r=p(n?e:null);if(n){if(r.current!==e&&void 0!==r.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}r.current=e}}(e,n),n}({transactions:e,columns:t});let o;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?o=E(Ly,{}):r&&0===e?.length&&(o=E(Tb,{})):o=E(kb,{}),S(cl,{dashboard:"transactionDashboard",children:[yn(o)&&E(Ky,{table:a}),E(oi,{headerGroups:a.getHeaderGroups()}),yn(o)?E(li,{children:a.getRowModel().rows.map(e=>E(gb,{rowData:e},e.id))}):E(bs,{children:o})]})}function _y({limit:e=10,columns:t=Ry}){const{sortInstance:n,setSortInstance:r,apiSort:a}=jm(),{filters:o,filterModels:i,addFilters:l,removeFilter:s,apiFilters:c,getModel:d}=Qf(),u={limit:e,sort:a,filter:{...c}},{isFilling:h,paginationControls:p,query:{data:g,isError:m,error:v}}=Si(u),b=g?.data,{hasPlaidLinkedBankAccount:f}=jh(),y=f??!1;if(m)return E("div",{children:`Error: ${v?.message}`});if(h)return E(Lo,{});if(void 0!==b){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,b.length);return E(I,{children:S(wo.Provider,{value:p,children:[E(Py,{filterModels:i,addFilters:l,filters:o,removeFilter:s,getModel:d}),E(dl.Provider,{value:{sortInstance:n,setSortInstance:r},children:E(Yy,{hasLinkedBankAccount:y,filterState:e,transactions:b,columns:t})}),E(My,{})]})})}return"zero state"}const Gy=e=>E(pf,{children:E(_y,{...e})}),Zy=Ut(Dt["drawer-header"],Et({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function Qy({hideDivider:e=!1,children:t}){return S(I,{children:[E("div",{...Zy,children:t}),!e&&E(ci,{alignment:"horizontal",color:"strong"})]})}const Xy=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),zr);function Jy({children:e}){return E("div",{...Xy,children:e})}const $y=Ut(null,Et({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"}}),ko);function ek({Icon:e=Pl}={}){return E("button",{...$y,onClick:()=>yi(),type:"button",children:E(Ec,{Component:e,...$y})})}const tk=Pt({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function nk({width:e,children:t}){return E("div",{className:tk({width:e}),children:t})}function rk({options:e,handleClick:t,selected:n}){return E(nk,{width:"full",children:e.map(e=>E(Ap,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground"},e.value))})}const ak=Et({display:"flex",flexDirection:"column",padding:"15px"});function ok({task:e}){return E("div",{className:ak,children:E(Zb,{task:e})})}const ik=Et({padding:"20px 15px 14px 15px",backgroundColor:"surface.foreground"}),lk=Et({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),sk=Et({width:"120px",height:"20px"}),ck=Et({width:"80px",height:"12px"}),dk=Et({width:"150px",height:"16px"}),uk=Et({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),hk=Et({userSelect:"none",cursor:"pointer"});function pk(){return S("div",{className:uk,children:[S("div",{className:hk,children:[E(ci,{alignment:"horizontal",color:"strong"}),E("div",{className:ik,children:E(Ua,{styles:sk})}),S("div",{className:lk,children:[E(Ua,{styles:ck}),E(Ua,{styles:dk})]}),S("div",{className:lk,children:[E(Ua,{styles:ck}),E(Ua,{styles:dk})]}),E(ci,{alignment:"horizontal",color:"strong"})]}),S("div",{className:hk,children:[E(ci,{alignment:"horizontal",color:"strong"}),E("div",{className:ik,children:E(Ua,{styles:sk})}),S("div",{className:lk,children:[E(Ua,{styles:ck}),E(Ua,{styles:dk})]}),S("div",{className:lk,children:[E(Ua,{styles:ck}),E(Ua,{styles:dk})]})]})]})}function gk({children:e}){return S(Il,{placement:"bottom-start",children:[E(Nl,{children:e=>E(_l,{popupTriggerProps:e,children:E(Co,{Component:Oy})})}),E(Wl,{children:e})]})}const mk=vo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),h.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),h.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),h.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),h.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),h.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),h.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),h.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),h.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),h.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),h.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),vk=Et({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),bk=Et({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),fk=Et({display:"flex",flexDirection:"column",gap:"12px"}),yk=Et({display:"flex",flexDirection:"row",gap:"10px"}),kk=Et({display:"flex",flexDirection:"column",gap:"10px"}),xk=({acknowledged:e,setAcknowledged:t})=>S("div",{className:fk,children:[E(pl,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),S("div",{className:yk,children:[E(_m,{checked:e,onClick:()=>t(!e)}),E(pl,{wrap:"wrap",children:"I understand."})]})]});function Tk({bankAccounts:e}){const{apiPartnerName:t}=v(es),n=e.reduce((e,t)=>{const n=dn(t.tranStartDate||""),r=dn(e.tranStartDate||"");return n&&r&&on(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=yd();return fg({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,a;Jc({title:"Start Date Updated",body:S("div",{className:kk,children:[E(pl,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),E(pl,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:zc,type:Qc}]}),n((r=e,a=t.value.tranStartDate,r.map(e=>({id:Li(e.id),tranStartDate:a,duplicateBankAccountIds:[]}))))}})})(e,n),a=Sl(),o=()=>{a.setOpen(!1)},[i,l]=f(!1),{query:{data:s}}=Oc(),c=s?.data?.find(t=>t.id===(e[0]?.integration.id??""))?.apiInstitutionName||"bank",d=dn(e.reduce((e,t)=>{const n=dn(t.tranMinStartDate||""),r=dn(e.tranMinStartDate||"");return n&&r&&on(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${td(e[0]?.name,e[0]?.mask)} account dating back to ${vn(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${vn(d)}.`;return S("form",{className:vk,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),a.setOpen(!1)},children:[E(da,{children:"Set Bank Transaction Start Date"}),E(pl,{wrap:"wrap",children:u}),E(pl,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),E(r.AppField,{name:"tranStartDate",children:e=>E(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),E(r.Subscribe,{selector:e=>e,children:e=>{const t=dn(e.values.tranStartDate||""),r=dn(n),a=t&&r&&on(t,r);return S(I,{children:[e.isDirty&&a&&E(xk,{acknowledged:i,setAcknowledged:l}),S("div",{className:bk,children:[E(xg,{showIcon:!1,onClick:o}),E(Dd,{showIcon:!1,textContent:"Confirm",disabled:!!a&&!i})]})]})}})]})}function wk({bankAccounts:e}){return S(Il,{placement:"right-start",modal:!0,children:[E(Nl,{children:e=>S(fu,{...e,children:[E(Ec,{Component:mk}),E(da,{children:"Set Start Date"})]})}),E(ay,{children:E(ly,{children:E(cy,{width:"sm",children:E(Tk,{bankAccounts:e})})})})]})}const Ck=vo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.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}),h.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),Ak=vo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),h.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),h.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),Ek=Et({display:"flex",flexDirection:"column",gap:"16px"});function Ik({integration:e,accounts:t}){const{mutate:n}=em(),r=Sl(),{linkPlaid:a,loading:o,hasOnPlaidLinkOverride:i}=rm(),{query:{data:l}}=(s=e.id,Mc({},{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}}=Yh(e.id),u=d?.data,h="PLAID"===e.apiName,p="UNIT"===e.apiName;return S(ou,{children:[h&&!o&&S(fu,{onClick:()=>(a({plaidEvent:qg,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r?.setOpen(!1)),children:[E(Ec,{Component:Yi}),E(da,{children:"Add Account"})]}),h&&u&&E(wk,{bankAccounts:u}),t.length>0&&S(fu,{onClick:()=>Lg({plaidItemAccounts:t}),children:[E(Ec,{Component:Ak}),E(da,{children:"Merge Accounts"})]}),!p&&S(fu,{onClick:()=>(async()=>{const t=await(async e=>Jc({title:"Remove Institution",body:E("div",{className:Ek,children:E(pl,{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:qc,label:"Cancel"},{key:jc,label:"Remove",type:Xc}]}))(e.apiInstitutionName);var o;r?.setOpen(!1),t===jc&&(h&&i?a({plaidEvent:jg,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(o=e.id,n({id:o})))})(),children:[E(Ec,{Component:Ck}),E(da,{children:"Remove Institution"})]})]})}const Sk=Pt({base:{userSelect:"none"},variants:{expandable:{true:{cursor:"pointer"}}}});function Nk({children:e,onClick:t,expandable:n=!1}){return S("div",{onClick:t,className:Sk({expandable:n}),children:[E(ci,{alignment:"horizontal",color:"strong"}),e]})}const Pk=Et({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"20px",paddingBottom:"14px",paddingLeft:"15px",paddingRight:"15px",backgroundColor:"surface.foreground"});function Rk({children:e}){return E("div",{className:Pk,children:e})}function Dk({plaidItem:e}){const t=_b(e);return S(Yv,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(gr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),Gb(t))},disabled:yn(t),children:[E(Ec,{Component:Md}),E(ha,{children:"Fix Bank Error"}),E(Co,{Component:fo})]})}const Mk=Pt({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"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"}}}}});function Ok({bankAccountId:e,name:t,mask:n,syncText:r,active:a}){const o=St(Mk({active:a}),ko);return S("button",{className:o,onClick:t=>{t.stopPropagation(),fi("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!a,children:[E(Mp,{accountName:t,accountNo:n,syncText:r,active:a}),a&&E(Ec,{Component:fo})]})}const Lk={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 Bk(e){const{apiPartnerName:t,unitIntegrationBankName:n}=v(es);return"UNIT"===e?n??t??"Unit":Lk[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const Fk=Et({overflow:"hidden"}),Uk=e=>{let t;return t=e.isSupported?e.lastSyncedDate?`Last synced ${mn(e.lastSyncedDate)}`:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function Wk({integration:e,itemIndex:t,numIntegrations:n}){const{query:{data:r}}=Yh(e.id),a=r?.data,o=1===n,{expanded:i,toggleExpanded:l}=function(e,t){const n=We(e=>e.toggleExpandedIntegration),r=We(e=>e.expandedPlaidItems);return{toggleExpanded:n,expanded:We(e=>e.hasExpandedUpdated)?r.includes(e):t}}(e.id,o),s="PLAID"===e.apiName,c=Lp(s?e.apiInstitutionId??void 0:void 0),d=Bk(e.apiName);if(u=a,!(Array.isArray(u)&&u.length>0))return null;var u;const h=t===n-1;return S(Nk,{onClick:()=>l(e.id,o),expandable:!0,children:[S(Rk,{children:[S(Jy,{children:[c?E("img",{src:c,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):E(fs,{Component:Vu}),E(da,{children:e.apiInstitutionName??d}),E("div",{onClick:e=>e.stopPropagation(),children:E(gk,{children:E(Ik,{integration:e,accounts:a})})})]}),S(Jy,{children:[s&&kn(e.apiErrorCode)&&E(Dk,{plaidItem:e}),E(_l,{active:!1,children:E(Co,{Component:i?Jv:Ju})})]})]}),i&&E("div",{className:Fk,children:a.map(e=>E(Ok,{bankAccountId:e.id,mask:e.mask,name:e.name,syncText:Uk(e),active:e.isSupported},e.id))}),!h&&E(ci,{alignment:"horizontal",color:"strong"})]})}const Vk=Et({objectFit:"contain"});function Hk(e,t,n){const r=({size:n=24})=>E("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:Vk});return r.displayName=t,r}const qk=Hk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1BYqFVTahLqg0JYSriExARInsXGwncSJPb7N7Uz/v/+3vnX2OR7HpiB1Zc5ea32X/3fZ31577X1O3Ctj7ba3/c3tvcmJ+0u/3LdWyr5SevO9Xs9SdGulV3r9mK9FV+CvVRlNpKK/Oh90xiX1hLa2JiTJpBx9VzaxJRjYFS/lm9uiS8I445gNowkPB4kj3dOl9A+pf7A3WH3gwN+++/GhlEOJ6e23f3h6sHf3R3sTvff31ZQcmR0GipR97PcZyukhL5OD0aQ351CyIgCBiX46yNh8ywWuaXloulKuzXbCO2NCbngdG135HBOTlYZwySLRAwXwie+fWPpg+Yf3LFXJUkjO2r7dX+z1+2+hOsaTYywczQrQ0A5V520UIc3tvMYtualT3WiBaE5ix6uxigWPSbVhOjZcnp6FDzH0ianDoEsvkpHUC/t2EsdYqsT9T7y4/A6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Hf98v42E9wT8In87zPBDKEn02Y0wmZAdg6AAAAAElFTkSuQmCC","Uber")};function Gk(e){return _k[e]??Vu}const Zk=Pt({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"border.layout.weak",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"start",gap:"5px"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}}),Qk=Et({display:"flex",flexDirection:"column",gap:"16px"}),Xk=({integration:e})=>{const{mutate:t}=em(),n=Sl(),r=Bk(e.apiName);return E(ou,{children:S(fu,{onClick:()=>(async()=>{const a=await(async e=>Jc({title:"Remove Institution",body:E("div",{className:Qk,children:E(pl,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:qc,label:"Cancel"},{key:jc,label:"Remove",type:Xc}]}))(r);n?.setOpen(!1),a===jc&&t({id:String(e.id)})})(),children:[E(Ec,{Component:Ck}),E(da,{children:"Remove Institution"})]})})};function Jk({integration:e,isLastItem:t}){const n=Bk(e.apiName),r=function(e){if(e)return`Last synced ${mn(e)}`}(e.lastSyncedDate),a=Gk(e.apiName),o=St(Zk({active:!1}),ko);return S(Nk,{children:[E(Rk,{children:S(Jy,{children:[E(fs,{Component:a}),E(da,{children:n}),E(gk,{children:E(Xk,{integration:e})})]})}),S("div",{className:o,children:[r&&E(ha,{intent:"normal",children:r}),E(da,{wrap:"wrap",children:n}),e.apiUsername&&E(da,{wrap:"wrap",children:e.apiUsername})]}),!t&&E(ci,{alignment:"horizontal",color:"strong"})]})}const $k=Et({overflow:"hidden"});function ex({manualBankAccounts:e}){return S(Nk,{children:[E(Rk,{children:E(Jy,{children:E(da,{children:"Manually Tracked Accounts"})})}),E("div",{className:$k,children:e.map(e=>E(Ok,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const tx=St(Et(Xi,{minWidth:"100%",justifyContent:"start",paddingBlock:"10px",marginBottom:"5px"}),yo),nx=Et({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),rx=Et({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",marginInline:"15px"});function ax(){const{linkPlaid:e,loading:t}=am();return E("button",{className:tx,disabled:t,onClick:()=>{gr("Add New Connection button pressed"),e({plaidEvent:Hg,message:"Add New Connection button pressed"})},children:S("div",{className:nx,children:[E(Ec,{Component:Jf}),S("div",{className:rx,children:[E(da,{children:"Connect your bank"}),E(ha,{children:"Find your banking institution with Plaid"})]}),E(Ec,{Component:fo})]})})}const ox=Et({marginBottom:"20px"}),ix=Et({display:"flex",marginBlock:"20px",flexDirection:"column",gap:"15px"});function lx({title:e,children:t}){return S("div",{className:ox,children:[E(ha,{children:e}),E("div",{className:ix,children:t}),E(ci,{alignment:"horizontal"})]})}const sx=Et({padding:"10px 8px",minWidth:"100%",height:"45px"}),cx=Et({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function dx({bank:e}){const t=Lp(e.institutionName);return E("div",{className:sx,children:S("div",{className:cx,children:[t?E("img",{src:t,alt:`${e.displayName} logo`,width:"25px",height:"25px"}):E(fs,{Component:Vu}),E(da,{children:e.displayName})]})})}const ux=Et({minWidth:"100%",height:"45px"});function hx(){return S(I,{children:[E(Ua,{styles:ux}),E(Ua,{styles:ux}),E(Ua,{styles:ux})]})}const px=St(Et(Xi,{minWidth:"100%",padding:"10px"}),yo),gx=Et({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),mx=Et({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),vx=Et({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function bx({integration:e}){const{linkPlaid:t,loading:n}=rm(),r=Lp(e.apiInstitutionId??void 0),a="PLAID"===e.apiName,o=Gk(e.apiName),i=Bk(e.apiName);return E("button",{className:px,disabled:n||!a,onClick:()=>{gr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:qg,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:S("span",{className:gx,children:[S("div",{className:mx,children:[r?E("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):E(fs,{Component:o}),E(da,{children:e.apiInstitutionName??i??void 0})]}),a&&S("div",{className:vx,children:[E(Co,{Component:Ac}),E(pl,{children:"Relink"})]})]})})}const fx=e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},h.createElement("g",{fill:"none",fillRule:"nonzero"},h.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"}),h.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"}),h.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"}),h.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"}),h.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"}))),yx=St(Et(Xi,{minWidth:"100%",justifyContent:"space-between",paddingBlock:"10px",marginBottom:"5px"}),yo),kx=Et({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),xx=Et({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),Tx=Et({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),wx=Et({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"}}),Cx=Et({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function Ax(){const e=Sl(),{mutateAsync:t}=Qg(),[n,r]=f("");return S("div",{className:xx,children:[E(da,{children:"Enter your shop name"}),E("div",{className:Cx,children:E(fx,{})}),E(pl,{children:"Please enter the name of your shop below."}),E("input",{className:wx,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),S("div",{className:Tx,children:[E(xg,{showIcon:!1,onClick:()=>{e.setOpen(!1)}}),E(Hc,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.setOpen(!1)},children:E(da,{children:"Connect"})})]})]})}function Ex(){const e=Gk("SHOPIFY")??Ac;return S(Il,{placement:"bottom",modal:!0,children:[E(Nl,{children:t=>S("button",{className:yx,...t,children:[S("div",{className:kx,children:[E(fs,{Component:e}),E(da,{children:"Shopify"})]}),E(Ec,{Component:fo})]})}),E(ay,{children:E(ly,{children:E(cy,{width:"sm",children:E(Ax,{})})})})]})}const Ix=St(Et(Xi,{minWidth:"100%",justifyContent:"space-between",paddingBlock:"10px",marginBottom:"5px"}),yo),Sx=Et({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function Nx({apiName:e}){const{mutateAsync:t}=Qg(),n=Bk(e);if("SHOPIFY"===e)return E(Ex,{});const r=Gk(e)??Ac;return S("button",{className:Ix,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[S("div",{className:Sx,children:[E(fs,{Component:r}),E(da,{children:n})]}),E(Ec,{Component:fo})]})}const Px=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function Rx(e){return Px.includes(e)}const Dx=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],Mx=Et({margin:"15px"}),Ox=Et({overflowY:"auto"});function Lx({connectedBankNames:e=/* @__PURE__ */new Set}){const{query:{data:t},isFilling:n}=af(),r=t?.multiAccountIntegrations,a=t?.integrations,o=kn(r)&&r.length>0||kn(a)&&a.length>0,i=Bc.filter(t=>!e.has(t.displayName)),l=function({connectedIntegrations:e}){const t=v(es),n=We(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(Rx),a=e?.map(e=>e.apiName)||[];let o=r??Dx;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:a});return E("div",{className:Ox,children:S("div",{className:Mx,children:[(n||o)&&E(lx,{title:"Already Connected",children:n?E(hx,{}):S(I,{children:[r?.map(e=>E(bx,{integration:e},e.id)),a?.map(e=>E(bx,{integration:e},e.id))]})}),S(lx,{title:"Banks",children:[E(ax,{}),i.length>0&&S(I,{children:[E("div",{className:Et({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"}),children:i.map(e=>E(dx,{bank:e},e.institutionName))}),E(da,{children:"...and 12,000+"})]})]}),l&&l.length>0&&E(lx,{title:"Integrations",children:E("div",{className:Et({display:"flex",flexDirection:"column",gap:"8px"}),children:l.map(e=>E(Nx,{apiName:e},e))})})]})})}const Bx=Et({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"});function Fx({showPlaidItems:e,showNewConnectionContent:t,multiAccountIntegrations:n,integrations:r,numIntegrations:a,manualBankAccounts:o}){return t?E(Lx,{}):e?S(I,{children:[n?.map((e,t)=>E(Wk,{integration:e,itemIndex:t,numIntegrations:a},e.id)),r?.map((e,t)=>E(Jk,{integration:e,isLastItem:t===r.length-1},e.id))]}):o&&o.length>0?E(ex,{manualBankAccounts:o}):S("div",{className:Bx,children:[E(fs,{Component:Vu}),E(da,{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 Ux=Pt({base:{display:"flex",flexDirection:"column",gap:"15px"},variants:{hideManualBanks:{true:{marginTop:"0px"},false:{marginTop:"15px"}}}}),Wx=Pt({base:{overflowY:"auto"},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),Vx=Pt({base:{paddingTop:"20px",paddingBottom:"20px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.background"},variants:{hasPlaidItems:{true:{borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}}}}),Hx=[{label:"Connected Accounts",value:"connected"},{label:"Manually Tracked Banks",value:"manual"}];function qx({showCloseButton:e=!1,onPlaidLink:t,hideManualBanks:n}){rm();const{query:{data:r},isFilling:a}=af(),o=r?.multiAccountIntegrations,i=r?.integrations,{query:{data:l}}=ld({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>xd(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:zh(e?.data)};var t}}),{mutate:s}=Jg(),c=l?l.manualAccounts:null,d=o&&i?o.length+i.length:0,u=o?.find(e=>e.apiErrorCode),h=u&&ic(u,!1),p=We(e=>e.externalOptions.banksAndIntegrations),g=p?.integrations,m=n??(void 0!==g&&!g.includes("MANUAL_ENTRY")),v=We(e=>e.banksAndIntegrationsSelectedTab),b=We(e=>e.setBanksAndIntegrationsSelectedTab),f=m||"connected"===v.value,y=0===d&&f,k=f?"Add New Connection":"Add New Account";return E(Yg,{onPlaidLink:t,children:S(I,{children:[E(Qy,{hideDivider:m,children:S(Jy,{children:[e&&E(ek,{}),E(da,{children:"Banks & Integrations"}),E(_l,{onClick:()=>s(),active:!1,children:E(Ec,{Component:Ac})})]})}),h&&E(ok,{task:h}),!m&&E(rk,{options:Hx,handleClick:e=>b(e),selected:v}),a?E(pk,{}):S(I,{children:[E("div",{className:Wx({height:y?"fill":void 0,background:y?"foreground":void 0}),children:E("div",{className:Ux({hideManualBanks:m}),children:E(Fx,{showPlaidItems:f,showNewConnectionContent:y,multiAccountIntegrations:o,integrations:i,numIntegrations:d,manualBankAccounts:c})})}),!(f&&y)&&E("div",{className:Vx({hasPlaidItems:d>0}),children:S(ud,{onClick:()=>{fi(f?"NewConnection":"BankAccountForm")},disabled:f&&!1,children:[E(Ec,{Component:Yi}),E(da,{children:k})]})})]})]})})}function jx({onPlaidLink:e,hideManualBanks:t}){return E(pf,{children:E(qx,{showCloseButton:!1,onPlaidLink:e,hideManualBanks:t})})}const zx=we("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),Kx={queryClient:Sn,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await zx).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await zx).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await zx).delete("queryClient",e)}(e)}}}(),maxAge:In,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function Yx({children:e}){return E(Ce,{client:Sn,persistOptions:Kx,children:e})}const _x=Et({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"}),Gx=Et({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"}),Zx=Ut(null,Dt.component,Gx);function Qx({children:e}){const t=p(null),n=p(null);return S(he,{lockScroll:!0,children:[E("div",{className:_x}),E("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,We.getState().closeAllDrawers())},ref:t,...Zx,children:e})]})}const Xx=m({drawerHistory:[]});function Jx({children:e}){const t=We(e=>e.drawerHistory),n=g(()=>({drawerHistory:t}),[t]),r=t.length>0;return E(Xx.Provider,{value:n,children:r&&E(Qx,{children:e})})}const $x=m(!0);function eT({Component:e,name:t}){const{drawerHistory:n}=v(Xx),r=n.at(-1);if(void 0===r)return null;const a=n.find(e=>void 0!==e[t]),o=void 0!==r[t];return a&&a[t]?E($x.Provider,{value:o,children:E(e,{...a[t].routeProps})}):void 0}const tT=u.object({amount:u.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:u.string("Required").refine(e=>(function(e,t){const n=Gt(e.getFullYear(),e.getMonth(),e.getDate()),r=Gt(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||rn(new Date(e),/* @__PURE__ */new Date))&&on(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),customer:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),frequency:u.union([u.object({name:u.string(),value:u.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),u.undefined()]),category:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),classSegments:u.array(u.object({id:u.string(),name:u.string().optional()})),bankAccount:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}),glAccount:u.object({id:u.string(),name:u.string().optional(),accountNo:u.string().optional()},{message:"Required"}),notes:u.string().nullable()}),nT=tT.extend({children:u.array(u.object({amount:u.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}),glAccount:u.object({id:u.string()},{message:"Required"}),classSegments:u.array(u.object({id:u.string(),name:u.string().optional()}))}))}),rT=tT.extend({id:u.string(),type:u.literal(Object.values(Ff)),description:u.string(),status:u.literal(Object.values(Vf)),reviewStatus:u.literal(Object.values(Iv)),apiName:u.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:u.string().nullable(),customer:u.object({id:u.string(),name:u.string().optional(),email:u.string().optional()}).nullable(),vendor:u.object({id:u.string(),name:u.string().optional()}).nullable(),invoiceItem:u.object({id:u.string(),description:u.string().optional()}).nullable(),bill:u.object({id:u.string(),name:u.string().optional()}).nullable(),payroll:u.object({id:u.string(),date:u.string().optional(),checkDate:u.string().optional(),description:u.string().optional()}).nullable(),apiItemId:u.string().nullable()});rT.extend({});const aT=nT.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"]})}),oT=nT.extend({matchingBankTransaction:u.object({id:u.string(),description:u.string().optional(),amount:u.number().optional(),date:u.string().optional(),bankAccountId:u.string().optional(),apiName:u.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.matchingBankTransaction?.amount,n=e.amount;return!!yn(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>oT.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success});rT.extend({});const iT=nT.extend({});rT.extend({});const lT=[{value:"FEDERAL",label:"Federal"},{value:"STATE",label:"State"},{value:"SALES",label:"Sales"}],sT=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],cT=["FEDERAL","STATE","SALES"],dT=["Q1","Q2","Q3","Q4"],uT=u.object({tax:u.object({paymentInfo:u.object({region:u.enum(cT,{message:`Tax region must be one of: ${cT.join(", ")}`}),quarter:u.enum(dT,{message:`Tax quarter must be one of: ${dT.join(", ")}`}),year:u.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: ${cT.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","quarter"],code:"custom",message:`Tax quarter must be one of: ${dT.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),hT=u.intersection(uT,nT);u.intersection(uT,rT);const pT={amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:Ti[0],notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function gT(e){const{mutate:t}=fv(),n=e?{amount:iv((a=e).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:iv(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:a.matchingBankTransaction,tax:a.tax}:pT,r=e?function(e){switch(e.type){case"EXPENSE":return aT;case"BANK_TRANSFER":return oT;case"REVENUE":return iT;case"TAX_PAYMENT":return hT;default:return}}(e):void 0;var a;return fg({defaultValues:n,validators:{onBlur:r},onSubmit:n=>{var r;e&&(t({id:e.id,amount:(r=n.value).amount?lv(r.amount):0,categoryId:r.category?.id,bankAccountId:r.bankAccount.id,glAccountId:r.glAccount?.id,date:r.date,vendorId:r.vendor?.id,customerId:r.customer?.id,frequency:r.frequency?.value,notes:r.notes,classSegmentIds:r.classSegments.map(e=>e.id),children:r.children.map(e=>({amount:e.amount?lv(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:r.classSegments.map(e=>e.id)})),matchingBankTransactionId:r.matchingBankTransaction?.id,tax:r.tax}),n.formApi.reset(n.value,{keepDefaultValues:!0}))},onSubmitInvalid:()=>{}})}const mT=Ut(null,Et({position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",outline:"none",border:"none",background:"none",padding:"15px 0px",gap:"15px",width:"100%"})),vT=Ut(null,Et({backgroundColor:"border.layout",height:"25px",width:"1px",margin:0})),bT=Ut(null,Et({backgroundColor:"border.layout",height:"1px",width:"100%"})),fT=Ut(null,Et({background:"none",border:"none",outline:"none",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"md",cursor:"pointer","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:hover":{"& svg":{"& path":{stroke:"icon.accent.danger"}}}}),To),yT=Ut(null,Et({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px"})),kT=yg({defaultValues:pT,props:{index:0,numRows:1,removeSplit:()=>{}},render:function({form:e,index:t,numRows:n,removeSplit:r}){return S(I,{children:[S("div",{...mT,children:[E(e.AppField,{name:`children[${t}].category`,children:e=>E(e.SplitExpenseCategoryField,{value:e.state.value,onChange:e.handleChange})}),S("div",{...yT,children:[E("div",{...vT}),E(e.AppField,{name:`children[${t}].amount`,children:e=>E(e.SplitExpenseAmountField,{value:e.state.value,onChange:e.handleChange,onBlur:e.handleBlur})}),E("button",{onClick:()=>r(t),...fT,children:E(Ec,{Component:Uy})})]})]}),t<n-1&&E("div",{...bT})]})}}),xT=Ut(null,Et({display:"flex",flexDirection:"column",alignItems:"flex-start",outline:"none",border:"none",background:"none"})),TT=Et({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout.strong",display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none"}),wT=Et({borderColor:"border.intent.danger"}),CT=yg({defaultValues:pT,render:function({form:e}){const t=fe(e.store,e=>{const t=e.errors?.[0]??{},n=Object.values(t).flat().filter(e=>"object"==typeof e&&null!==e&&"message"in e);return n[0]?.message}),n=Ut(null,TT,t?wT:void 0);return S(I,{children:[S("div",{...n,children:[E(ha,{children:"Category"}),E(e.AppField,{name:"children",mode:"array",children:t=>{const n=n=>{if(t.state.value.length<=2){const r=1-n;e.setFieldValue("category",t.state.value[r].category),t.clearValues()}else t.removeValue(n);e.validate("blur")};return S("div",{...xT,children:[t.state.value.map((r,a)=>E(kT,{form:e,index:a,numRows:t.state.value.length,removeSplit:n},`${r?.category?.id}-${a}`)),E(Gu,{onClick:()=>{const e=Me(t.state.value)?.category,n=Me(t.state.value)?.classSegments,r=Me(t.state.value)?.glAccount;t.pushValue({amount:0,category:e||{id:"",name:""},glAccount:r||{id:""},classSegments:n||[]})}})]})}})]}),t&&E(Bd,{errorMessage:t})]})}}),AT=yg({defaultValues:pT,render:function({form:e}){const t=fe(e.store,e=>e.values.amount)??0;return E(e.Subscribe,{selector:e=>e.values.children,children:n=>Array.isArray(n)&&0!==n.length?E(CT,{form:e}):E(e.AppField,{name:"children",mode:"array",children:n=>E(e.AppField,{name:"category",children:r=>E(r.ExpenseCategoryField,{category:r.state.value,glAccount:e.state.values.glAccount,onClick:r.handleChange,childrenField:n,totalAmount:t})})})})}}),ET=Pt({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:{isActive:{true:{},false:{display:"none"}}},defaultVariants:{isActive:!0}});function IT({children:e}){const t=p(null),n=v($x);return function({isActive:e,focusRef:t}){k(()=>{e&&t.current?.focus()},[e,t])}({isActive:n,focusRef:t}),E("div",{ref:t,tabIndex:-1,className:ET({isActive:n}),children:e})}const ST=Ut(null,Et({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 NT({children:e}){return E("div",{tabIndex:-1,...ST,children:e})}function PT({active:e,icon:t,onClick:n,ariaLabel:r}){return E(_l,{ariaLabel:r,onClick:n,active:e,children:E(fs,{Component:t})})}const RT=Pt({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 DT({background:e,children:t}){return E("div",{className:RT({background:e}),children:t})}const MT=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function OT(e){return void 0!==MT[e]}function LT(e){return MT[e]}const BT=vo(e=>h.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},h.createElement("defs",null,h.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),h.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"}),h.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),FT=Et({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function UT({cldrShortName:e}){return E("div",{className:FT,children:LT(e)})}const WT=Pt({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),VT=Et({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 HT({reactions:e,type:t,handleClick:n}){return E("div",{className:VT,children:e.map((e,r)=>E("button",{className:WT({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:E(UT,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const qT=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:co(n)};return await Ar(o)},jT=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:co(n)};return await async function(e){return Gg(e)}(o)};function zT(e,t,n){return bn(Bi({id:e}),t,n)}async function KT(e){const t=Bi({id:e});return gr("mutation successful, invalidating messages queries"),Sn.invalidateQueries({queryKey:t}).catch(e=>mr({error:e,severity:"error"}))}function YT(e,t,n){const r=[...e];return r[n]=t,r}const _T=Et({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),GT=Object.keys(MT).filter(OT).map(e=>({emojiCode:e,authorInfo:[]}));function ZT({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:a,setReactionIsOpen:o}){const{userId:i}=v(es),{mutate:l}=function(e){const{userId:t,userEmail:n}=v(es);return hd({mutationFn:qT,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=zT(n,t,r);await Sn.cancelQueries({queryKey:i});const l=Sn.getQueryData(i);return Sn.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:YT(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:()=>KT(e)})}(e);return S(Il,{placement:"top-end",open:a,onOpenChange:o,blockInteraction:!0,children:[E(Nl,{children:e=>E("button",{className:_T,...e,children:E(Ec,{Component:BT})})}),E(Wl,{type:"reaction",children:E(HT,{reactions:GT,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 QT=Pt({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function XT({reactions:e,type:t,handleClick:n}){const r=QT({type:t});return E("div",{className:r,children:E(HT,{reactions:e,handleClick:n,type:t})})}const JT=Pt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),$T=Pt({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"}}}}),ew=Et({position:"relative",display:"flex",flexDirection:"column"});function tw({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:a=[]}){const o=p(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=f(!1),[r,a]=f(!1);return k(()=>{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}=v(es);return hd({mutationFn:jT,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=zT(n,t,r);await Sn.cancelQueries({queryKey:o});const i=Sn.getQueryData(o);return Sn.setQueryData(o,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return yn(r)||0===r.reactions.length?t:YT(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:()=>KT(e)})}(e),u=n?"sent":"received",h=a.filter(e=>OT(e.emojiCode)),g=h.length>0;return S("div",{className:JT({type:u,hasReactionsOnMessage:g}),ref:o,onMouseEnter:()=>"received"===u&&l(!0),children:[S("div",{className:ew,children:[E("div",{className:$T({type:u}),children:r}),g&&E(XT,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&E(ZT,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const nw=Ut(null,Et({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function rw({children:e}){return E("div",{...nw,children:e})}const aw=Ut(null,Et({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"})),ow=Et({minHeight:1,width:"100%"}),iw=T(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},a){const o=p(null);t&&r?.current?.focus();const i=y(()=>{t&&kn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){k(()=>{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),S("div",{tabIndex:-1,...aw,ref:o,children:[E("div",{className:ow,ref:a}),e]})}),lw=Object.freeze({message:""}),sw=Et({width:"100%"});function cw({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:fg({defaultValues:t??lw,onSubmit:t=>{vh.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=p(null);return E("form",{className:sw,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:E(s.AppField,{name:"message",children:e=>E(e.MessageAreaInput,{blockSubmit:n,scrollRef:a,setActiveKeyboard:o,ref:i})})})}function dw(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:[]}}async function uw(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return gr("mutation successful, invalidating messages queries"),Promise.all([Sn.invalidateQueries({queryKey:e}),Sn.invalidateQueries({queryKey:t}),Sn.invalidateQueries({queryKey:n})]).catch(e=>mr({error:e,severity:"error"}))}const hw=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>ei({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),pw=async({data:e,accessToken:t,environment:n})=>ei({data:{data:[e]},accessToken:t,environment:n}),gw=Et({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),mw=Et({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),vw=Et({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),bw="Marked As Resolved";function fw({resolver:e}){const t=e?`${e} ${bw}`:bw;return S("div",{className:mw,children:[E("div",{className:gw}),E("div",{className:vw,children:t}),E("div",{className:gw})]})}const yw=Pt({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 kw({width:e="md",height:t="md"}){return E(Ua,{styles:yw({width:e,height:t})})}const xw=Et({display:"flex",flexDirection:"row-reverse"});function Tw(){return S(I,{children:[E(kw,{width:"lg",height:"lg"}),E("div",{className:xw,children:E(kw,{width:"md",height:"lg"})}),E("div",{className:xw,children:E(kw,{width:"lg",height:"xl"})}),E(kw,{width:"md",height:"lg"})]})}const ww=Et({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function Cw({isConversationLoading:e,isFilling:t,message:n}){return e?E(rw,{children:E(tw,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):!e&&t?E(rw,{children:E(Tw,{})}):S("div",{className:ww,children:[E(da,{stylists:[Ut(null,Et({whiteSpace:"normal",textAlign:"center"}))],children:"Send your bookkeeper a message"}),E(pl,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const Aw=Ut(null,Et({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",padding:"0 15px 15px",flexDirection:"column",position:"relative"}));function Ew({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:a=!1,attachedEntityId:o,defaultValues:i}){const{userId:l}=v(es),{mutate:s}=function(){const{userId:e}=v(es);return hd({mutationFn:Wi,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const a=bn(Bi({id:e.conversationId}),t,n);await Sn.cancelQueries({queryKey:a});const o=Sn.getQueryData(a);return Sn.setQueryData(a,t=>[dw(e,r),...t]),{oldMessages:o}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:uw})}(),{query:{data:c},isFilling:d}=function(e){const t=kn(e);return Rn({queryKey:Bi({id:e??""}),queryFn:Ui,select:Fi,enabled:t})}(e),{mutate:u,isPending:h,variables:g}=(w=t,C=o,hd({mutationFn:pw,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(yn(e)||yn(t))return;w(t);const n=["conversations"],r=["banks/transactions",{}],a=["summaries",{}];let o=async()=>{},i=async()=>{};if(kn(C)){const e={id:C};Mi(C,Di.BANK_TRANSACTION)?o=async()=>{const t=Ei(e);return await Sn.invalidateQueries({queryKey:t})}:Mi(C,Di.FINANCIAL_SUMMARY)&&(i=async()=>await Sn.invalidateQueries({queryKey:a}))}return gr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([Sn.invalidateQueries({queryKey:n}),Sn.invalidateQueries({queryKey:r}),o(),i()]).catch(e=>mr({error:e,severity:"error"}))}})),{mutate:m}=hd({mutationFn:hw,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return gr("mutation successful, invalidating conversations queries"),Promise.all([Sn.invalidateQueries({queryKey:e}),Sn.invalidateQueries({queryKey:t})]).catch(e=>mr({error:e,severity:"error"}))}}),[b,y]=f(!1),x=p(null),T=p(null);var w,C;k(()=>{n&&r&&e&&m({id:e,readStatus:"READ"})},[n,r,e,m]),k(()=>{bh(T)},[c,T]);const A=yn(e)||yn(c)||d;return S(I,{children:[A?E(iw,{ref:T,inputRef:x,activeKeyboard:b,setActiveKeyboard:y,children:E(Cw,{isConversationLoading:h,isFilling:d,message:g?.message?.text})}):S(iw,{ref:T,activeKeyboard:b,setActiveKeyboard:y,inputRef:x,children:[n&&E(fw,{resolver:"Conversation"}),c.map((t,n)=>{const r=t[0].author.userId===l;return E(rw,{children:t.map(t=>E(tw,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id))},n)})]}),E("div",{...Aw,children:E(cw,{scrollRef:T,inputRef:x,conversationId:e,blockSubmit:h,isMobile:a,addMessage:({value:t})=>{if(yn(e)){const e=(n=t.message,r=o,{subject:n.slice(0,40),status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...kn(r)&&{attachedEntityId:r},message:{text:n}});u(e)}else s({conversationId:e,text:t.message});var n,r},setActiveKeyboard:y,defaultValues:i})})]})}function Iw({conversationId:e,attachedEntityId:t}){const[n,r]=f(e),{query:{data:a}}=$o(n),o="CLOSED"===a?.resolutionStatus;return S(DT,{children:[E(Qy,{}),E(Ew,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t})]})}const Sw=Ut(Dt["form-body"],Et({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",minWidth:{base:"384px",sm:"512px"}}));function Nw({children:e}){return E("div",{...Sw,children:e})}const Pw=Ut(null,Et({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),Rw=Ut(null,Et({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),Dw=Et({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),Mw=e=>{jd(e),zd(e)},Ow=({children:e,onSubmit:t,Header:n,initialTab:r,conversationId:a,transactionId:o})=>{const[i,l]=f(r??null);return E(IT,{children:S("div",{...Pw,children:[E(DT,{children:S("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:Mw,...Rw,children:[n,E(Nw,{children:e})]})}),null!==i&&E("div",{className:Dw}),"conversation"===i&&E(Iw,{conversationId:a,attachedEntityId:o}),E(NT,{children:E(PT,{active:"conversation"===i,onClick:()=>l("conversation"===i?null:"conversation"),icon:Os,ariaLabel:"conversation-tab"})})]})})},Lw=Ut(null,Et({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function Bw({transaction:e,bankAccount:t}){const n=e?e.description:"",r=yn(t)||yn(e)?"":((e,t)=>{const n="BANK_TRANSFER"===t.type,r=Td(t.amount);return`${n?`${r} `:""}${td(e.name,e.mask)}`})(t,e);return S("div",{...Lw,children:[E(da,{wrap:"wrap",children:n}),t&&E(ha,{children:r})]})}function Fw({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const a=Sl();return S(fu,{onClick:()=>{r&&a.setOpen(!1),t()},children:[n&&E(Ec,{Component:n}),E(da,{children:e})]})}function Uw({transaction:e}){const{mutate:t}=bv(),n=()=>t(qf([e]));return E(Fw,{onClick:()=>{return e=n,void Jc({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:qc,label:"Cancel"},{key:jc,label:"Delete",type:Xc}]}).then(t=>{t===jc&&e()});var e},children:"Delete"})}function Ww({transaction:e}){const{mutate:t}=bv();return E(Fw,{onClick:()=>{t([e].map(e=>({id:e.id,status:Vf.ACTIVE})))},children:"Restore"})}const Vw=yg({defaultValues:pT,render:function({form:e}){return E(Fw,{onClick:()=>{Qn()},closeOnClick:!0,children:"Attach Bill(s)"})}}),Hw=yg({defaultValues:pT,render:function({form:e}){return E(Fw,{onClick:()=>{Qn()},closeOnClick:!0,children:"Attach Payroll"})}}),qw=yg({defaultValues:pT,render:function({form:e}){return E(Fw,{onClick:()=>{Qn()},Icon:Sb,closeOnClick:!0,children:"Attach Invoice(s)"})}}),jw=Ti.filter(e=>"ONE_TIME"!=e.value);function zw({onClick:e}){const t=Sl();return E(Ru,{triggerChildren:E(Mu,{displayLabel:"Make recurring"}),popupChildren:E(bg,{frequencies:jw,onClick:n=>{e(n),t.setOpen(!1)}})})}const Kw=e=>null!=e&&"ONE_TIME"!=e.value,Yw=yg({defaultValues:pT,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:n}){const r=We(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),a=Se(),o=!yn(n)&&Rh(n)&&"EXPENSE"===n.type;return S(Qy,{children:[S(Jy,{children:[E(ek,{}),E(da,{children:t}),E(gk,{children:S(ou,{children:[n?.status===Vf.ACTIVE&&E(Uw,{transaction:n}),n?.status===Vf.INACTIVE&&E(Ww,{transaction:n}),r&&S(I,{children:["EXPENSE"===n?.type&&E(Vw,{form:e}),"EXPENSE"===n?.type&&E(Hw,{form:e}),"REVENUE"===n?.type&&E(qw,{form:e})]}),o&&E(e.Subscribe,{selector:e=>e.values.frequency,children:t=>a&&!Kw(t)&&E(zw,{onClick:t=>e.setFieldValue("frequency",t)})})]})})]}),E(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:E(e.SaveButton,{})})]})}});function _w({transactionId:e}){const{query:{data:t,isFetching:n},isFilling:r}=Pi({id:e});return{transaction:t,form:gT(t),bankAccount:Hh(t?.bankAccount.id??""),isManual:!yn(t)&&Rh(t),isLoading:r||n&&!t}}function Gw({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=_w({transactionId:e}),l=Se();if(i)return null;const s=E(Yw,{form:r,transaction:n,title:"Expense"}),c=n?.conversation?.id??null;return S(Ow,{onSubmit:r.handleSubmit,Header:s,initialTab:t,conversationId:c,transactionId:e,children:[n?.description&&E(Bw,{transaction:n,bankAccount:a}),E(r.AppField,{name:"amount",children:e=>E(o?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:o})}),E(r.AppField,{name:"vendor",children:e=>E(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:o})}),E(r.AppField,{name:"customer",children:e=>E(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:o})}),o&&E(r.Subscribe,{selector:e=>e.values.frequency,children:e=>l&&Kw(e)&&E(r.AppField,{name:"frequency",children:e=>E(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})})}),E(AT,{form:r}),o&&E(r.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:n})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note"})})]})}function Zw({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=_w({transactionId:e});if(i)return null;const l=E(Yw,{form:r,transaction:n,title:"Bank Transfer"}),s=n?.conversation?.id??null;return S(Ow,{onSubmit:r.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[n?.description&&E(Bw,{transaction:n,bankAccount:a}),E(r.AppField,{name:"amount",children:e=>E(o?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:o})}),E(r.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:n})}),E(r.AppField,{name:"glAccount",children:e=>E(e.BankGlAccountField,{transaction:n})}),E(r.AppField,{name:"matchingBankTransaction",children:e=>E(e.MatchingBankTransferField,{transaction:n})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note"})})]})}function Qw({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=_w({transactionId:e});if(i)return null;const l=E(Yw,{form:r,transaction:n,title:"Income"}),s=n?.conversation?.id??null;return S(Ow,{onSubmit:r.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[n?.description&&E(Bw,{transaction:n,bankAccount:a}),E(r.AppField,{name:"amount",children:e=>E(o?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:o})}),E(r.AppField,{name:"customer",children:e=>E(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),E(r.AppField,{name:"glAccount",children:e=>E(e.GlAccountField,{})}),o&&E(r.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:n})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note"})})]})}function Xw({transactionId:e,initialTab:t}){const{transaction:n,form:r,bankAccount:a,isManual:o,isLoading:i}=_w({transactionId:e});if(i)return null;const l=E(Yw,{form:r,transaction:n,title:"Tax Payment"}),s=n?.conversation?.id??null;return S(Ow,{Header:l,onSubmit:r.handleSubmit,initialTab:t,conversationId:s,transactionId:e,children:[n?.description&&E(Bw,{transaction:n,bankAccount:a}),E(r.AppField,{name:"amount",children:e=>E(o?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:o})}),E(r.AppField,{name:"tax.paymentInfo.region",children:e=>E(e.ButtonGroupField,{label:"Region",options:lT})}),E(r.AppField,{name:"tax.paymentInfo.quarter",children:e=>E(e.ButtonGroupField,{label:"Quarter",options:sT})}),E(r.AppField,{name:"tax.paymentInfo.year",children:e=>E(e.GenericSelectorField,{label:"Year",options:nn({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),o&&E(r.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:n})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note"})})]})}function Jw({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=Pi({id:e});if(k(()=>{!r&&yn(n)&&yi()},[n,r]),yn(n))return null;switch(n.type){case"EXPENSE":return E(Gw,{transactionId:e,initialTab:t});case"BANK_TRANSFER":return E(Zw,{transactionId:e,initialTab:t});case"REVENUE":return E(Qw,{transactionId:e,initialTab:t});case"TAX_PAYMENT":return E(Xw,{transactionId:e,initialTab:t})}}const $w={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},eC=(e={})=>{const t=bt($w,e);return $w.transform(t,vt)},tC=e=>Et(eC(e));tC.raw=eC;const nC={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},rC=(e={})=>{const t=bt(nC,e);return nC.transform(t,vt)},aC=e=>Et(rC(e));function oC({subject:e,children:t}){return S(Qy,{children:[S(Jy,{children:[E(ek,{}),E(da,{children:e})]}),E("div",{className:aC({alignItems:"center",gap:15}),children:t})]})}function iC({conversationId:e,defaultValues:t}){const[n,r]=f(e),{query:{data:a}}=$o(n),o="CLOSED"===a?.resolutionStatus;return E(IT,{children:S(DT,{children:[E(oC,{subject:a?.subject??"Conversation"}),E(Ew,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,defaultValues:t})]})})}aC.raw=rC;const lC=vo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_18201_5557)"},h.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}),h.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_18201_5557"},h.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function sC({onClick:e,active:t}){return E(ol,{type:"button",onClick:e,active:t,children:E(Ec,{Component:lC})})}const cC=Et({display:"flex",flexDirection:"column"});function dC({label:e,data:t,isFilling:n,shimmerWidth:r}){return S("div",{className:cC,children:[E(ha,{children:e}),n?E(kw,{width:r}):E(da,{wrap:"wrap",children:t??""})]})}function uC({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=Pi({id:e}),a=Hh(n?.bankAccount.id??"");if(yn(n))return null;const o=tC({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 S("div",{"data-open":t,className:o,children:[S("div",{className:aC({justifyContent:"space-between"}),children:[E(dC,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),E(dC,{label:"Amount",data:ia(iv(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),E(dC,{label:"Bank Account",data:td(a?.name??"",a?.mask??""),isFilling:r,shimmerWidth:"lg"}),E(dC,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function hC({conversationId:e,transactionId:t}){const[n,r]=f(e),[a,o]=f(!0),{query:{data:i}}=$o(n),l="CLOSED"===i?.resolutionStatus;return E(IT,{children:S(DT,{children:[E(oC,{subject:i?.subject??"Conversation",children:kn(t)&&E(sC,{onClick:()=>o(!a),active:a},"infoButton")}),kn(t)&&E(uC,{transactionId:t,isOpen:a}),E(Ew,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function pC(){const{query:{data:e}}=Mc({filter:{apiName:{equal:"PLAID"},status:{equal:"ACTIVE"}}}),t=e?.data,n=We(e=>e.drawerHistory).length>1,r=new Set(t?.flatMap(e=>null!=e.apiInstitutionName?[e.apiInstitutionName]:[]));return E(IT,{children:S(DT,{background:"foreground",children:[E(Qy,{children:S(Jy,{children:[E(ek,n?{Icon:bo}:{}),E(da,{children:"Add New Connection"})]})}),E(Lx,{connectedBankNames:r})]})})}function gC(){return E(Qy,{children:S(Jy,{children:[E(ek,{}),E(da,{children:"Financial Summary"})]})})}const mC=Et({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),vC=zt.raw({body:"default"}),bC=Et({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},vC);function fC({summaryText:e}){return E("div",{className:mC,children:E("div",{className:bC,children:e})})}const yC=Et({display:"flex",flexDirection:"column",overflow:"auto"});function kC({summary:e}){return S("div",{className:yC,children:[E(gC,{}),E(fC,{summaryText:e})]})}const xC=Et({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function TC({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return Rn({queryKey:qi({id:e}),queryFn:zi})}({id:e});return E(IT,{children:S("div",{className:xC,children:[E(DT,{children:E(kC,{summary:n?.summary})}),E(ci,{}),E(Iw,{conversationId:t??null,attachedEntityId:e})]})})}function wC(){return E(IT,{children:E(DT,{children:E(qx,{showCloseButton:!0})})})}const CC=u.object({id:u.string(),name:u.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:u.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:u.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),AC={mergeDestination:Hp,selectedAccount:null};const EC=Et({display:"flex",flexDirection:"column",gap:"20px"}),IC=Et({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),SC=Et.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),NC=Et(SC,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),PC=Et(SC,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),RC=Et(SC,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),DC=Et({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),MC=Et({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),OC=Et({width:"100%",display:"flex",justifyContent:"flex-start"}),LC=Et({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),BC=Et({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),FC=e=>{jd(e),zd(e)};function UC({account:e}){const t=Sl(),n=function(e,t){const{mutateAsync:n}=fd();return fg({defaultValues:AC,onSubmit:async r=>{if(await Ad()===jc&&kn(e)&&kn(r.value.selectedAccount)){const l=(a=e,o=r.value.mergeDestination,i=r.value.selectedAccount,o===Hp?{...wd(i),duplicateBankAccountIds:[Li(a.id)]}:{...wd(a),duplicateBankAccountIds:[Li(i.id)]});try{await n(l),t.setOpen(!1),r.value.mergeDestination===Hp&&yi()}catch{await Ed()}}var a,o,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:a}=ld();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 S("form",{className:EC,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:FC,children:[E(da,{children:"Merge Accounts"}),E("div",{className:IC,children:E(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>S(I,{children:[S("div",{className:NC,children:[E("div",{className:OC,children:E(da,{children:"Duplicate Account"})}),t===Hp?E(Fp,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):E(n.AppField,{name:"selectedAccount",children:n=>E(jp,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:zp(t,e,n.state.value)})})]}),S("div",{className:PC,children:[E("div",{className:LC,children:E(da,{children:"Into"})}),E(n.AppField,{name:"mergeDestination",children:e=>E("div",{className:MC,children:E(ol,{onClick:()=>e.handleChange(e.state.value===Hp?Vp:Hp),children:E(Ec,{Component:fo})})})})]}),S("div",{className:RC,children:[E("div",{className:BC,children:E(da,{children:"Destination Account"})}),t===Hp?E(n.AppField,{name:"selectedAccount",children:n=>E(jp,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:zp(t,e,n.state.value)})}):E(Fp,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),S("div",{className:DC,children:[E(xg,{showIcon:!1,onClick:()=>{t.setOpen(!1)}}),E(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>E(Dd,{disabled:yn(e),showIcon:!1,textContent:"Merge"})})]})]})}function WC({bankAccount:e}){return E(ou,{children:S(Il,{placement:"right-start",modal:!0,children:[E(Nl,{children:e=>S(fu,{...e,children:[E(Ec,{Component:Ak}),E(da,{children:"Merge Accounts"})]})}),E(ay,{children:E(ly,{children:E(cy,{children:E(UC,{account:e})})})})]})})}const VC=Et({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"}}}),HC=({tranStartDate:e})=>S(I,{children:[E(ha,{children:"Start Date"}),wn(e)?E(da,{children:`${vn(dn(e))}`}):E(da,{children:"Set Start Date"})]});function qC({bankAccount:e}){return S(Il,{placement:"right-start",modal:!0,children:[E(Nl,{children:t=>E("button",{className:St(VC,ko),...t,type:"button",children:E(HC,{tranStartDate:e.tranStartDate})})}),E(ay,{children:E(ly,{children:E(cy,{width:"sm",children:E(Tk,{bankAccounts:[e]})})})})]})}const jC=e=>["accounting/manualJournalEntry",e.id],zC=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 jo(a)};function KC({id:e}){return Rn({queryKey:jC({id:String(Li(e))}),queryFn:zC,enabled:kn(e)})}const YC=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:Rr(n)};return await Er(r)})({data:e,accessToken:t,environment:n});const _C=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:Rr(n)};return await Er(r)},GC=u.object({amount:u.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:u.string("Required")}),ZC=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===Li(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},QC=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=KC({id:t??null}),r=function(){const{query:{data:e}}=Xh();return ap(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:a}=hd({mutationFn:_C,onSuccess:async()=>{gr("beginning balance mutation successful, invalidating bank account queries");try{return Sn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&mr({error:e,severity:"error"})}}});const{mutate:o}=hd({onSuccess:async()=>{gr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([Sn.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),Sn.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&mr({error:e,severity:"error"})}},mutationFn:YC}),i=Sl(),l=((e,t)=>{const n=ZC(e,t);return{amount:kn(e.beginningBalanceData.journalEntry?.id)?n:"",date:kn(t?.date)?t.date:""}})(e,n);return fg({defaultValues:l,validators:{onBlur:GC},onSubmit:l=>{if(i.setOpen(!1),yn(t)||yn(n))a({bankAccountId:Li(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,a)=>{if(yn(e.id))return null;const o={...e,id:e.id},i=a.map(e=>Li(e.id));let l=0;return o.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===Li(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),yn(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=un(t)??o.date,o)})(n,dn(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);kn(t)&&o(t)}}})},XC=Et({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),JC=Et({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function $C({bankAccount:e}){const t=QC(e),n=Sl(),r=()=>{n.setOpen(!1)};return S("form",{className:XC,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[E(da,{children:"Set Beginning Balance"}),E(t.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),E(t.AppField,{name:"amount",children:e=>E(e.EditableAmountField,{label:"Beginning Balance Amount"})}),E(t.Subscribe,{selector:e=>e,children:e=>S("div",{className:JC,children:[E(xg,{showIcon:!1,onClick:r}),E(Dd,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const eA=Pt({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"}}}}),tA=Et({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function nA({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:a="left"}){const o=St(eA({layout:a}),ko),i=St(eA({layout:"right"}),ko),l=r&&vn(r);return S(Il,{placement:"right-start",modal:!0,children:[E(Nl,{children:e=>S("div",{className:tA,children:[S("button",{className:o,...e,type:"button",children:[E(ha,{children:"Beginning Balance"}),E(da,{children:kn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&S("button",{className:i,...e,type:"button",children:[E(ha,{children:"Migration Date"}),E(da,{children:l})]})]})}),E(ay,{children:E(ly,{children:E(cy,{width:"sm",children:E($C,{bankAccount:e})})})})]})}const rA=Pt({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function aA({bankAccount:e,showStartDate:t}){const{query:{data:n}}=KC({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=ZC(e,n),a=kn(n?.date)?dn(n?.date):null,o=kn(e.tranStartDate)?dn(e.tranStartDate):null,i=kn(a)&&kn(o)&&!rn(a,o),l=i?"left":t?"right":"left";return S("div",{className:rA({layout:i?"stacked":"inline"}),children:[t&&E(qC,{bankAccount:e}),E(nA,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:a})]})}const oA=Et({marginTop:"15px",marginBottom:"15px"}),iA={id:"",name:"",mask:"",type:void 0};const lA=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],sA=e=>{jd(e),zd(e)};function cA({bankAccountId:e}){const t=Hh(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:iA,[r,a]=f(n),o=function(e,t){const{mutate:n}=fd(),{mutateAsync:r}=bd({mutationFn:gd}),a=wn(String(e.id));return fg({defaultValues:e,validators:{onBlur:CC},onSubmit:async e=>{if(a)n(wd(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:Oi({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||kd(t.apiName),l=!!t&&xd(t.apiName),s=td(r?.name??"",r?.mask??""),c=wn(s)?s:"New Bank Account",d=l&&kn(t?.tranStartDate),u=kn(t)&&(d||!0);return E(IT,{children:E(DT,{children:S("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:sA,children:[S(Qy,{children:[S(Jy,{children:[E(ek,{}),E(da,{children:c}),kn(t)&&E(gk,{children:E(WC,{bankAccount:t})})]}),E(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:E(o.SaveButton,{})})]}),S(Nw,{children:[E(o.AppField,{name:"name",children:e=>E(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),E(o.AppField,{name:"mask",children:e=>E(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),E(o.AppField,{name:"type",children:e=>E(e.GenericSelectorField,{label:"Account Type",options:lA,disabled:!i})}),u&&S(I,{children:[E("div",{className:oA,children:E(ci,{alignment:"horizontal"})}),E(aA,{bankAccount:t,showStartDate:d})]})]})]})})})}function dA(){return S(Jx,{children:[E(eT,{name:"BankTransactionFormRouter",Component:Jw}),E(eT,{name:"Conversation",Component:iC}),E(eT,{name:"MobileConversation",Component:hC}),E(eT,{name:"FinancialSummary",Component:TC}),E(eT,{name:"BanksAndIntegrations",Component:wC}),E(eT,{name:"BankAccountForm",Component:cA}),E(eT,{name:"NewConnection",Component:pC})]})}const uA=({environment:e,children:t})=>E(Nn.Provider,{value:e,children:t}),hA=async e=>{const t=e.queryKey,n={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await jo(n)};function pA({children:e}){const{query:{data:t}}=Rn({queryKey:["sdk/introspect"],queryFn:hA}),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?Oi({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 E(es.Provider,{value:n,children:e})}const gA=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const mA="SSE connection failed with status";function vA({companyId:e,customerPartnerId:t,sseTypes:n}){const r=Pn();k(()=>{if(!t)return;const a=new AbortController,o=function(e,t,n,r){const a=new URL(`${o=e,Pr[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(`${mA} ${e.status}`)}(e),onmessage:a=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:a,companyId:o}){switch(e){case gA.CONNECTED:return void gr("SSE connection established",{env:n,customerPartnerId:a,companyId:o,sseTypes:JSON.stringify(Array.from(r))});case gA.ERROR:throw mr({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case gA.CACHE_BUST:return gr("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(()=>{Sn.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>mr({error:e,severity:"error"}))},500*Math.random()),gr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void mr({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 mr({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(mA))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:a.signal}).catch(e=>mr({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[r,t,e,n])}const bA=[gA.CACHE_BUST];function fA({children:e}){const{companyId:t,customerPartnerId:n}=v(es);return vA({companyId:t,customerPartnerId:n,sseTypes:bA}),e}const yA="undefined"!=typeof window?C:k,kA="undefined"==typeof window;function xA(e={}){let{initializeWithValue:t=!0}=e;kA&&(t=!1);const[n,r]=f(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),a=function(e,t=500,n){const r=p();!function(e){const t=p(e);t.current=e,k(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const a=g(()=>{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 k(()=>{r.current=c(e,t,n)},[e,t,n]),a}(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=p(t);yA(()=>{a.current=t},[t]),k(()=>{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),yA(()=>{o()},[]),n}const TA=({children:e})=>{const{width:t,height:n}=xA({debounceDelay:150}),r={dimensions:{width:t,height:n}};return E(Vb.Provider,{value:r,children:e})};function wA({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return k(()=>{var e,r;e=n,r=t,cr.setProperties(hr),ur=r,dr=e},[n,t]),E(uA,{environment:t,children:E(Yx,{children:E(Cn.Provider,{value:r,children:E(pA,{children:E(fA,{children:S(TA,{children:[E(me.ConfirmationRoot,{}),e,E(dA,{})]})})})})})})}export{jx as BanksAndIntegrations,gf as BusinessOwnerDashboard,wA as Tight,Gy as TransactionsDashboard,Qe 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 a,mapValues as o,isEqual as i,differenceBy as l,isEmpty as s,debounce as c}from"lodash-es";import*as d from"zod";import{z as u}from"zod";import*as h from"react";import{useRef as p,useMemo as g,createContext as m,useContext as v,Component as b,useState as f,useCallback as y,useEffect as k,createElement as x,forwardRef as T,useReducer as C,useLayoutEffect as w,useImperativeHandle as A}from"react";import{jsx as E,Fragment as I,jsxs as S}from"react/jsx-runtime";import{QueryClient as N,useIsRestoring as P,useQuery as D,keepPreviousData as R,useMutation as M}from"@tanstack/react-query";import O from"yocto-queue";import L from"big.js";import{ResponsiveContainer as F,BarChart as B,Legend as U,CartesianGrid as V,XAxis as W,YAxis as H,Tooltip as q,Bar as j,ReferenceLine as z,Line as K}from"recharts";import{flexRender as Y,createColumnHelper as _,useReactTable as G,getCoreRowModel as Q,getExpandedRowModel as Z}from"@tanstack/react-table";import{useFloatingNodeId as X,useFloating as J,offset as $,flip as ee,shift as te,size as ne,autoUpdate as re,useClick as ae,useDismiss as oe,useRole as ie,useInteractions as le,useFloatingParentNodeId as se,FloatingTree as ce,FloatingNode as de,useMergeRefs as ue,FloatingOverlay as he,FloatingPortal as pe,FloatingFocusManager as ge}from"@floating-ui/react";import{ContextAwareConfirmation as me,confirmable as ve}from"react-confirm";import{createFormHookContexts as be,useStore as fe,createFormHook as ye}from"@tanstack/react-form";import{NumericFormat as ke}from"react-number-format";import xe from"fuse.js";import{v4 as Te}from"uuid";import{openDB as Ce}from"idb";import{PersistQueryClientProvider as we}from"@tanstack/react-query-persist-client";import{fetchEventSource as Ae}from"@microsoft/fetch-event-source";function Ee(e,t){return`${e.trim()}:${t.trim()}`}const Ie=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,Ee("featureFlags","updateFlags"))});function Se(){return He(e=>e.FEATUREFLAG_FREQUENCY_SELECTOR)}function Ne(){return He(e=>e.FEATUREFLAG_SUGGESTED_CATEGORIES)}const Pe="drawerNavigation",De=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,Ee(Pe,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1),closingDrawerCount:0}},void 0,Ee(Pe,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ee(Pe,"closeAllDrawers")),requestCloseDrawer:()=>e(e=>0===e.drawerHistory.length?{}:{closingDrawerCount:1},void 0,Ee(Pe,"requestCloseDrawer")),requestCloseAllDrawers:()=>e(e=>({closingDrawerCount:e.drawerHistory.length}),void 0,Ee(Pe,"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,Ee(Pe,"confirmCloseDrawer")),confirmCloseAllDrawers:()=>e(()=>({drawerHistory:[],closingDrawerCount:0}),void 0,Ee(Pe,"confirmCloseAllDrawers"))}),Re=e=>({externalOptions:{},setOptions:(t,n=!1)=>e(e=>n?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,Ee("externalOptions","setOptions"))});function Me(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Oe(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=Oe(n.children);t.push(...e)}}return t}function Le(e){return e[e.length-1]}const Fe="transactionsDashFilters",Be=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:[...e.transactionsDashFilters,...t]}),void 0,Ee(Fe,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:Me(e.transactionsDashFilters,t)}),void 0,Ee(Fe,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:t}),void 0,Ee(Fe,"setFilters"))}),Ue={label:"Connected Accounts",value:"connected"},Ve="banksAndIntegrationsState",We=e=>({banksAndIntegrationsSelectedTab:Ue,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,Ee(Ve,"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,Ee(Ve,"toggleExpandedIntegration"))}),He=e()(t(n((...e)=>({...Ie(...e),...De(...e),...Re(...e),...Be(...e),...We(...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})),qe={SELECT:"select",EXPAND:"expand"},je={...qe,DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},ze=[je.COMMENTS,je.DATE,je.DESCRIPTION,je.AMOUNT,je.CATEGORY,je.CLASS_SEGMENT,je.REVIEW_STATUS],Ke=d.object({pageSize:d.optional(d.int32().positive()),columns:d.optional(d.array(d.enum(ze)))}),Ye=d.optional(d.string().trim()),_e=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ge=d.optional(d.array(d.string().trim())),Qe=d.object({integrations:d.optional(d.array(d.enum(["UNIT","STRIPE","GUSTO","SHOPIFY","SQUARE","RUTTER","UBER","MOOV","QUALPAY","MANUAL_ENTRY","PARTNER_IMPLEMENTATION","QBO","XERO","FRESHBOOKS"])))}),Ze={transactionsDashboard:e=>{const t=Ke.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=Ye.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Ge.safeParse(e);if(!t.success||void 0===t.data)return;const n=t.data.filter(e=>_e.test(e));return n.length>0?n:void 0},banksAndIntegrations:e=>{const t=Qe.safeParse(e);return t.success?t.data:void 0}},Xe=(e,t)=>{if(void 0!==Ze[e])return(0,Ze[e])(t)};function Je(e){const t=p(!1),n=He(e=>e.setOptions);if(e&&!t.current){n(function(e){let t={};for(const[n,r]of a(e)){const e=Xe(n,r);void 0!==e&&(t={...t,[n]:e})}return t}(e)),t.current=!0}const o=He(e=>e.externalOptions);return{options:g(()=>r(o),[o]),setOptions:n}}function $e(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function et(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function tt(e){return String.fromCharCode(e+(e>25?39:97))}function nt(e){return function(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=tt(t%52)+n;return tt(t%52)+n}(function(e,t){let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e}(5381,e)>>>0)}var rt=/\s*!(important)?/i;function at(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var ot=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}},it=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function lt(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(n=>{if(it.has(n))return;const r=e[n],a=t[n];$e(r)&&$e(a)?e[n]=lt(r,a):e[n]=a}),e):e,{})}var st=e=>null!=e;function ct(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);st(u)&&(i[c]=u)}return i}var i;return t(n,o)}(e)}function dt(e,t,n=!0){const{utility:r,conditions:a}=t,{hasShorthand:o,resolveShorthand:i}=r;return ct(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 ut={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},ht=/([A-Z])/g,pt=/^ms-/,gt=ot(e=>e.startsWith("--")?e:e.replace(ht,"-$1").replace(pt,"-ms-").toLowerCase()),mt=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),vt=`(?:${"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("|")})`,bt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${vt}$`),ft={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):$e(e)?ct(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&mt.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&bt.test(e)},yt=(e,t)=>{if(!e?.defaultValues)return t;const n="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},n,et(t))};const kt=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(",")),xt=/^@|&|&$/;function Tt(e){return kt.has(e)||xt.test(e)}const Ct=/^_/,wt=/&|@/,At=/* @__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(":");At.set(t,n)});const Et={conditions:{shift:function(e){return e.sort((e,t)=>{const n=Tt(e),r=Tt(t);return n&&!r?1:!n&&r?-1:0})},finalize:function(e){return e.map(e=>kt.has(e)?e.replace(Ct,""):wt.test(e)?`[${at(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${At.get(e)||gt(e)}_${at(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},It=function(e){const{utility:t,hash:n,conditions:r=ut}=e,a=e=>[t.prefix,e].filter(Boolean).join("-");return ot(({base:o,...i}={})=>{const l=dt(Object.assign(i,o),e),s=/* @__PURE__ */new Set;return ct(l,(e,o)=>{if(null==e)return;const i="string"==typeof(u=e)&&rt.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(rt,"").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,nt))}else i=[...r.finalize(e),a(o)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(Et),St=(...e)=>It(Nt(...e));St.raw=(...e)=>Nt(...e);const{mergeCss:Nt}=function(e){function t(t){const n=function(...e){return e.flat().filter(e=>$e(e)&&Object.keys(et(e)).length>0)}(...t);return 1===n.length?n:n.map(t=>dt(t,e))}return{mergeCss:ot(function(...e){return lt(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(Et);function Pt(){let e,t="",n=0;for(;n<arguments.length;)(e=arguments[n++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Dt=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Rt(e){const{base:t,variants:n,defaultVariants:r,compoundVariants:a}=Dt(e),o=e=>({...r,...et(e)});function i(e={}){const r=o(e);let i={...t};for(const[t,a]of Object.entries(r))n[t]?.[a]&&(i=Nt(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=Nt(n,e.css))}),n}(a,r);return Nt(i,l)}const l=Object.keys(n),s=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(ot(function(e){return St(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const o=Dt(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 Rt({base:Nt(t,o.base),variants:Object.fromEntries(i.map(e=>[e,Nt(n[e],o.variants[e])])),defaultVariants:lt(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 Mt,Ot=((Mt=Ot||{}).component="component",Mt["dashboard-placeholder-table"]="dashboard-placeholder-table",Mt["dashboard-header"]="dashboard-header",Mt["dashboard-table"]="dashboard-table",Mt["dashboard-table-body"]="dashboard-table-body",Mt["dashboard-table-cell"]="dashboard-table-cell",Mt["dashboard-table-column-header"]="dashboard-table-column-header",Mt["dashboard-table-header"]="dashboard-table-header",Mt.label="label",Mt.popup="popup",Mt["popup-sort-row"]="popup-sort-row",Mt["progress-bar"]="progress-bar",Mt["progress-bar-fill"]="progress-bar-fill",Mt.summation="summation",Mt["table-parent-row"]="table-parent-row",Mt["table-row"]="table-row",Mt["table-sub-row"]="table-sub-row",Mt.tile="tile",Mt["tile-bar-label"]="tile-bar-label",Mt["tile-body"]="tile-body",Mt["tile-filter-button"]="tile-filter-button",Mt["tile-filter-list"]="tile-filter-list",Mt["tile-filter-row"]="tile-filter-row",Mt["tile-header"]="tile-header",Mt["tile-title"]="tile-title",Mt.title="title",Mt["business-owner-dashboard"]="business-owner-dashboard",Mt["business-owner-dashboard-header"]="business-owner-dashboard-header",Mt["business-owner-table"]="business-owner-table",Mt["transaction-type-label"]="transaction-type-label",Mt["selector-row"]="selector-row",Mt["popup-list"]="popup-list",Mt.badge="badge",Mt["date-cell"]="date-cell",Mt["expander-cell"]="expander-cell",Mt["vertical-divider"]="vertical-divider",Mt["horizontal-divider"]="horizontal-divider",Mt["table-cell-divider"]="table-cell-divider",Mt["checkbox-input"]="checkbox-input",Mt["bulk-select"]="bulk-select",Mt["button-base"]="button-base",Mt["button-discrete-small"]="button-discrete-small",Mt["button-primary"]="button-primary",Mt["button-secondary"]="button-secondary",Mt["button-tertiary"]="button-tertiary",Mt["button-danger"]="button-danger",Mt["button-warning"]="button-warning",Mt["button-action"]="button-action",Mt.text="text",Mt["cell-button"]="cell-button",Mt["month-picker-left-button"]="month-picker-left-button",Mt["month-picker-right-button"]="month-picker-right-button",Mt["filter-bar"]="filter-bar",Mt["filter-search-bar"]="filter-search-bar",Mt["filter-pill"]="filter-pill",Mt["discrete-form-input"]="discrete-form-input",Mt["editable-form-input"]="editable-form-input",Mt["category-text"]="category-text",Mt["amount-input-container"]="amount-input-container",Mt["amount-input"]="amount-input",Mt["modal-popup"]="modal-popup",Mt["drawer-header"]="drawer-header",Mt["drawer-header-border"]="drawer-header-border",Mt["form-body"]="form-body",Mt.body="body",Mt.heading="heading",Mt["sub-label"]="sub-label",Mt["strong-label"]="strong-label",Mt["strong-sub-label"]="strong-sub-label",Mt["metric-xl"]="metric-xl",Mt["metric-md"]="metric-md",Mt["large-icon"]="large-icon",Mt["medium-icon"]="medium-icon",Mt["small-icon"]="small-icon",Mt["tiny-icon"]="tiny-icon",Mt["neutral-badge"]="neutral-badge",Mt["highlight-badge"]="highlight-badge",Mt["success-badge"]="success-badge",Mt["warning-badge"]="warning-badge",Mt["critical-badge"]="critical-badge",Mt["button-group"]="button-group",Mt["alert-dialog"]="alert-dialog",Mt["alert-header"]="alert-header",Mt["emphasis-label"]="emphasis-label",Mt["profit-loss-graph"]="profit-loss-graph",Mt.banner="banner",Mt["banner-high"]="banner-high",Mt["banner-medium"]="banner-medium",Mt["banner-low"]="banner-low",Mt["banner-urgent"]="banner-urgent",Mt["banner-default"]="banner-default",Mt["banner-button"]="banner-button",Mt["banner-button-text"]="banner-button-text",Mt["banner-button-icon"]="banner-button-icon",Mt["empty-dashboard-layout"]="empty-dashboard-layout",Mt["zero-state-layout"]="zero-state-layout",Mt["emphasis-sub-label"]="emphasis-sub-label",Mt);const Lt="Tight-",Ft=e=>`${Lt}${e}`;function Bt(e){return e in Ot}function Ut(e){const t=e.indexOf("-"),n=e.slice(0,t+1),r=e.slice(t+1);return n===Lt&&r in Ot}function Vt(e){return!Bt(e)&&!Ut(e)}const Wt=(e,...t)=>{const n=[],r=[];return null!==e&&n.push(Ft(e)),t.forEach(e=>{void 0!==e&&(Vt(e)?r.push(e):Bt(e)&&n.push(Ft(e)))}),{className:Pt(...n,...r)}},Ht=Wt(Ot["business-owner-dashboard-header"],St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80}));function qt({children:e}){return E("div",{...Ht,children:e})}function jt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Ut(t)&&e.push(t),e),[])],[])}function zt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Vt(t)&&e.push(t),e),[])],[])}function Kt(e){const t=Array.isArray(e)?e:[e];return{className:Pt(...jt(t),...zt(t))}}const Yt=Rt({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{sm:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:"heading",fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),_t=Wt(Ot.heading,Yt({heading:"default"}));function Gt({children:e,stylists:t=[]}){const n=Kt([_t,...t]);return E("div",{...n,children:e})}function Qt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Zt(e,t,n){return new Date(e,t,n)}function Xt(e,t){return Qt(Zt(t,e,1))}const Jt={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},$t=e=>{switch(e){case Jt.THIS_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear(),0,1));case Jt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Xt(e.getMonth(),e.getFullYear())}();case Jt.LAST_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case Jt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear(),e.getMonth()-1,1))}();case Jt.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear()-1,e.getMonth(),1))}();default:return""}},en=e=>{switch(e){case Jt.THIS_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case Jt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear(),e.getMonth()+1,0))}();case Jt.LAST_YEAR:return Qt(Zt(/* @__PURE__ */(new Date).getFullYear(),0,0));case Jt.PAST_YEAR:case Jt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Qt(Zt(e.getFullYear(),e.getMonth(),0))}();default:return""}},tn=e=>{return t=e,Object.values(Jt).includes(t)?{beginDate:$t(e),endDate:en(e)}:{beginDate:Qt((n=e).beginDate),endDate:Qt(n.endDate)};var t,n},nn=["SUN","MON","TUE","WED","THU","FRI","SAT"],rn=["January","February","March","April","May","June","July","August","September","October","November","December"];function an({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 on(e,t){return e.toDateString()===t.toDateString()}function ln(e){return on(e,/* @__PURE__ */new Date)}function sn(e,t){const n=Zt(e.getFullYear(),e.getMonth(),e.getDate()),r=Zt(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()>r.getTime()}function cn(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 dn(e,t,n){if(e<1||e>12||t<1||t>31)return!1;const r=Zt(n,e-1,t);return!(r.getFullYear()!==n||r.getMonth()!==e-1||r.getDate()!==t)}function un(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 dn(o,i,l)?Zt(l,o-1,i):null}function hn(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 dn(i,l,o)?Zt(o,i-1,l):null}function pn(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:null}function gn(e,t){return sn(e,t)?t:e}function mn(e,t){return sn(t,e)?t:e}const vn=(e,t)=>{const n={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",n)},bn=e=>{const t=new Date(e||""),n=/* @__PURE__ */new Date;return ln(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===n.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):vn(t,{abbreviateMonth:!0,abbreviateYear:!1})},fn=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}):null;function yn(e,t,n){return[...e,{accessToken:t,environment:n}]}function kn(e,t){return[...e,t]}const xn=e=>null==e,Tn=e=>!xn(e);function Cn(e){return""===e.trim()}function wn(e){return xn(e)||Cn(e)}function An(e){return!wn(e)}const En=m({activeToken:void 0,accountantToken:void 0});function In(){const{activeToken:e}=v(En);return e}const Sn=()=>{throw new Error("No access token provided")},Nn=72e5,Pn=new N({defaultOptions:{queries:{gcTime:Nn,staleTime:3e4,refetchInterval:6e4}}}),Dn=m("SANDBOX");function Rn(){return v(Dn)}function Mn({queryKey:e,queryFn:t,...n}){const r=In(),a=Rn(),o=An(r),i=yn(e,r??"",a),l=P(),s=D({...n,queryKey:i,queryFn:o?t:Sn,placeholderData:n.keepPreviousDataPlaceholder?R:void 0,...o?{}:{retry:!1,staleTime:1/0}},Pn);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class On{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 Ln=Symbol("Circular"),Fn=Symbol("AccessError");function Bn(e,t,n){return Un({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:n?.depthLimit,edgeIndex:0,edgesLimit:n?.edgesLimit})}function Un({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=Ln),n&&(s=n(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Vn(()=>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=Vn(()=>s[i]);e.push(Un({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=Vn(()=>s[c]);e[c]=Un({key:c,value:d,replacer:n,seen:r,depth:o,depthLimit:a,edgeIndex:i,edgesLimit:l})}s=e}return r.pop(),s}function Vn(e){try{return e()}catch{return Fn}}const Wn=Object.prototype.toString,Hn=Object.getPrototypeOf;function qn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const jn=/^\s*at .*(\S+:\d+|\(native\))/m,zn=/^(eval@)?(\[native code])?$/;function Kn(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 Yn(e,t){const n=_n(e,t);let r;"InvalidError"===n.name&&(r={[t]:{"non-error parameter":e}}),void 0!==n.metadata&&qn(n.metadata)&&(r={...r,[n.name]:n.metadata});const a=[Gn(n)];return a.push(...Xn(n).map(e=>Gn(e,{backtrace:!1}))),{exceptions:a,metadata:r}}function _n(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===Wn.call(t))return!0;t=Hn(t)}return!1}(e))return e;let n=function(e){if(!qn(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 Gn(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:Qn(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function Qn(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(jn)?e.split("\n").filter(e=>!!e.match(jn)).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=Kn(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(zn)).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=Kn(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<Zn;){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 Zn=20;function Xn(e){const t=e;if(t.cause){const e=_n(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Xn(e))}return[]}function Jn(...e){console.log}function $n(...e){console.error}const er={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 tr=Date.now();const nr=()=>{tr=Date.now()},rr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-tr,!0}),{reset:nr})},ar=[["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\)$/]],or=[["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/]],ir=(lr=function(e){const t=""!==(n=e)&&ar.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 or)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,...lr(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 lr;class sr{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 cr 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}=Yn(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 E(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return E(I,{children:this.props.children})}}const dr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:n,children:r})=>E(cr,{client:e,onError:t,FallbackComponent:n,children:r})})},ur=new class{breadcrumbs=[];config;delivery=new On(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return $n(),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}=Yn(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=Bn(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){$n()}}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 hr="",pr="";const gr="prod",mr=ur.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"1.4.1",appType:"browser",releaseStage:gr,plugins:[rr,ir,er,(()=>{const e=new sr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),dr]}),vr=(e,t)=>{try{ur.leaveBreadcrumb(e,t)}catch(n){n instanceof Error?br({error:n,severity:"error"}):br({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:n}})}},br=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:hr,environment:pr}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await br({error:t,severity:"error"}):await br({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},fr=mr.getPlugin("react"),yr=fr?.BugsnagErrorBoundary,kr=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,xr=({extraHeaders:e,authorization:t})=>{const n={...e};return void 0!==t&&(n.Authorization=t),n},Tr=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},Cr={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function wr(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?Cr:{}}});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 Ar({authorization:e,extraHeaders:t,includeCredentials:n,method:r="POST",params:a,url:o}){const i=xr({extraHeaders:t,authorization:e});vr("HTTP POST Request",{url:o,accessToken:e});try{const e=await fetch(o,{method:r,headers:i,credentials:"include",body:JSON.stringify(a)});return vr("HTTP POST Response",{url:o,status:e.status,statusText:e.statusText}),Tr(e)}catch(l){return Promise.reject(l)}}async function Er(e){const{url:t,headers:n}=wr(e);return Ar({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:n})}async function Ir(e){return Er(e)}async function Sr(e){return Er(e)}const Nr=(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}),Pr={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},Dr={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Rr={...Dr,LOCAL:"http://localhost:8082"};function Mr(e){return Nr(`${t=e,Pr[t]}/v5`,"v5");var t}const Or=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],Lr=async e=>{const t=e.queryKey,n=t[1],r=t[2].accessToken,a=t[2].environment,o={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...tn(n.filter),...n.grouping&&{grouping:n.grouping}},accessToken:r,endpointManager:Mr(a)};return await Sr(o)};function Fr({filter:e,grouping:t,select:n}){return Mn({queryKey:Or({filter:e,grouping:t}),queryFn:Lr,select:n})}const Br="noDataHeight";function Ur(e){const t=function(e){const t=hn(e??"");return null!==t?vn(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}(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?L(t).minus(r).toNumber():0,loss:a,remainingExpenses:void 0!==n?L(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 Vr(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const n=e.json?.data;if(xn(n))return t;for(const i of n){const{month:e,netIncome:n}=Ur(i);t.total=L(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 Wr=Wt(Ot["tile-header"],St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Hr({title:e}){return E("div",{...Wr,children:E(Gt,{children:e})})}const qr=Wt(Ot["tile-body"],St({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderBottomRadius:"lg",borderTop:"hidden"}));function jr({children:e}){return E("div",{...qr,children:e})}const zr=Rt({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function Kr({children:e,type:t,isSample:n=!1}){const r=Wt(Ot.tile,zr({type:t,isSample:n}));return E("div",{...r,children:e})}const Yr=St({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),_r=St.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),Gr=St({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),Qr=Wt(Ot.text,St({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr);function Zr({children:e}){return E("div",{...Qr,children:e})}const Xr=Wt(Ot["metric-xl"],Yt({metric:"xl"}));function Jr(e){return E("div",{...Xr,children:e.children})}const $r=Wt(Ot.summation,St({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function ea({title:e,label:t}){return S("div",{...$r,children:[E(Jr,{children:e}),E(Zr,{children:t})]})}const ta=Wt(null,St({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function na({children:e}){return E("div",{...ta,children:e})}const ra=(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},aa=(e,t=0,n=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:n}),oa=1e9;function ia(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<oa&&c>=1e3&&(c/=1e3),r>=oa?a="B":r>=1e6?a="M":(c=Math.round(c),a="K"),i=`${aa(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=ra(o,a)):"always"===t?(a=n,l=n,e=ra(o,a)):"default"===t&&Math.abs(o)>=1e3?(a=r,l=r,e=ra(o,a)):(a=n,e=ra(o,a),l=e%1==0?r:n),s=Math.sign(e)<0;const d=Math.abs(e);i=aa(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 la(e){return ia(e,{condense:!0,dollarSign:!0})}function sa(e){return ia(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const ca={"sm-sm":Wt(Ot.text,St({fontSize:{sm:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"sm-med":Wt(Ot.text,St({fontSize:{sm:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"sm-lg":Wt(Ot.text,St({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"med-sm":Wt(Ot.text,St({fontSize:{sm:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"med-med":Wt(Ot.text,St({fontSize:{sm:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr),"med-lg":Wt(Ot.text,St({fontSize:{sm:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),Yr)};function da({children:e,size:t,weight:n,stylists:r=[]}){const a=Kt([ca[`${t}-${n}`],...r]);return E("div",{title:e,...a,children:e})}const ua=Rt({variants:{wrap:{ellipsis:_r,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function ha({wrap:e="ellipsis",textAlign:t="start",children:n,stylists:r=[]}){if(wn(n))return null;const a=Wt(Ot["strong-label"],Yt({label:"strongLabel"}),ua({wrap:e,textAlign:t}));return E(da,{size:"med",weight:"med",stylists:[a,...r],children:n})}const pa=Rt({base:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px",fontStyle:"normal"},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:_r,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}}}});function ga({intent:e,wrap:t="ellipsis",children:n,accent:r}){const a=void 0===e&&void 0===r?"normal":e,o=Wt(Ot["sub-label"],pa({intent:a,wrap:t,accent:r}),Yr);return wn(n)?null:E("div",{...o,children:n})}const ma=Wt(null,St({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 va({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===Br)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),S("div",{...ma,children:[E(ha,{children:t[0].name??""}),E(ga,{children:la(Number(n))})]})}const ba={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"11px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"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:"0.3s ease-out both slide-in-right",variable:"var(--Tight-animations-slideIn-right)"},"animations.slideIn.up":{value:"0.3s ease-out both slide-in-up",variable:"var(--Tight-animations-slideIn-up)"},"animations.slideOut.right":{value:"0.3s ease-in both slide-out-right",variable:"var(--Tight-animations-slideOut-right)"},"animations.slideOut.down":{value:"0.3s ease-in both slide-out-down",variable:"var(--Tight-animations-slideOut-down)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(24, 36, 40, 0.10)",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discrete":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discrete)"},"colors.surface.intent.action.discrete.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discrete-hover)"},"colors.surface.intent.action.discrete.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discrete-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-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-green500)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.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.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discrete":{value:"var(--Tight-colors-colorPalette-intent-action-discrete)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete)"},"colors.colorPalette.action.discrete":{value:"var(--Tight-colors-colorPalette-action-discrete)",variable:"var(--Tight-colors-colorPalette-action-discrete)"},"colors.colorPalette.discrete":{value:"var(--Tight-colors-colorPalette-discrete)",variable:"var(--Tight-colors-colorPalette-discrete)"},"colors.colorPalette.intent.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)"},"colors.colorPalette.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-action-discrete-hover)"},"colors.colorPalette.discrete.hover":{value:"var(--Tight-colors-colorPalette-discrete-hover)",variable:"var(--Tight-colors-colorPalette-discrete-hover)"},"colors.colorPalette.intent.action.discrete.active":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-active)"},"colors.colorPalette.action.discrete.active":{value:"var(--Tight-colors-colorPalette-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-action-discrete-active)"},"colors.colorPalette.discrete.active":{value:"var(--Tight-colors-colorPalette-discrete-active)",variable:"var(--Tight-colors-colorPalette-discrete-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.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.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)"}};function fa(e,t){return ba[e]?.value||t}fa.var=function(e,t){return ba[e]?.variable||t};const ya=Wt(null,St({borderRadius:"50%",flexShrink:0})),ka=Wt(null,St({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),xa=fa.var("colors.surface.foreground.disabled");function Ta({color:e=xa,diameter:t=17,label:n}){return S("div",{...ka,"data-testid":"bullet-row",children:[E("div",{...ya,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),n&&E(ga,{children:n})]})}const Ca=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function wa({payload:e}){return void 0===e?null:E("div",{...Ca,children:e.map((e,t)=>"none"!==e.type&&E(Ta,{color:e.color,label:e.value,diameter:17},t))})}const Aa={right:20,left:20},Ea=["income","profit","expenses","loss"],Ia=e=>Ea.findIndex(t=>t===e.dataKey),Sa={paddingBottom:"20px",marginLeft:"-20px"},Na={stackId:"stack",isAnimationActive:!1},Pa=Wt(Ot["profit-loss-graph"],St({"& .recharts-surface":{outline:"none"}})),Da=fa.var("colors.money"),Ra=fa.var("colors.border.layout"),Ma=fa.var("colors.border.layout.strong"),Oa={fill:fa.var("colors.typography.base"),fontSize:fa.var("fontSizes.metric.sm")},La={profit:fa.var("colors.money.positive"),income:fa.var("colors.money.positive.weak"),loss:fa.var("colors.money.negative"),expenses:fa.var("colors.money.negative.weak")},Fa=[0,100],Ba=["auto","auto"];function Ua({data:e}){const[t,n]=f(!0);if(void 0===e)return null;const r=e.hasAnyData?Ba:Fa;return E(F,{width:"100%",height:"100%",...Pa,children:S(B,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:Aa,children:[E(U,{verticalAlign:"top",itemSorter:Ia,wrapperStyle:Sa,content:({payload:e})=>E(wa,{payload:e})}),E(V,{strokeDasharray:"0",vertical:!1,stroke:Ra}),E(W,{dataKey:"month",interval:0,tickLine:!1,stroke:Ra,tick:Oa}),E(H,{type:"number",tickCount:7,domain:r,axisLine:!1,tickLine:!1,stroke:Ra,tick:Oa,tickFormatter:e=>la(e)}),E(q,{content:({active:e,payload:t})=>E(va,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),E(j,{name:"Profit",dataKey:"profit",fill:La.profit,...Na}),E(j,{name:"Income",dataKey:"income",fill:La.income,...Na}),E(j,{name:"Loss",dataKey:"loss",fill:La.loss,...Na}),E(j,{name:"Expenses",dataKey:"expenses",fill:La.expenses,...Na}),E(j,{dataKey:Br,fill:Ra,legendType:"none",...Na}),E(z,{y:0,stroke:Ma}),E(K,{dataKey:"netIncome",fill:Da,stroke:Da,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>n(!0),onAnimationEnd:()=>n(!1)})]})})}const Va=St({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 Wa({styles:e}){const t=Pt(Va,e);return E("div",{className:t,"data-testid":"shimmer-block"})}const Ha=St({width:"40%",minHeight:65});function qa({children:e}){return S(I,{children:[E(Wa,{styles:Ha}),E(na,{children:e})]})}const ja=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),za=St({width:"80px",height:"17px",marginBottom:"10px"}),Ka=St({width:"100%",height:"100%"});function Ya(){return S(I,{children:[S("div",{...ja,children:[E(Wa,{styles:za}),E(Wa,{styles:za}),E(Wa,{styles:za}),E(Wa,{styles:za})]}),E(Wa,{styles:Ka})]})}const _a=Rt({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 Ga({size:e}){const t=_a({size:e});return E("div",{className:t,children:"Sample"})}const Qa=20200,Za=5043,Xa=Object.freeze({income:Qa,expenses:Za,netIncome:15157,absoluteSum:Math.abs(Qa)+Math.abs(Za)}),Ja=Object.freeze({total:Za,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),$a=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),eo=[{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 to({filter:e=Jt.PAST_YEAR,isSample:t=!1}){const{query:{data:n},isFilling:r}=function({filter:e,grouping:t}){return Fr({filter:e,grouping:t,select:Vr})}({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=vn(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=eo[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 S(Kr,{type:"chart",children:[E(Hr,{title:"Profit + Loss"}),E(jr,{children:r?E(qa,{children:E(Ya,{})}):S(I,{children:[E(ea,{title:la(a?.total??0),label:"Profit"}),E(na,{children:E(Ua,{data:a})})]})}),t&&E(Ga,{size:"xl"})]})}const no=Wt(null,St({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}));function ro({children:e}){return E("div",{...no,children:e})}const ao="conversations-section",oo="transactions-section",io={MESSAGE_REVIEW:ao,TRANSACTION_REVIEW:oo,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},lo={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},so={resolutionStatus:{in:["OPEN"]}},co=[],uo=[];function ho(e){return Nr(`${t=e,Dr[t]}`,"v6");var t}const po={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"},go=e=>["tasks",e??{}],mo={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},vo=async e=>{const t=e.queryKey,n=t[1],r={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...n},endpointManager:ho(t[2].environment)},a=await Ir(r);return"SUCCESS"===a.result&&void 0!==a.data?{data:a.data}:{data:void 0}},bo=Rt({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 fo(e,t){const n=({size:t=24,fill:n="transparent",stylists:r})=>{const a=Kt([Wt(null,bo()),...r]);return E(e,{...a,style:{minHeight:t,minWidth:t},width:t,height:t,fill:n})};return n.displayName=t,n}const yo=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),ko=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"currentColor",strokeMiterlimit:10})),"ArrowRight"),xo=St({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"}}),To=St({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),Co=St({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});St({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}});const wo=St({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}}),Ao=m({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function Eo({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["small-icon"]),...t??[]],size:12})}const Io=Wt(null,St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{sm:"35px",base:"50px"},gap:{sm:0,base:20}})),So=Wt(null,St({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{sm:"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"}}),To),No=Wt(null,St({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center"})),Po=Wt(null,St({height:{sm:"12px",base:"20px"},width:{sm:"12px",base:"20px"}}));function Do(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:n,pageBackwards:r}=function(){const e=v(Ao);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return S("div",{...Io,children:[E("div",{...No,children:E("button",{...So,onClick:r,disabled:!t,children:E(Eo,{Component:yo,stylists:[Po]})})}),E("div",{...No,children:E("button",{...So,onClick:n,disabled:!e,children:E(Eo,{Component:ko,stylists:[Po]})})})]})}const Ro=St({width:"100%",height:"50px"});function Mo(){return E(Wa,{styles:Ro})}const Oo=Wt(Ot["dashboard-placeholder-table"],St({display:"flex",flexDirection:"column",gap:"4px"})),Lo=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Fo=St({width:"100px",height:"20px"});function Bo({numColumns:e=6}){return S("div",{...Oo,children:[E("div",{...Lo,children:Array.from({length:e},(e,t)=>E(Wa,{styles:Fo},t))}),E(Mo,{}),E(Mo,{}),E(Mo,{}),E(Mo,{}),E(Mo,{}),E(Mo,{})]})}function Uo(e,t){const n=In(),r=Rn();return y(a=>{const o=An(n),i=o?{}:{retry:!1,staleTime:1/0};return Pn.prefetchQuery({queryKey:yn(e(a),n??"",r),queryFn:o?t:Sn,...i})},[e,t,n,r])}const Vo=Object.freeze({}),Wo=Object.freeze({cursor:"FINAL_PAGE"});function Ho({queryKey:e,queryFn:t,...n}){const[r,a]=f(Vo),o=p(e);i(o.current,e)||(o.current=e,a(Vo));const l=n.select,s=Tn(l)?e=>({...l(e),cursor:e.cursor}):void 0,c=kn(e,r),d=Mn({...n,queryKey:c,queryFn:t,keepPreviousDataPlaceholder:!0,select:s}),u=g(()=>{return e=d.query.data?.cursor,t=a,{getFirstPage:()=>t(Vo),getLastPage:()=>t(Wo),hasNextPage:Tn(e?.after),hasPreviousPage:Tn(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[d.query.data?.cursor]),h=Uo(y(t=>kn(e,t),[e]),t),m=Uo(y(t=>kn(e,t),[e]),t);return k(()=>{const e=d.query.data?.cursor;!d.query.isFetching&&e&&(e.after&&h({cursor:e.after}).catch(e=>{br({error:e,severity:"error"})}),e.before&&m({cursor:e.before}).catch(e=>{br({error:e,severity:"error"})}))},[d.query.data?.cursor,d.query.isFetching,h,m]),{...d,paginationControls:u}}async function qo({authorization:e,extraHeaders:t,includeCredentials:n,params:r,url:a,cache:o}){const i=xr({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=>kr(e,t)).join("&"):kr(e,t),n}).join("&");var a;return""!==r&&(n+=`?${r}`),n})({url:a,params:r});vr("HTTP GET Request",{url:a,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:o});return vr("HTTP GET Response",{url:a,status:e.status,statusText:e.statusText}),Tr(e)}catch(s){return Promise.reject(s)}}async function jo(e){const{url:t,headers:n}=wr(e);return qo({url:t,params:e.params,includeCredentials:!0,extraHeaders:n})}async function zo(e){return jo({...e,endpointManager:ho(e.environment)})}async function Ko(e){return jo({...e,endpointManager:Mr(e.environment)})}function Yo({delay:e,callback:t}){const n=g(()=>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 k(()=>()=>{n.cancelCallback()},[n]),{startCallback:y(e=>{n.startCallback(e)},[n]),cancelCallback:y(()=>{n.cancelCallback()},[n])}}function _o({prefetchFn:e}){const{startCallback:t,cancelCallback:n}=Yo({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:n}}const Go={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"},Qo={ASC:"ASC",DESC:"DESC"},Zo=e=>["conversations",e??{}],Xo=e=>["conversations","conversation",e],Jo=async e=>{const t=e.queryKey,n={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function $o(e){return Ho({queryKey:e?Zo(e):["conversations",{}],queryFn:Jo})}const ei=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 zo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null};function ti(e){const t=Tn(e);return Mn({queryKey:Xo({id:e??""}),queryFn:ei,enabled:t})}const ni=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:ho(n)};return await Ir(r)};function ri(){return _o({prefetchFn:Uo(Xo,ei)})}function ai(e){const t=e.getSize(),n=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==n?`${n}px`:"auto"}}function oi({header:e}){const t=ai(e.column);return E("div",{...Wt(Ot["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:Y(e.column.columnDef.header,e.getContext())})}const ii=Wt(Ot["dashboard-table-header"],St({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function li({headerGroups:e}){return E("div",{children:e.map(e=>x("div",{...ii,key:e.id},e.headers.map(e=>E(oi,{header:e},e.id))))})}const si=Wt(Ot["dashboard-table-body"],St({display:"flex",flexDirection:"column"}));function ci({children:e}){return E("div",{...si,children:e})}const di=Rt({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 ui({alignment:e="vertical",color:t="normal",additionalClassName:n}){const r=Wt("vertical"===e?Ot["vertical-divider"]:Ot["horizontal-divider"],n,di({alignment:e,color:t}));return E("div",{...r})}function hi(){return E(ui,{additionalClassName:Ot["table-cell-divider"]})}function pi({cell:e,index:t,onCellClick:n,shouldDisplayDivider:r}){const a=ai(e.column),o=Wt(Ot["dashboard-table-cell"],St({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Wt(null,St({display:"flex",flexDirection:"row",height:"100%"})),l=r(t);return S("div",{...i,style:a,onClick:()=>{n&&n(e)},children:[l&&E(hi,{}),E("div",{style:a,...o,children:Y(e.column.columnDef.cell,e.getContext())})]})}const gi=Wt(Ot["table-sub-row"],St({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function mi({rowData:e,onCellClick:t,shouldDisplayDivider:n}){const r=e.getVisibleCells();return E("div",{...gi,children:r.map((e,r)=>E(pi,{cell:e,index:r,onCellClick:t,shouldDisplayDivider:n,isChild:!0},e.id))})}const vi=St({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),bi=St({background:"surface.background"}),fi=Wt(Ot["table-row"],St({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{sm:"60px",base:"85px"},minWidth:"fit-content"}));function yi({rowData:e,onMouseEnter:t,onMouseLeave:n,onCellClick:r,shouldDisplayDivider:a}){const o=e.getIsExpanded(),i=Wt(Ot["table-parent-row"],vi,e.index%2==0?bi:void 0),l=e.getVisibleCells();return S("div",{...i,onMouseEnter:t,onMouseLeave:n,children:[E("div",{...fi,children:l.map((e,t)=>E(pi,{cell:e,index:t,onCellClick:r,shouldDisplayDivider:a},e.id))}),o&&E("div",{children:e.subRows.map(e=>E(mi,{rowData:e,onCellClick:r,shouldDisplayDivider:a},e.id))})]})}const ki=(e,t={})=>{He.getState().openDrawer(e,t)},xi=()=>{He.getState().requestCloseDrawer()};function Ti({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=yn(e,n,r);return Pn.fetchQuery({queryKey:a,queryFn:t})}function Ci({queryKey:e,queryFn:t,accessToken:n,environment:r}){if(!n)return Promise.reject(new Error("Access token is required to fetch entity"));const a=yn(e,n,r);return Pn.prefetchQuery({queryKey:a,queryFn:t})}const wi=[{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"}],Ai={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},Ei={ASC:"ASC",DESC:"DESC"},Ii=e=>["banks/transactions",e??{}],Si=e=>["banks/transactions",e.id],Ni=async e=>{const t=e.queryKey,n={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Pi(e){return Ho({queryKey:Ii(e),queryFn:Ni})}const Di=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 zo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function Ri({id:e}){return Mn({queryKey:Si({id:e}),queryFn:Di})}function Mi(){return _o({prefetchFn:Uo(Si,Di)})}const Oi={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 Li(e,t){return!wn(e)&&e.startsWith(t)}function Fi({id:e,prefix:t}){return void 0!==e?`${Oi[t]}_${e}`:""}function Bi(e){let t=e;return"string"==typeof e&&e.includes("_")&&(t=e.split("_")[1]),Number(t)}const Ui=e=>["conversations/messages",e];function Vi(e){if(xn(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 Wi=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 zo(r);return"SUCCESS"===a.result&&void 0!==a.data?a.data:null},Hi=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:ho(n),accessToken:t};return await Ir(r)};function qi(){return _o({prefetchFn:Uo(Ui,Wi)})}const ji=e=>["summaries",e??{}],zi=e=>["summaries",e.id],Ki=async e=>{const t=e.queryKey,n={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:ho(t[2].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data}:{data:void 0}};const Yi=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 zo(n);return"SUCCESS"===r.result&&void 0!==r.data?r.data:null};function _i({rowData:e,isMobile:t}){const{startPrefetch:n,cancelPrefetch:r}=ri(),{startPrefetch:a,cancelPrefetch:o}=qi(),{startPrefetch:i,cancelPrefetch:l}=Mi(),{startPrefetch:s,cancelPrefetch:c}=_o({prefetchFn:Uo(zi,Yi)}),d=y(()=>{Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.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(()=>{Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.BANK_TRANSACTION)?l():Tn(e.original.attachedEntityId)&&Li(e.original.attachedEntityId,Oi.FINANCIAL_SUMMARY)&&c(),o(),r()},[l,c,r,o,e.original.attachedEntityId]);return E(yi,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,n)=>{n?ki("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):Tn(t)?Li(t,Oi.BANK_TRANSACTION)?ki("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Li(t,Oi.FINANCIAL_SUMMARY)&&(r=e,a=t,ki("FinancialSummary",{routeProps:{conversationId:r,summaryId:a}})):function(e){ki("Conversation",{routeProps:{conversationId:e}})}(e);var r,a})(e.original.id,e.original.attachedEntityId,t)})}const Gi=fo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),h.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),Qi=St({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}}),Zi=St({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"}}),Xi=St({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),Ji=St({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),$i=St.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"}}),el=Rt({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%"}}}}),tl={default:Xi,small:Ji},nl=e=>{const t=tl[e];return Wt(Ot["button-base"],t,Qi,xo)},rl=["default","small"],al={default:{className:""},small:{className:""}};for(const jE of rl)al[jE]=nl(jE);const ol=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=Kt([al[o],Wt(null,el({width:i})),...t]);return E("button",{ref:u,...h,type:n,onClick:r,disabled:a,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),il=Wt(Ot["button-primary"],Zi),ll=T(function({children:e,active:t,stylists:n=[],width:r,...a},o){return E(ol,{ref:o,stylists:[il,...n],active:t,width:r,...a,children:e})}),sl=()=>{ki("Conversation",{routeProps:{conversationId:null}})};function cl(){return E(ll,{onClick:sl,children:E(Eo,{Component:Gi})})}const dl=Rt({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"10px",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg"}}}});function ul({children:e,dashboard:t}){const n=Wt(Ot["dashboard-table"],dl({dashboard:t}));return E("div",{...n,children:e})}const hl=m(null),pl="mobile",gl=Rt({base:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",maxWidth:"100%"},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:_r,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function ml({children:e,intent:t="default",wrap:n="ellipsis",alignment:r="left"}){const a=Wt(Ot.label,gl({intent:t,wrap:n,alignment:r}));return wn(e)?null:E("div",{title:"ellipsis"===n?e:void 0,...a,children:e})}const vl=Wt(Ot["emphasis-label"],St({lineHeight:"16px"}));function bl({children:e}){return E(da,{size:"med",weight:"lg",stylists:[vl],children:e})}function fl({text:e,isRead:t}){return E(t?ml:bl,{children:e})}const yl=Rt({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"}}},defaultVariants:{alignVariant:"flexStart"}});function kl({children:e,alignVariant:t="flexStart"}){const n=Wt(null,yl({alignVariant:t}));return E("div",{...n,children:e})}function xl({date:e,isRead:t=!1}){const n=bn(e);return E(fl,{text:n,isRead:t})}const Tl=Wt(Ot["strong-sub-label"],Yt({label:"strongSubLabel"}));function Cl({children:e,stylists:t=[]}){return wn(e)?null:E(da,{size:"sm",weight:"med",stylists:[Tl,...t],children:e})}const wl=m(null),Al=St({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),El=St({display:"flex",alignItems:"center",gap:"9px",cursor:"pointer",borderRadius:"zero",width:"100%",padding:{sm:"10px",base:"16px"},border:{sm:"{borderWidths.md} solid {colors.border.layout}",base:"{borderWidths.sm} solid {colors.border.layout}"},backgroundColor:{sm:"surface.intent.action.discrete",base:"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"}}),Il=Wt(Ot["selector-row"],El);function Sl(e,t,n){const[r,a]=f(e);return[t??r,n??a]}function Nl({children:e}){return null===se()?E(ce,{children:e}):e}function Pl({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]=Sl(e,a,o),p=X(),m=J({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:re,middleware:[$(n),ee({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),te({padding:8}),ne({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=m.context,b=ae(v,{enabled:i}),y=oe(v,{bubbles:{escapeKey:!0}}),k=ie(v),x=le([b,y,k]);return g(()=>({open:u,setOpen:h,...x,...m,modal:r,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:p}),[u,h,x,m,r,l,c,p])}({modal:t,initialOpen:n,placement:r,offsetPx:a,open:o,onOpenChange:i,enableClickMiddleware:s}),d=se(),u=l&&null===d,h=c.nodeId;return E(Nl,{children:E(de,{id:h,children:E(wl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:u},children:e})})})}function Dl(){const e=v(wl);if(null==e)throw new Error("Popup components must be wrapped in <PopupManager />");return e}function Rl({children:e}){const t=Dl(),n=t.refs.setReference,r=t.open?"open":"closed",a={...t.getReferenceProps(),ref:n,"data-state":r};return E(I,{children:e(a)})}const Ml=fo(e=>h.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),h.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function Ol({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["tiny-icon"]),...t??[]],size:9})}const Ll=fo(e=>h.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),h.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),h.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),Fl=Wt(null,St({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"}}),xo),Bl=Wt(null,St({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),Ul=Wt(null,St({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"}})),Vl=Wt(null,St({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function Wl({onClearClick:e,columnName:t,active:n,popupTriggerProps:r}){const a=n||"open"===r?.["data-state"];return S("div",{...Fl,"data-active":a,children:[S("button",{...Bl,...r,children:[E(Cl,{children:t}),!a&&E("div",{...Vl,children:E(Ol,{Component:Ll})})]}),a&&E("button",{...Ul,onClick:e,children:E(Ol,{Component:Ml})})]})}const Hl=Rt({base:{border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function ql({initialFocus:e=!0,style:t,ref:n,type:r,...a}){const{context:o,blockInteraction:i,...l}=Dl(),s=ue([l.refs.setFloating,n]),c=Wt(Ot.popup,Hl({type:r}));return o.open?S(I,{children:[i&&E(he,{lockScroll:!0}),E(pe,{children:E(ge,{context:o,modal:l.modal,initialFocus:e?void 0:-1,children:E("div",{ref:s,...c,style:{...l.floatingStyles,...t},...l.getFloatingProps(a),"aria-labelledby":l.labelId,"aria-describedby":l.descriptionId,children:a.children})})})]}):null}const jl=Wt(Ot["popup-sort-row"],St({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 zl({onClick:e,children:t,active:n}){return E("button",{onClick:e,...jl,children:E(ga,{accent:n?"active":"action",children:t})})}const Kl=Wt(null,St({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),Yl=Wt(null,St({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function _l({sortDef:e,sortAscDisplay:t,sortDescDisplay:n,handleSortClick:r,sortInstance:a}){const o=Dl(),i=e=>{r(e),o?.setOpen(!1)},l=a?.orderBy===e&&"ASC"===a?.direction,s=a?.orderBy===e&&"DESC"===a?.direction;return S("div",{...Kl,children:[E(Cl,{stylists:[Yl],children:"Sort by:"}),E(zl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),E(zl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:n})]})}const Gl=St($i,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}}),Ql=Wt(Ot["button-discrete-small"],Gl,xo);function Zl({children:e,active:t,disabled:n,onClick:r,popupTriggerProps:a,ariaLabel:o,ariaExpanded:i}){const[l,s]=f(!1),c=t??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(a?.["data-state"]);return E("button",{type:"button",...Ql,onClick:e=>{void 0===c&&s(!l),r&&r(e)},"data-active":c??l,disabled:n,...a,"aria-label":o,"aria-expanded":i,children:e})}const Xl={minWidth:"140px"};function Jl({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){const a=v(hl);if(!a)return null;const{sortInstance:o,setSortInstance:i}=a,l=o?.orderBy===t,s=()=>{i(void 0)};return t&&n&&r?S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(Wl,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),E(ql,{style:Xl,children:E(_l,{sortDef:t,sortAscDisplay:n,sortDescDisplay:r,handleSortClick:e=>{i(e)},sortInstance:o})})]}):E(Zl,{disabled:!0,children:E(Cl,{children:e})})}const $l=Wt(null,St({paddingLeft:"19px"}));function es({columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r}){return E("div",{...$l,children:E(Jl,{columnName:e,sortDef:t,sortAscDisplay:n,sortDescDisplay:r})})}const ts="Oldest to Newest",ns="Newest to Oldest";const rs=m({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});function as({authorUserId:e,isRead:t}){const{userRole:n,userId:r}=v(rs);let a="";return e===r?a="Me":"OWNER"===n?a="Bookkeeper":"ACCOUNTANT"===n&&(a="User"),E(fl,{text:a,isRead:t})}const os=Wt(Ot.text,St({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),Yr);function is({children:e,stylists:t=[]}){const n=Kt([os,...t]);return E("div",{...n,children:e})}const ls=Wt(Ot["emphasis-sub-label"],Yt({label:"emphasisSubLabel"}));function ss({children:e}){return wn(e)?null:E(da,{size:"sm",weight:"lg",stylists:[ls],children:e})}const cs=St({display:"grid",gridTemplateColumns:"3fr 1fr",border:"none",borderRadius:0,padding:"10px",width:"100%",cursor:"pointer",backgroundColor:"transparent",alignItems:"start"}),ds=Pt(St({display:"flex",flexDirection:"column",alignItems:"start",gap:"2px",maxWidth:"100%"}),Yr),us=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end",gap:"2px"});function hs({sender:e,subject:t,date:n,message:r,isRead:a,handleFormOpen:o}){return S("button",{className:cs,onTouchEnd:o,children:[S("div",{className:ds,children:[E(as,{authorUserId:e,isRead:a}),E(a?ga:ss,{children:t}),E(ga,{children:r})]}),S("div",{className:us,children:[E(xl,{date:n,isRead:a}),a?E(Eo,{Component:ko}):E(is,{children:E(Eo,{Component:ko})})]})]})}const ps=_(),gs=Wt(null,St({paddingLeft:"25px"})),ms=[ps.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>E(kl,{children:E(as,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>E(Cl,{stylists:[gs],children:"From"}),size:150,maxSize:150}),ps.accessor("subject",{id:"subject",cell:({row:e})=>E(kl,{children:E(fl,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>E(Cl,{stylists:[gs],children:"Subject"}),size:150}),ps.accessor("latestMessage.text",{id:"message",cell:({row:e})=>E(kl,{children:E(fl,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>E(Cl,{stylists:[gs],children:"Message"}),size:200}),ps.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>E(kl,{children:E(xl,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>E(es,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:ns,sortAscDisplay:ts}),size:130,maxSize:130}),ps.display({id:pl,cell:({row:e})=>E(hs,{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 vs(e){return e?ms.filter(e=>e.id===pl):ms.filter(e=>e.id!==pl)}const bs=[],fs=St({display:"flex",flexDirection:"column",height:"250px",width:"100%",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),ys=Wt(Ot["empty-dashboard-layout"],fs);function ks({children:e}){return E("div",{...ys,"data-testid":"empty-dashboard-layout",children:e})}function xs({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["large-icon"]),...t??[]],size:25})}const Ts=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),Cs=()=>{ki("Conversation",{routeProps:{conversationId:null}})};function ws(){return S(I,{children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",children:"Need help with your financials?"}),E(ll,{onClick:Cs,children:E(ha,{children:"Talk to a bookkeeper"})})]})}function As(){return S(I,{children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",children:"All caught up"}),E(ga,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Es=Wt(null,St({display:"flex",flexDirection:"row",gap:"5px"}));function Is({children:e}){return E("div",{...Es,children:e})}const Ss=Rt({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function Ns(e){return E(e?As:ws,{})}function Ps({sortInstance:e,setSortInstance:t,conversations:n,paginationControls:r,isFilling:a,isMobile:o}){const i=function({conversations:e,isMobile:t}){return G({data:e??bs,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??bs.length,columns:vs(t),getCoreRowModel:Q(),getRowId:e=>e.id})}({conversations:n,isMobile:o}),{query:{data:l},isFilling:s}=$o({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!xn(l?.data?.[0])&&!s;return S("div",{className:Ss({isMobile:o}),children:[E("div",{id:ao}),S(Ao.Provider,{value:r,children:[S(qt,{children:[E(Gt,{children:"Conversations"}),S(Is,{children:[E(Do,{}),E(cl,{})]})]}),E(ul,{dashboard:"businessOwnerDashboard",children:a?E(Bo,{numColumns:4}):S(I,{children:[!o&&E(hl.Provider,{value:{sortInstance:e,setSortInstance:t},children:E(li,{headerGroups:i.getHeaderGroups()})}),n.length>0?E(ci,{children:i.getRowModel().rows.map(e=>E(_i,{rowData:e,isMobile:o},e.id))}):E(ks,{children:Ns(c)})]})})]})]})}const Ds=Wt(Ot.body,Yt({body:"default"}));function Rs({children:e,stylists:t=[]}){if(wn(e))return null;const n=Kt([Ds,...t]);return E("div",{...n,children:e})}const Ms=Wt(null,St({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),Os=Rt({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),Ls=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function Fs(){return E("div",{...Ms,children:Ls.map((e,t)=>E(Wa,{styles:Os({width:e?.width})},t))})}const Bs=fo(e=>h.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),h.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),Us=St({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}"}),Vs=St({position:"relative",width:"25px",height:"25px"});function Ws({hasUnread:e}){return S("div",{className:Vs,children:[E(xs,{Component:Bs}),e&&E("div",{"data-testid":"unread-comment-badge",className:Us,"aria-hidden":"true"})]})}const Hs=St({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout.strong}",boxSizing:"border-box"});function qs({hasUnreadMessages:e=!1,showMessageIndicator:t}){return S("div",{className:Hs,children:[E(ha,{children:"Message Bookkeeper"}),t&&E(Ws,{hasUnread:e})]})}const js=St({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function zs(){return S("div",{className:js,children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),E(ga,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),E(ll,{onClick:()=>ki("Conversation"),children:E(ha,{children:"Talk to a bookkeeper"})})]})}const Ks=St({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ys({summaryId:e,conversationId:t}){const{startPrefetch:n,cancelPrefetch:r}=ri(),{startPrefetch:a,cancelPrefetch:o}=qi(),i=y(()=>{a({id:t}),n({id:t})},[t,a,n]),l=y(()=>{o(),r()},[o,r]);return S("div",{className:Ks,children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),E(ga,{wrap:"wrap",children:"Pick up where you left off."}),E(ll,{onClick:()=>ki("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:E(ha,{children:"Continue conversation"})})]})}const _s=St({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Gs({summaryId:e}){return S("div",{className:_s,children:[E(xs,{Component:Ts}),E(ha,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),E(ga,{wrap:"wrap",children:"Your bookkeeper will respond here."}),E(ll,{onClick:()=>ki("FinancialSummary",{routeProps:{summaryId:e}}),children:E(ha,{children:"Talk to a bookkeeper"})})]})}function Qs({summaryId:e,conversationId:t}){const n=Tn(t);return xn(e)?E(zs,{}):n?E(Ys,{conversationId:t,summaryId:e}):E(Gs,{summaryId:e})}const Zs=St({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.strong}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),Xs=St({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 Js({summaryData:e}){const t=Tn(e?.summary),n=Tn(e?.conversation);return S("div",{className:Zs,children:[E(qs,{showMessageIndicator:t&&n,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),E("div",{className:Xs,children:E(Qs,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const $s=St({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),ec=Rt({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.strong}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),tc=Wt(null,St({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),nc=St({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function rc({isSample:e,period:t}){const{query:{data:n},isFilling:r}=function(e){return n={select:e=>e?.data?.[0]},Mn({queryKey:(t={limit:1,filter:{date:{equal:Xt(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?ji(t):["summaries",{}],queryFn:Ki,...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 $${Qa.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${Za.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.";return S("div",{className:nc,children:[E("div",{"data-testid":"financial-summary-layout",className:ec({isSample:e}),children:!e&&r?E(Fs,{}):S("div",{className:$s,children:[E(Rs,{stylists:[tc],children:a}),e&&E(Ga,{size:"lg"})]})}),E(Js,{summaryData:n})]})}const ac={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},oc={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."}},ic={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.RELINK},INVALID_MFA:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.invalidUpdatedUsername,buttonType:ac.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:oc.short.accountLocked,longMessage:oc.long.accountLocked,buttonType:ac.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:oc.short.credentialsChanged,longMessage:oc.long.relinkCredentials,buttonType:ac.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:oc.short.supportChanged,longMessage:oc.long.supportChanged,buttonType:ac.CHAT},USER_SETUP_REQUIRED:{shortMessage:oc.short.updateNeeded,longMessage:oc.long.updateNeeded,buttonType:ac.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:oc.short.supportChanged,longMessage:oc.long.mfaUpdateNeeded,buttonType:ac.OPEN_BANK},NO_ACCOUNTS:{shortMessage:oc.short.noAccountsAvailable,longMessage:oc.long.noAccountsUnlink,buttonType:ac.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:oc.short.noAccountsAvailable,longMessage:oc.long.noAccountsUnlink,buttonType:ac.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:oc.short.connectionError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},ITEM_NOT_FOUND:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},PRODUCT_NOT_READY:{shortMessage:oc.short.serverError,longMessage:oc.long.productNotReady,buttonType:ac.CHAT},USER_PERMISSION_REVOKED:{shortMessage:oc.short.connectionError,longMessage:oc.long.permissionRevoked,buttonType:ac.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:oc.short.temporarilyDown,longMessage:oc.long.bankMaintenance,buttonType:ac.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:oc.short.serverDown,longMessage:oc.long.serverDown,buttonType:ac.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:oc.short.temporarilyDown,longMessage:oc.long.bankMaintenance,buttonType:ac.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:oc.short.supportChanged,longMessage:oc.long.supportChanged,buttonType:ac.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:oc.short.connectionError,longMessage:oc.long.connectionError,buttonType:ac.CHAT},PLANNED_MAINTENANCE:{shortMessage:oc.short.temporarilyDown,longMessage:oc.long.bankConnectionMaintenance,buttonType:ac.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:oc.short.requestError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:oc.short.inputError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:oc.short.volumeDown,longMessage:oc.long.bankMaintenance,buttonType:ac.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:oc.short.serverError,longMessage:oc.long.connectionError,buttonType:ac.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:oc.short.updateNeeded,longMessage:oc.long.partnerCredsChange,buttonType:ac.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:oc.short.credentialsExpiring,longMessage:oc.long.credentialsExpiring,buttonType:ac.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:oc.short.relinkNeeded,longMessage:oc.long.relinkForStatements,buttonType:ac.RELINK}},DEFAULT:{DEFAULT:{shortMessage:oc.short.connectionError,longMessage:oc.long.connectionError,buttonType:ac.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:oc.short.generic,longMessage:oc.long.generic,buttonType:ac.CHAT}}};function lc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return br({error:new Error("No bank error provided. Should not get here"),severity:"error"}),ic.DEFAULT.DEFAULT;const n=ic[e];if(!n)return br({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),ic.DEFAULT.DEFAULT;return(n[t]??n.DEFAULT)||(br({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),ic.DEFAULT.DEFAULT)}const sc={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 cc(e,t=!0){const n=lc({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 dc=Wt(null,St({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),uc=Wt(Ot["month-picker-left-button"],St({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),hc=Wt(Ot["month-picker-right-button"],St({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),pc=Wt(null,St({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function gc({period:e,setPeriod:t,disableNext:n=!1,disablePrev:r=!1}){const a=Zt(e.year,e.month,1),o=vn(a,{abbreviateMonth:!0});return S("div",{...dc,children:[E(ll,{stylists:[uc],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:E(Eo,{Component:yo})}),E("div",{...pc,children:E(ha,{children:o})}),E(ll,{stylists:[hc],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:E(Eo,{Component:ko})})]})}const mc=St({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function vc({children:e}){return E("div",{className:mc,children:e})}const bc=Wt(Ot["progress-bar"],St({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),fc=Wt(Ot["progress-bar-fill"],St({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),yc=Wt(Ot["tile-bar-label"],St({paddingLeft:"10px"}));function kc({label:e="",percentage:t,color:n,width:r}){const a=void 0===r?"100%":`${r}px`,o=t>=50,i=Kt([fc,Wt(null,n)]);return S("div",{...bc,style:{width:a},children:[E("div",{...i,style:{width:`${t}%`},children:o&&E("div",{...yc,children:E(ml,{children:e})})}),!o&&E("div",{...yc,children:E(ml,{children:e})})]})}const xc=Wt(Ot["metric-md"],Yt({metric:"md"}));function Tc(e){return E("div",{...xc,children:e.children})}const Cc=Wt(null,St({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),wc=Wt(null,St({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),Ac=({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 S("div",{...Cc,children:[E(kc,{label:e,percentage:a,color:r}),E("div",{...wc,children:E(Tc,{children:la(t)})})]})},Ec={netIncome:0,income:0,expenses:0,absoluteSum:0},Ic=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return Ec;const t=e.json?.data?.[0];if(xn(t))return Ec;const n=t.income?.total??0,r=t.expenses?.total??0,a=L(n).plus(r).toNumber();return{netIncome:t.netIncome??0,income:n,expenses:r,absoluteSum:a}},Sc=fo(e=>h.createElement("svg",{stroke:"#000000",width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),h.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),h.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}),h.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 Nc({Component:e,stylists:t}){return E(e,{stylists:[Wt(Ot["medium-icon"]),...t??[]],size:15})}const Pc={},Dc=e=>{const t=document.querySelector(`script[src="${e}"]`);if(t)return Pc[e]={loading:!1,error:null,scriptEl:t}},Rc="undefined"!=typeof window&&void 0!==window.document;function Mc({src:e,checkForExisting:t=!1,...n}){let r=Pc[e];!r&&t&&e&&Rc&&(r=Dc(e));const[a,o]=f(r?r.loading:Boolean(e)),[i,l]=f(r?r.error:null),[s,c]=f(!1);return k(()=>{if(!Rc||!e||s||i)return;let a;r=Pc[e],!r&&t&&(r=Dc(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=Pc[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 Pc[e])}},[e]),[a,i]}const Oc=e=>["integrations",e??{}],Lc=async e=>{const t=e.queryKey,n={path:"/v6/integrations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function Fc(e,t){return Ho({...t,queryKey:Oc(e),queryFn:Lc})}function Bc(e){return Fc({filter:{apiName:{equal:"PLAID"}}},e)}function Uc(e){return Nr(`${t=e,Pr[t]}/v1`,"v1");var t}const Vc=[{displayName:"Chase",institutionName:"ins_56"},{displayName:"Bank of America",institutionName:"ins_127989"},{displayName:"Capital One",institutionName:"ins_128026"},{displayName:"Wells Fargo",institutionName:"ins_127991"}];async function Wc({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:Uc(n)},{url:a,headers:o}=wr(r);return await qo({url:a,includeCredentials:!0,extraHeaders:o,params:e?{institutionId:e}:void 0})}const Hc=Wt(Ot["button-danger"],St({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 qc({children:e,stylists:t=[],...n}){return E(ol,{stylists:[Hc,...t],...n,children:e})}const jc=Wt(Ot["button-tertiary"],St({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 zc({children:e,stylists:t=[],...n}){return E(ol,{stylists:[jc,...t],...n,children:e})}const Kc="cancel",Yc="danger",_c="success",Gc=Rt({base:{position:"fixed",inset:0,minHeight:"100dvh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"overlay"}}),Qc=Rt({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"}}),Zc={transform:"none",willChange:"auto"};function Xc({show:e,role:t="dialog",children:n,size:r="sm",padding:a="md",outsidePress:o=!1,escapeKey:i=!0,className:l}){const{context:s}=J({open:e,strategy:"fixed"}),c=oe(s,{outsidePress:o,escapeKey:i}),d=ie(s,{role:t}),{getFloatingProps:u}=le([c,d]),h=[Qc({size:r,padding:a}),l].filter(Boolean).join(" ");return e?E(pe,{children:E(he,{lockScroll:!0,className:Gc(),children:E(ge,{context:s,modal:!0,returnFocus:!0,children:E("div",{...u(),className:h,style:Zc,children:n})})})}):null}const Jc=St({display:"flex",justifyContent:"flex-end",gap:"8px"}),$c="success",ed="danger",td=me.createConfirmation(ve(function({show:e,proceed:t,title:n,body:r,buttons:a=[{key:"ok",type:"default",label:"OK"}]}){return S(Xc,{show:e,role:"alertdialog",size:"sm",padding:"md",outsidePress:!1,escapeKey:!0,className:Ot["alert-dialog"],children:[E(ha,{wrap:"wrap",stylists:[Wt(Ot["alert-header"])],children:n}),r&&"string"==typeof r?E(ml,{wrap:"wrap",children:r}):E(I,{children:r}),E("div",{className:Jc,children:a.map(e=>{const n=(e=>{switch(e){case ed:return qc;case $c:return zc;default:return ll}})(e.type);return E(n,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:E(ha,{children:e.label})},e.key)})})]})}));function nd(e,t,n,r){const a=1===n?e:t;return r?`${n} ${a}`:a}function rd(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function ad(e,t){return t?e?`${e} ${rd(t)}`:rd(t):e??""}const od=e=>ki("Conversation",{routeProps:{conversationId:null,defaultValues:e}}),id=St({display:"flex",flexDirection:"column",gap:"12px"});async function ld(e){await td({title:"Uh Oh!",body:"Something went wrong trying to link your bank, please try again.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Chat",type:$c}]})===_c&&od({message:{text:`Please help me with my bank issue (code: ${e}). Thanks!`,attachments:[]}})}const sd=e=>["banks/accounts",e??{}],cd=async e=>{const t=e.queryKey,n={path:"/v6/banks/accounts/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ho(t[3].environment)},r=await Ir(n);return"SUCCESS"===r.result&&void 0!==r.data?{data:r.data,cursor:r.cursor}:{data:void 0,cursor:void 0}};function dd(e){const t=e?.params;return Ho({queryKey:t?sd(t):["banks/accounts",{}],queryFn:cd,enabled:e?.enabled,select:e?.select})}function ud(e,t){return Ti({queryKey:kn(["banks/accounts",{}],{}),queryFn:cd,accessToken:e,environment:t})}const hd=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{...e,id:e.id??"",status:"DELETED"===e.status?"REMOVED":t,name:e.apiName??"",apiName:"PLAID",glAccountId:Fi({id:e.glAccountId,prefix:"GL_ACCOUNT"}),type:n,lastSyncedDate:e.lastApiSyncedDate??null,syncTransactions:e.syncRevenueBoolean||e.syncExpenseBoolean||!1,integration:{id:Fi({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}},pd=Wt(Ot["button-secondary"],St({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 gd({children:e,stylists:t=[],...n}){return E(ol,{stylists:[pd,...t],...n,children:e})}function md({mutationFn:e,onMutateFn:t,...n}){const r=In(),a=Rn(),o=!wn(r);return M({...n,mutationFn:o?t=>e({data:t,accessToken:r,environment:a}):Sn,onMutate:o&&Tn(t)?e=>t({data:e,accessToken:r,environment:a}):void 0},Pn)}const vd=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:Mr(n)};return await Sr(r)},bd=async({data:e,accessToken:t,environment:n})=>vd({data:e,accessToken:t,environment:n}),fd=async({data:e,accessToken:t,environment:n})=>vd({data:e,accessToken:t,environment:n}),yd=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:Mr(n)};return await Sr(r)})({data:{accounts:e},accessToken:t,environment:n});function kd(e){return md({onSuccess:async()=>{vr("mutation successful, invalidating bank account queries");try{return Pn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&br({error:e,severity:"error"})}},...e})}function xd(){return kd({mutationFn:fd})}function Td(){return md({onSuccess:async()=>{vr("mutation successful, invalidating bank account queries");try{return Pn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&br({error:e,severity:"error"})}},mutationFn:yd})}const Cd=e=>"CSV_IMPORT"===e||"MANUAL_ENTRY"===e,wd=e=>"PLAID"===e,Ad=e=>e>0?"Deposited to":"Withdrawn from",Ed=e=>({id:Bi(e.id),apiAccountName:e.name,apiAccountNo:e.mask,apiAccountType:["DEPOSITORY","CREDIT"].includes(e.type??"")?e.type:void 0,tranStartDate:void 0,duplicateBankAccountIds:[]}),Id=St({display:"flex",flexDirection:"column",gap:"16px"}),Sd=async()=>td({title:"Merge Accounts",body:S("div",{className:Id,children:[E(ml,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),E(ml,{wrap:"wrap",children:"This action can't be undone."}),E(ml,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Continue",type:ed}]}),Nd=()=>td({title:"Merge Failed",body:E(ml,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:Kc,label:"OK"}]}),{formContext:Pd,fieldContext:Dd,useFieldContext:Rd,useFormContext:Md}=be(),Od=fo(e=>h.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{id:"icon/check"},h.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check");function Ld({showIcon:e=!0,textContent:t="Save",disabled:n=!1}){return S(zc,{type:"submit",disabled:n,children:[e&&E(Eo,{Component:Od}),E(ha,{children:t})]})}const Fd=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Bd=[Wt(null,St({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Ud=Wt(null,St({display:"flex",alignItems:"center",gap:"4px"}));function Vd({errorMessage:e}){return S("div",{...Ud,children:[E(Nc,{Component:Fd,stylists:Bd}),E(ga,{intent:"danger",wrap:"wrap",children:e})]})}const Wd=St({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"}}),Hd=St({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),qd=St({display:"flex",justifyContent:"space-between",alignItems:"center"});function jd({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=Wt(i||null,Wd,l,Hd,To),[m,v]=f(!0);return S(I,{children:[S("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:[S("div",{className:qd,children:[void 0!==r&&E(ga,{children:r}),Tn(p)&&E(ga,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),o&&d&&E(Vd,{errorMessage:d})]})}const zd=St({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 Kd({children:e,inputRef:t,popupTriggerProps:n,label:r,onClick:a}){const o=Rd(),i=fe(o.store,e=>e.meta.errors[0]?.message),l=fe(o.store,e=>e.meta.isDefaultValue),s=fe(o.store,e=>e.meta.isTouched);return E(jd,{label:r,inputRef:t,popupTriggerProps:n,isDefaultValue:l,isTouched:s,className:Ot["discrete-form-input"],additionalStyles:zd,errorMessage:i,onClick:a,onBlur:o.handleBlur,children:e})}function Yd(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 _d(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function Gd(e){"Enter"===e.key&&e.currentTarget.blur()}const Qd=Wt(Ot["amount-input"],Yt({body:"default"}),St({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),Zd=Wt(null,St({display:"flex",alignItems:"center",gap:"2px"}));function Xd({value:e,onChange:t,inputRef:n,onClick:r,onBlur:a,autofocus:o=!1}){return S("div",{...Zd,children:[E(Rs,{children:"$"}),E(ke,{...Qd,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:Gd,autoFocus:o})]})}const Jd=St({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),$d=Rt({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function eu({kind:e,label:t,children:n,inputRef:r,disabled:a,popupTriggerProps:o,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Rd(),u=fe(d.store,e=>e.meta.errors[0]?.message),h=fe(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=Tn(c)?c-p:void 0,m=a?Jd:$d({kind:e});return E(jd,{label:t,inputRef:r,popupTriggerProps:o,className:Ot["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:n})}const tu=m(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function nu(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 ru(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 au(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 ou(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 iu(e){const[t,n]=f(()=>/* @__PURE__ */new Map),{listRef:r,focusedState:a,isMousing:o,isScrolling:i}=function(e,t){const n=p(null),[r,a]=f(!0),[o,i]=f(!1),l=v(tu),[s,c]=C(nu,{focusedIndex:null,maxIndex:e});k(()=>{const e=n.current,t=()=>{null==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=p(null);return k(()=>{c({type:"max",max:e})},[e]),k(()=>{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=Dl(),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=g(()=>{let n=[];return null!==t.current&&(n=Array.from(e.keys()).sort(ru)),n},[e,t]),r=g(()=>{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){k(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=ou(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&&au(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.setOpen(!1))};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:m}=Yo({delay:200,callback:({focusedIndex:t,node:n,listElement:r})=>{n&&r&&au(n,r)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return b=a.focusedIndex,k(()=>{const e=A.current;if(null===b||x)return;const{node:t,metadata:n}=ou(b,T,w);return E.lastOpenedIndex!==b&&n?.hasCascading&&(E.closeCurrentCascade(),I({focusedIndex:b,node:t,listElement:e})),()=>S()},[b,x=o,A=r,E=e,S=m,T=d,w=u,I=h]),function(e,t,n,r){k(()=>{const{metadata:a}=ou(e,t,n);null===e||a?.hasCascading||r.closeCurrentCascade()},[r,e,n,t])}(a.focusedIndex,d,u,e),g(()=>({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 b,x,T,w,A,E,I,S}const lu=m(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function su({style:e,children:t}){const n=Wt(Ot["popup-list"],Al,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=iu(r);return E("div",{...n,onScroll:r.onScroll,ref:a.listRef,tabIndex:0,children:E(tu.Provider,{value:a,children:E(lu.Provider,{value:r,children:t})})})}function cu({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=An(e),h=e=>{n?.(e)};return S(I,{children:[d&&E(a,{searchTerm:e,setSearchTerm:t,placeholder:r}),d&&u?E(o,{...l??{},onClick:h,searchTerm:e}):E(i,{...l??{},onClick:h})]})}const du=Pt(Yt({body:"default"}),St({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}}));function uu({searchTerm:e,setSearchTerm:t,placeholder:n}){const r=p(null);return k(()=>{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)}},[]),E("input",{ref:r,type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:du})}function hu({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i,getSearchActiveStyles:l}){const s=Dl(),[c,d]=f(""),u=An(c),h=l?.(u);return E(ql,{children:E(su,{style:h,children:E(cu,{searchTerm:c,setSearchTerm:d,onClick:t=>{e?.(t),s?.setOpen(!1)},placeholder:t,SearchInput:uu,SearchList:n,DefaultList:r,extraProps:a,listLength:o,forceSearchVisible:i})})})}const pu=()=>["expenses/categories"],gu=async e=>{const t=e.queryKey,n={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n);return{...r,data:r.data?(a=r.data,a.map(e=>({...e,id:Fi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?Fi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var a};function mu(e){return Mn({...e,queryKey:["expenses/categories"],queryFn:gu})}function vu(){return mu({select:e=>({...e,data:e.data?yu(e.data):void 0})})}function bu(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 fu(e){if(0===e.length)return[];const t=bu(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function yu(e){if(0===e.length)return[];const t=bu(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function ku({hasCascading:e=!1}={}){const t=p(null),{register:n,unregister:r,map:a,focusedIndex:o,isMousing:i,listRef:l}=v(tu);w(()=>{const a=t.current;if(a)return n(a,{index:0,hasCascading:e}),()=>{r(a)}},[n,r,e]);const s=g(()=>void 0!==a&&null!==t.current?a.get(t.current)?.index??-1:-1,[a]),c=s===o;w(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const d=y(()=>{l?.current?.focus()},[l]),u=g(()=>({onFocus:d,"data-focused":c}),[d,c]);return{itemRef:t,isActive:c,index:s,itemProps:u}}const xu=T(function({onClick:e,index:t,children:n,itemProps:r,popupTriggerProps:a},o){return E("button",{...Il,onClick:e,"data-listitem":!0,"data-index":t,...a,...r,ref:o,children:n})}),Tu=T(function({onClick:e,children:t,popupTriggerProps:n},r){const{index:a,itemProps:o,itemRef:i}=ku(),l=ue([i,r]);return E(xu,{...Il,onClick:e,index:a,...n,itemProps:o,ref:l,children:t})}),Cu=e=>({id:e.id,name:e.name});function wu({text:e}){return E("div",{...Il,children:e?E(ha,{children:e}):E(Wa,{styles:St({width:"100%",height:"16px"})})})}const Au=Wt(Ot["popup-list"],Al),Eu=()=>S("div",{...Au,children:[E(wu,{}),E(wu,{}),E(wu,{}),E(wu,{}),E(wu,{})]}),Iu=Wt(Ot.text,Yt({label:"strongLabel"}),St({maxWidth:"100%"}),Yr);function Su({children:e,stylists:t=[]}){const n=Kt([Iu,...t]);return E("div",{...n,children:e})}const Nu={keys:[{name:"name"}],threshold:.1};function Pu(e,t,n){var r;r=t,n.some(e=>e.child.id===r.id)||n.push({parent:e,child:t})}function Du(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?Pu(a,r,n):o?Pu(r,r,n):i&&function(e,t){e.children&&e.children.forEach(n=>{Pu(e,n,t)})}(r,n)}),n}const Ru=Wt(null,St({whiteSpace:"normal"})),Mu=[Wt(null,St({marginLeft:"6px",marginRight:"6px"}))];function Ou({searchTerm:e,onClick:t}){const{query:{data:n,isFetched:r},isFilling:a}=mu({select:e=>({...e,data:e.data?fu(e.data):void 0})}),o=n?.data,i=!a&&r&&(void 0===o||0===o.length),l=g(()=>new xe(o??[],Nu),[o]),s=g(()=>o?Du(l.search(e),o):[],[o,e,l]);return a?E(Eu,{}):i?E(wu,{text:"No data"}):0===s.length?E(wu,{text:"No results found"}):E(I,{children:s.map(({parent:e,child:n})=>{const r=e.id===n.id;return E(Tu,{onClick:()=>t(Cu(n)),children:E(Su,{stylists:[Ru],children:r?n.name:S(I,{children:[e.name,E(Eo,{Component:ko,stylists:Mu}),n.name]})})},`${e.id}_${n.id}`)})})}const Lu=T(function({index:e,popupTriggerProps:t,children:n,itemProps:r},a){const o=ue([a,t?.ref]);return E(xu,{index:e,ref:o,itemProps:r,popupTriggerProps:t,children:n})});function Fu({triggerChildren:e,popupChildren:t}){const{cascadeIndex:n,setCascadeState:r,focus:a}=v(lu),{itemRef:o,index:i,itemProps:l}=ku({hasCascading:!0}),{isScrolling:s}=v(tu);return S(Pl,{open:n===i,onOpenChange:e=>{s||r(e,i)},placement:"right-start",children:[E(Rl,{children:t=>E(Lu,{itemProps:l,index:i,ref:o,popupTriggerProps:t,children:e})}),E(ql,{initialFocus:a,children:t})]})}const Bu=Wt(null,St({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Uu({icon:e,displayLabel:t}){return S("div",{...Bu,children:[e,E(ha,{wrap:"wrap",children:t}),E(Eo,{Component:ko})]})}function Vu({category:e,handleCategoryChange:t}){return E(su,{children:e.children?.map(e=>E(Tu,{onClick:()=>t(Cu(e)),children:E(ha,{wrap:"wrap",children:e.name})},e.id))})}function Wu({onClick:e}){const{query:{data:t,isFetched:n},isFilling:r}=vu(),a=t?.data,o=!r&&n&&void 0===a;return r?E(Eu,{}):o?E(wu,{text:"No data"}):E(I,{children:a?.map(t=>t.hasChilds?E(Fu,{triggerChildren:E(Uu,{displayLabel:t.name}),popupChildren:E(Vu,{category:t,handleCategoryChange:e})},t.id):E(Tu,{onClick:()=>e(Cu(t)),children:E(ha,{wrap:"wrap",children:t.name})},t?.id))})}const Hu=({onClick:e})=>{const{query:{data:t}}=vu();return E(hu,{onClick:e,placeholder:"Search expense categories...",SearchList:Ou,DefaultList:Wu,listLength:(t?.data??[]).length})},qu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),ju=fo(e=>h.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.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}),h.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),zu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),Ku=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),Yu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),_u=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),Gu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),Qu=fo(e=>h.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function Zu(e){switch(e){case"Advertising":case"Advertising and Marketing":return qu;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return Ku;case"Health & Fitness":case"Sports":case"Sporting Goods":return Yu;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return _u;case"Plane / Train / Bus":case"Airlines":case"Airfare":return Gu;case"Vehicle":case"Taxi":case"Rental Car":case"Rental Cars":case"Car Payment":case"Auto Insurance":case"Other Vehicle Expenses":case"Parking and Tolls":case"Parking & Tolls":case"Transportation (Taxi, Rideshare, Train)":return Qu;case"Meals & Entertainment":case"Meals":case"Business Meals":case"Food & Dining":case"Groceries":case"Restaurants":case"Other Food & Dining":case"Lead Gen - Meals":case"PAX Food & Drink":return zu;default:return ju}}const Xu=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),h.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}),h.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"),Ju=[Wt(null,St({"& path":{stroke:"surface.foreground"}}))];function $u({onClick:e}){return S(gd,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),e()},children:[E(Eo,{stylists:Ju,Component:Xu}),E(ga,{intent:"primary",children:"Add Split"})]})}const eh=m({dimensions:{width:null,height:null}});function th(){const{dimensions:e}=v(eh);return Tn(e.width)&&e.width<parseInt(fa("sizes.breakpoint-sm"))}const nh={transform:"none",willChange:"auto"};function rh({children:e}){return E(ql,{style:nh,children:e})}const ah=Pt(St({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),Yr);function oh({children:e}){return E("div",{className:ah,children:e})}const ih=Wt(Ot["drawer-header"],St({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function lh({hideDivider:e=!1,children:t}){return S(I,{children:[E("div",{...ih,children:t}),!e&&E(ui,{alignment:"horizontal",color:"strong"})]})}const sh=Wt(null,St({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"}}),To),ch=()=>xi();function dh({Icon:e=Ml,handleClose:t=ch}={}){return E("button",{...sh,onClick:t,type:"button",children:E(Nc,{Component:e,...sh})})}const uh=St({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"}),hh=St({display:"flex",padding:"16px 16px 45px 16px",flexDirection:"column",alignItems:"center",gap:"16px",flex:"1 1 0",alignSelf:"stretch",overflowY:"auto",width:"100%"});function ph({children:e,title:t}){const n=Dl();return E(rh,{children:S("div",{className:uh,children:[E(lh,{children:S(oh,{children:[E(dh,{Icon:yo,handleClose:()=>n.setOpen(!1)}),E(ha,{children:t})]})}),E("div",{className:hh,children:e})]})})}const gh=St({display:"flex",alignItems:"center",gap:"9px",flex:"1 0 0"});function mh({text:e,handleClick:t,LeftIcon:n,RightIcon:r,popupTriggerChildrenProps:a}){return E(ll,{onClick:t,stylists:[Il],popupTriggerProps:a,children:S("div",{className:gh,children:[S("div",{className:gh,children:[n&&E(Nc,{Component:n}),E(ha,{children:e})]}),r&&E(Nc,{Component:r})]})})}const vh=St({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function bh({children:e}){return E("div",{className:vh,children:e})}const fh=St({padding:"0",height:{sm:"35px",base:"51px"},cursor:"default",border:0});function yh(){return E(Wa,{styles:Pt(El,fh)})}const kh=St({width:"70px",height:"24px"}),xh=St({display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"100%",gap:"16px"});function Th(){return S("div",{className:xh,children:[E(Wa,{styles:kh}),S(bh,{children:[E(yh,{}),E(yh,{}),E(yh,{})]}),E(Wa,{styles:kh}),S(bh,{children:[E(yh,{}),E(yh,{}),E(yh,{})]})]})}function Ch({title:e,category:t,onClick:n}){return S(Pl,{children:[E(Rl,{children:e=>E(mh,{text:t.name??"",LeftIcon:Zu(t.name),RightIcon:ko,popupTriggerChildrenProps:e},t.id)}),E(Wh,{headerLabel:e,categoriesLabel:t.name??"",onClick:n,categories:t.children??[]})]})}function wh({onClick:e,showSuggestedCategories:t,categoriesLabel:n,categories:r,isFilling:a}){const o=Ne();return a?E(Th,{}):S(bh,{children:[o&&t&&E(ha,{children:"Suggested"}),E(ha,{children:n}),E("div",{children:r?.map(t=>t.hasChilds?E(Ch,{title:"All Categories",category:t,onClick:e},t.id):E(mh,{text:t.name??"",handleClick:()=>e(t),LeftIcon:Zu(t.name)},t.id))})]})}function Ah(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 Eh=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2768)"},h.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"}),h.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"}),h.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"),Ih=St({paddingTop:"50px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"});function Sh({itemType:e,itemTypePlural:t,showSearchCTA:n}){return S("div",{className:Ih,children:[E(Nc,{Component:Eh}),E(ha,{wrap:"wrap",children:`No ${t} found`}),n&&E(ga,{wrap:"wrap",children:`Try searching for a different ${e}`})]})}const Nh=St({display:"flex",flexDirection:"column",gap:"16px"}),Ph=St({display:"flex",flexDirection:"column",gap:"8px"});function Dh({searchTerm:e,onClick:t,categories:n,isFilling:r}){const a=g(()=>Oe(n),[n]),o=g(()=>fu(a),[a]),i=g(()=>new xe(o??[],Nu),[o]),l=g(()=>o?Ah(Du(i.search(e),o)):{},[o,e,i]);return r?E(Th,{}):0===Object.keys(l).length?E(Sh,{itemType:"category",itemTypePlural:"categories",showSearchCTA:!0}):E(bh,{children:E("div",{className:Nh,children:Object.entries(l).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return S("div",{className:Ph,children:[a&&E(ha,{children:n.name}),E("div",{children:a?r.map(e=>E(mh,{text:e.name??"",handleClick:()=>t(e),LeftIcon:Zu(e.name)},e.id)):E(mh,{text:n.name??"",handleClick:()=>t(n),LeftIcon:Zu(n.name)},e)})]},e)})})})}const Rh=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),Mh=St({display:"flex",flexDirection:"column",justifyContent:"start",gap:"8px",width:"100%"}),Oh=St({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"}),Lh=Pt(St({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"8px",flex:"1 0 0",border:"none",outline:"none",_placeholder:{color:"typography.label.sub"}}),Yt({label:"strongLabel"})),Fh=Wt(null,St({padding:0,outline:"none",border:"none",backgroundColor:"transparent"}));function Bh({searchTerm:e,setSearchTerm:t,placeholder:n}){return S("div",{className:Mh,children:[E(ha,{children:"Search"}),S("div",{className:Oh,children:[E(Nc,{Component:Rh}),E("input",{type:"text",placeholder:n,value:e,onChange:e=>t(e.target.value),className:Lh}),An(e)&&E(ll,{stylists:[Fh],onClick:()=>t(""),children:E(Nc,{Component:Ml})})]})]})}function Uh({onClick:e,placeholder:t,SearchList:n,DefaultList:r,extraProps:a,listLength:o}){const[i,l]=f("");return E(cu,{searchTerm:i,setSearchTerm:l,onClick:t=>{e?.(t)},placeholder:t,SearchInput:Bh,SearchList:n,DefaultList:r,extraProps:a,listLength:o})}const Vh="Search expense categories...";function Wh({headerLabel:e="Back",categoriesLabel:t="All Categories",onClick:n,categories:r,isFetched:a=!1,isFilling:o=!1}){const i=Dl();return E(ph,{title:e,children:E(Uh,{placeholder:Vh,onClick:e=>{n(e),i.setOpen(!1)},SearchList:Dh,DefaultList:wh,listLength:r.length,extraProps:{categories:r,categoriesLabel:t,isFetched:a,isFilling:o}})})}const Hh=St({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"}),qh=St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}),jh=[],zh=Wt(null,St({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function Kh({options:e,onSelect:t,selectedLabel:n}){const r=Dl();return E("div",{...zh,children:e.map(e=>E(zl,{onClick:()=>{return n=Number(e.value),r?.setOpen(!1),void t(n);var n},active:n===e.label,children:e.label},e.value))})}const Yh=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2922)"},h.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_9779_2922"},h.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown"),_h=Wt(null,St({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"}}),xo);function Gh({selectedLabel:e,options:t,onSelect:n}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>S("div",{..._h,...t,children:[E(ha,{children:e}),E(Ol,{Component:Yh})]})}),E(ql,{children:E(Kh,{options:t,onSelect:n,selectedLabel:e})})]})}const Qh=Wt(null,St({display:"flex",alignItems:"center",gap:"15px"})),Zh=rn.map((e,t)=>({value:t,label:e})),Xh=an({}).map(e=>({value:e,label:String(e)}));function Jh({currentMonthYear:e,onMonthYearChange:t}){const n=e.getFullYear(),r=e.getMonth(),a=(e,n)=>{const r=new Date(e,n,1);t(r)};return S("div",{...Qh,children:[E(Gh,{selectedLabel:rn[r],options:Zh,onSelect:e=>a(n,e)}),E(Gh,{selectedLabel:String(n),options:Xh,onSelect:e=>a(e,r)})]})}const $h=Wt(null,St({background:"surface.foreground",padding:"25px",gap:"15px"})),ep=Wt(null,St({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),tp=Wt(null,St({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"}}),xo),np=Wt(null,St({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),rp=Wt(null,St({padding:"8px",textAlign:"center"})),ap=Wt(null,St({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"}}),xo),op=Wt(null,St({color:"typography.base"}));function ip({date:e,selectedDate:t,currentMonth:n,onClick:r,maxDate:a,minDate:o}){const i=t&&on(e,t),l=ln(e),s=e.getMonth()!==n,c=!!a&&sn(e,a),d=!!o&&sn(o,e);return E("button",{...ap,onClick:()=>r(e),"data-selected":i,"data-today":l,disabled:c||d,children:E(ha,{stylists:s||c||d?[op]:[],children:e.getDate().toString()})})}function lp({selectedDate:e,onDateSelect:t,viewDate:n,onViewDateChange:r,maxDate:a,minDate:o}){const i=Dl(),l=n||/* @__PURE__ */new Date,s=l.getFullYear(),c=l.getMonth(),d=function(e,t){const n=Zt(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=Le(d),h=void 0===a||u&&sn(a,u),p=xn(o)||d.length>0&&sn(d[0],o),g=e=>{t(e),i.setOpen(!1)},m=e=>{const t=new Date(l);t.setMonth(l.getMonth()+e),r(t)};return S("div",{...$h,children:[S("div",{...ep,children:[E("button",{...tp,onClick:()=>m(-1),disabled:!p,children:E(Eo,{Component:yo})}),E(Jh,{currentMonthYear:l,onMonthYearChange:r}),E("button",{...tp,onClick:()=>m(1),disabled:!h,children:E(Eo,{Component:ko})})]}),S("div",{...np,children:[nn.map(e=>E("div",{...rp,children:E(ga,{children:e})},e)),d.map(t=>E(ip,{date:t,selectedDate:e,currentMonth:c,onClick:g,maxDate:a,minDate:o},t.toISOString()))]})]})}const sp=Wt(null,Yt({body:"default"}),St({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),cp=Wt(null,Yt({body:"default"}),St({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"}})),dp=u.object({localId:u.string(),id:u.number().nullable(),name:u.string(),size:u.number(),isPending:u.boolean()}),up=u.object({message:u.object({text:u.string(),attachments:u.array(dp)}).refine(e=>e.text.trim().length>0||e.attachments.some(e=>null!==e.id),{message:"Either message text or attachments are required"})});function hp(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const pp=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},h.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"),gp=async({data:e,accessToken:t,environment:n})=>{const{file:r,entity:a,caption:o,entityId:i}=e,l=Mr(n).getUrl(`/files/upload/${a}`),s=wn(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()},mp=async({data:e,accessToken:t,environment:n})=>{const r=Mr(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 vp=St({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),bp=({onFileSelect:e,onUploadComplete:t})=>{const n=p(null),{mutateAsync:r,isPending:a}=md({mutationFn:gp,onSuccess:async()=>Pn.invalidateQueries({queryKey:["files/attachments"]})});return S("div",{children:[E("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"}}),E(ll,{type:"button",onClick:()=>{n.current?.click()},disabled:a,children:E("span",{className:vp,children:E(Nc,{Component:pp})})})]})},fp=St.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),yp=St.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"}),kp=St(yp,fp),xp=St.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Tp=St(xp,fp,Yt.raw({body:"default"})),Cp=St({display:"block",width:"100%"}),wp=St({position:"relative"}),Ap=St({display:"flex",justifyContent:"flex-end",gap:"15px"}),Ep=St({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Ip=T(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:n,onFileSelect:r,onUploadComplete:a,hideFileUpload:o},i){const l=Rd(),s=p(null),{startCallback:c}=Yo({delay:50,callback:e=>n(e)});A(i,()=>s.current);const d=!e&&up.safeParse(l.form.state.values).success;return E(eu,{kind:"text",inputRef:s,disableHover:!0,onClick:()=>(hp(t),void c(!0)),children:S("div",{className:Cp,children:[S("div",{className:wp,children:[S("pre",{className:kp,children:[l.state.value.text,E("br",{})]}),E("textarea",{ref:s,placeholder:"Message...",value:l.state.value.text,className:Tp,onChange:e=>l.handleChange({...l.state.value,text:e.target.value})})]}),S("div",{className:Ap,children:[!o&&E(bp,{onFileSelect:r,onUploadComplete:a}),E(ll,{disabled:!d,type:"submit",children:E("span",{className:Ep,children:E(Nc,{Component:Ts})})})]})]})})});function Sp(e){return new L(e).div(100).toNumber()}function Np(e){return new L(e).times(100).toNumber()}const Pp=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Dp=e=>{const t=e?.description;return`${t} | ${sa(Sp(Number(e?.amount)))} | ${cn(hn(e?.date||""))}`};function Rp({promptText:e}){return S(I,{children:[E(Eo,{Component:Gi}),E(ml,{children:e})]})}function Mp({bankAccounts:e,onClick:t,isFilling:n,showAddButton:r=!1}){return n?E(Eu,{}):S(I,{children:[r&&E(Tu,{onClick:()=>ki("BankAccountForm"),children:E(Rp,{promptText:"Add bank account"})}),e?.map(e=>E(Tu,{onClick:()=>t(e),children:E(ha,{wrap:"wrap",children:ad(e?.name,e?.mask)})},e?.id))]})}const Op={keys:[{name:"apiAccountName",weight:2},{name:"apiAccountNo",weight:1}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Lp({bankAccounts:e,searchTerm:t,onClick:n,isFilling:r,showAddButton:a=!1}){const o=g(()=>new xe(e??[],Op),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Eu,{}):S(I,{children:[a&&E(Tu,{onClick:()=>ki("BanksAndIntegrations"),children:E(Rp,{promptText:"Add bank account"})}),0===i.length?E(wu,{text:"No results found"}):i.map(e=>E(Tu,{onClick:()=>n(e),children:E(ha,{wrap:"wrap",children:ad(e?.name,e?.mask)})},e?.id))]})}function Fp({onClick:e,bankAccounts:t,isFilling:n,showAddButton:r=!1}){return E(hu,{onClick:e,placeholder:"Search bank accounts...",SearchList:Lp,DefaultList:Mp,extraProps:{bankAccounts:t,isFilling:n,showAddButton:r},listLength:t?.length??0})}const Bp=St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"});function Up({label:e,disabled:t,bankAccount:n,bankAccountOptions:r,isFilling:a,onClick:o}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:r=>E(eu,{label:e,popupTriggerProps:r,disabled:t,children:E("button",{className:Bp,type:"button",disabled:t,children:E(ha,{children:ad(n?.name??"",n?.mask??"")})})})}),E(Fp,{bankAccounts:r,isFilling:a,onClick:o,showAddButton:!0})]})}const Vp=(e,t)=>e?.find(e=>e.glAccountId===t),Wp=e=>{const{query:t}=dd({select:t=>{return{...t,data:(n=t?.data,r=e,n?.find(e=>e.id===r))};var n,r}});return t.data?.data},Hp=e=>{if(xn(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||Tn(e.lastSyncedDate))},qp=()=>{const e=dd({select:e=>({...e,hasPlaidLinkedBankAccount:(e?.data?.filter(e=>"PLAID"===e.apiName)??[]).length>0})});return{...e,hasPlaidLinkedBankAccount:!!e.query.data&&e.query.data.hasPlaidLinkedBankAccount}};function jp(e){return e?.filter(e=>Cd(e.apiName)&&"ACTIVE"===e.status)}function zp(e,t){return e?.filter(e=>e.integration?.id===t)||[]}function Kp(e){return dd({select:t=>({...t,data:zp(t?.data,e)})})}const Yp=Wt(Ot["category-text"],St({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-medium-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),Co),_p=Wt(null,St({color:"inherit"})),Gp=Wt(Ot["amount-input-container"],St({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"}}),Co),Qp=()=>["accounting/glAccounts"],Zp=async e=>{const t=e.queryKey,n={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n);return eg(r)};function Xp(e){return Mn({...e,queryKey:["accounting/glAccounts"],queryFn:Zp})}function Jp(){return Xp({select:rg})}function $p(){return Xp({select:ag})}const eg=e=>e.map(e=>({...e,id:Fi({id:e.id,prefix:"GL_ACCOUNT"})}));function tg(e,t){const n=t.get(e.accountNo)??[];return 0===n.length?[{...e,children:[]}]:n.flatMap(e=>tg(e,t))}const ng=e=>!e.parentAccountNo;function rg(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(ng).map(e=>({...e,children:tg(e,t)}))}function ag(e){return rg(e).flatMap(e=>[e,...e.children])}const og=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function ig(e,t){return g(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const lg=e=>({id:e.id||"",name:e.name,accountNo:e.accountNo});function sg(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}const cg={keys:[{name:"name"},{name:"accountNo"}],threshold:.1};function dg(e,t,n){var r;r=t,n.some(({child:e})=>e.accountNo===r.accountNo)||n.push({parent:e,child:t})}function ug(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=>{dg(e,n,t)})}(r,n):a&&dg(a,r,n)}),n}const hg=[Wt(null,St({marginLeft:"6px",marginRight:"6px"}))],pg=Wt(null,St({whiteSpace:"normal"}));function gg({types:e,onClick:t,searchTerm:n}){const{query:{data:r},isFilling:a}=$p(),o=ig(r,e),i=g(()=>new xe(o,cg),[o]),l=g(()=>ug(i.search(n),o),[o,n,i]);return a?E(Eu,{}):l.map(({parent:e,child:n})=>E(Tu,{onClick:()=>t(n),children:S(Su,{stylists:[pg],children:[sg(e.accountNo,e.name),E(Eo,{Component:ko,stylists:hg}),sg(n.accountNo,n.name)]})},`${n.accountNo}`))}function mg({types:e,onClick:t}){const{query:{data:n,isFetching:r},isFilling:a}=Jp(),o=ig(n,e);return a?E(Eu,{}):a||r||void 0!==n?o.map(e=>{const n=sg(e.accountNo,e.name);return E(Fu,{triggerChildren:E(Uu,{displayLabel:n}),popupChildren:E(vg,{glAccount:e,onClick:t})},e.accountNo)}):E(wu,{text:"No data"})}function vg({glAccount:e,onClick:t}){return E(su,{children:e.children.map(e=>E(Tu,{onClick:()=>t(e),children:E(ha,{children:sg(e.accountNo,e.name)})},e.accountNo))})}const bg=St({maxWidth:"420px",width:"fit-content"});function fg({onClick:e,types:t}){const{query:{data:n}}=Jp(),r=ig(n,t);return E(hu,{onClick:e,placeholder:"Search revenue accounts...",getSearchActiveStyles:e=>e?bg:void 0,SearchList:gg,DefaultList:mg,extraProps:{types:t},listLength:r.length,forceSearchVisible:!0})}function yg({title:e,glAccount:t,onClick:n}){return S(Pl,{children:[E(Rl,{children:e=>E(mh,{text:sg(t.accountNo,t.name),RightIcon:ko,popupTriggerChildrenProps:e},t.id)}),E(Ag,{headerLabel:e,glAccountsLabel:t.name,glAccounts:t.children,onClick:n})]})}function kg({onClick:e,showSuggestedCategories:t,glAccounts:n,glAccountsLabel:r,isFilling:a}){const o=Ne(),i=ig(n,og);return a?E(Th,{}):S(bh,{children:[o&&t&&E(ha,{children:"Suggested"}),E(ha,{children:r}),E("div",{children:i?.map(t=>t.hasChilds?E(yg,{glAccount:t,title:"All Income Categories",onClick:e},t.id):E(mh,{text:sg(t.accountNo,t.name),handleClick:()=>e(t)},t.id))})]})}const xg=St({display:"flex",flexDirection:"column",gap:"16px"}),Tg=St({display:"flex",flexDirection:"column",gap:"8px"});function Cg({searchTerm:e,onClick:t,glAccounts:n,isFilling:r}){const a=ig(n.flatMap(e=>[e,...e.children]),og),o=g(()=>new xe(a,cg),[a]),i=g(()=>Ah(ug(o.search(e),a)),[a,e,o]);return r?E(Th,{}):0===Object.keys(i).length?E(Sh,{itemType:"income category",itemTypePlural:"ncome categories",showSearchCTA:!0}):E(bh,{children:E("div",{className:xg,children:Object.entries(i).map(([e,{parent:n,children:r}])=>{const a=r.length>0;return S("div",{className:Tg,children:[a&&E(ha,{children:sg(n.accountNo,n.name)}),E("div",{children:a?r.map(e=>E(mh,{text:sg(e.accountNo,e.name),handleClick:()=>t(e)},e.id)):E(mh,{text:sg(n.accountNo,n.name),handleClick:()=>t(n)},e)})]},e)})})})}const wg="Search Income Categories...";function Ag({headerLabel:e="Back",glAccountsLabel:t="All General Ledger Accounts",onClick:n,glAccounts:r,isFetched:a=!1,isFilling:o=!1}){const i=Dl();return E(ph,{title:e,children:E(Uh,{placeholder:wg,onClick:e=>{n(e),i.setOpen(!1)},SearchList:Cg,DefaultList:kg,listLength:r.length,extraProps:{glAccounts:r,glAccountsLabel:t,isFetched:a,isFilling:o}})})}const Eg=St({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"}),Ig={filter:{type:{in:["BANK_TRANSFER"]}}},Sg={keys:[{name:"description"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function Ng(e){return e.map(e=>e.item)}const Pg=Wt(null,St({whiteSpace:"normal"}));function Dg({onClick:e,transactionId:t,amount:n}){const{query:{data:r},isFilling:a}=Pi(Ig),o=r?.data?.filter(e=>e.id!==t&&"ACTIVE"===e.status&&e.amount===n);return a?E(Eu,{}):o?.map(t=>E(Tu,{onClick:()=>e(t),children:E(ha,{stylists:[Pg],children:Dp(t)})},t.id))}const Rg=Wt(null,St({whiteSpace:"normal"}));function Mg({searchTerm:e,onClick:t,transactionId:n,amount:r}){const{query:{data:a,isFetched:o},isFilling:i}=Pi(Ig),l=a?.data?.filter(e=>e.id!==n&&"ACTIVE"===e.status&&e.amount===r),s=!i&&o&&(void 0===l||0===l.length),c=g(()=>new xe(l??[],Sg),[l]),d=g(()=>l?Ng(c.search(e)):[],[l,e,c]);return i?E(Eu,{}):s?E(wu,{text:"No data"}):0===d.length?E(wu,{text:"No results found"}):E(I,{children:d.map(e=>E(Tu,{onClick:()=>t(e),children:E(ha,{stylists:[Rg],children:Dp(e)})},e.id))})}function Og({onClick:e,transactionId:t,amount:n,noMatches:r}){const{query:{data:a}}=Pi(Ig),o=a?.data?.filter(e=>e.id!==t&&"ACTIVE"===e.status&&e.amount===n);return r?E(ql,{children:E(su,{children:E(wu,{text:"No match found"})})}):E(hu,{onClick:e,placeholder:"Search bank transfer categories...",SearchList:Mg,DefaultList:Dg,listLength:o?.length??0,extraProps:{transactionId:t,amount:n}})}function Lg({onClick:e,showSuggestedCategories:t,bankTransfers:n,bankTransfersLabel:r,isFetched:a,isFilling:o}){const i=Ne(),l=!o&&a&&void 0===n;return o?E("p",{children:"isFilling"}):l?E("p",{children:"isEmpty"}):S(bh,{children:[i&&t&&E(ha,{children:"Suggested"}),E(ha,{children:r}),E("div",{children:n?.map(t=>E(mh,{text:Dp(t),handleClick:()=>e(t)},t.id))})]})}function Fg({searchTerm:e,onClick:t,bankTransfers:n,isFetched:r,isFilling:a}){const o=!a&&r&&0===n.length,i=g(()=>new xe(n??[],Sg),[n]),l=g(()=>n?Ng(i.search(e)):[],[n,e,i]);return a?E("p",{children:"isFilling"}):o?E("p",{children:"isEmpty"}):0===l.length?E("p",{children:"No results"}):E(bh,{children:E("div",{children:l.map(e=>E(mh,{text:Dp(e),handleClick:()=>t(e)},e.id))})})}function Bg({title:e="Back",bankTransfersLabel:t="All Matching Bank Transfers",onClick:n,bankTransfers:r,isFetched:a=!1,isFilling:o=!1}){const i=Dl();return E(ph,{title:e,children:E(Uh,{placeholder:"Search bank transfer categories...",onClick:e=>{n(e),i.setOpen(!1)},SearchList:Fg,DefaultList:Lg,listLength:r.length,extraProps:{bankTransfersLabel:t,bankTransfers:r,isFetched:a,isFilling:o}})})}const Ug=St({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"}),Vg=Wt(null,St({color:"typography.base.weak"})),Wg=Wt(null,St({display:"grid",textWrap:"nowrap"}));function Hg({children:e,rows:t,cols:n}){return E("div",{...Wg,style:{gridTemplateColumns:`repeat(${n}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const qg=Rt({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function jg({option:e,handleClick:t,selected:n,width:r,backgroundColor:a}){const o=Pt(qg({width:r,backgroundColor:a}),Xi,Qi,Zi,xo);return void 0===e?null:E("button",{type:"button",className:o,onClick:()=>t(e),"data-active":n?.value===e.value,children:E(ml,{wrap:"wrap",alignment:"center",children:e.label})})}function zg({options:e,handleClick:t,selected:n,rows:r,cols:a}){return E(Hg,{rows:r,cols:a,children:e?.map(e=>E(jg,{option:e,handleClick:t,selected:n},e.value))})}function Kg({options:e}){const t=Dl(),n=Rd();return E(ql,{children:E(su,{children:e.map(e=>E(Tu,{onClick:()=>{n.handleChange(e.value),n.handleBlur(),t.setOpen(!1)},children:E(ml,{children:e.label})},e.value))})})}const Yg=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),_g=Wt(null,St({color:"typography.base.weak"})),Gg=(e,t)=>{const n=e.find(e=>e.value===t);return n?.label},Qg=St({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"}),Zg=St({display:"flex",flexDirection:{base:"row",md:"column"},alignItems:{base:"center",md:"start"},justifyContent:"flex-start",textAlign:"start",gap:"5px",maxWidth:"100%",flexWrap:"wrap"});function Xg({accountName:e,accountNo:t,syncText:n,active:r=!0}){return S("div",{className:Zg,children:[n&&E(ga,{intent:r?"normal":"danger",children:n}),E(ha,{wrap:"wrap",children:e}),t&&E(ha,{children:rd(t)})]})}const Jg=e=>["plaidInstitutionLogo",e??{}];function $g(e){const t=In(),n=Rn();return D({queryKey:Jg({institutionId:e,accessToken:t,environment:n}),queryFn:async()=>await Wc({institutionId:e,accessToken:t,environment:n}),staleTime:864e5}).data?.map?.logo}const em=St({display:"flex",gap:"10px",maxWidth:"100%"});function tm({accountName:e,accountNo:t,institutionId:n,syncText:r,active:a=!0,showIcon:o=!0}){const i=$g(n);return S("div",{className:em,children:[i&&o?E("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):E(xs,{Component:Ku}),E(Xg,{accountName:e,accountNo:t,active:a,syncText:r})]})}const nm=St({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function rm({selectedAccount:e,placeholderText:t,disabled:n=!1,popupTriggerProps:r}){return E(ll,{...r,disabled:n,width:"fill-parent",children:E(Su,{children:e?ad(e.name,e.mask):S("div",{className:nm,children:[E(ml,{children:t}),E(Eo,{Component:Gi})]})})})}const am="TRIGGER_ACCOUNT",om="FORM_SELECTABLE_ACCOUNT",im=St({display:"flex",flexDirection:"column",gap:"8px",width:"100%"});function lm({selectedAccount:e,setSelectedAccount:t,mergeDestination:n,bankAccounts:r,isFilling:a,warningMessage:o}){return S("div",{className:im,children:[S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(rm,{popupTriggerProps:t,selectedAccount:e,placeholderText:n===am?"Select Duplicate Bank Account":"Select Destination Bank Account"})}),E(Fp,{bankAccounts:r,isFilling:a,onClick:t})]}),o&&E(Vd,{errorMessage:o})]})}const sm=(e,t,n)=>{if(!n)return;const r=e===om?t:n,a=e===om?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)&&Cd(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},cm=St({display:"flex",flexDirection:"column",gap:{base:"15px",sm:"0"}}),dm=St({display:{base:"block",sm:"none"}}),um=St({display:"grid",gridTemplateColumns:{sm:"300px auto 175px",base:"1fr"},gap:"10px",alignItems:"center"}),hm=St({display:"flex",justifyContent:"center",alignItems:"center"}),pm=St({display:{base:"none",sm:"block"}}),gm=St({display:{base:"block",sm:"none"}});function mm({destinationAccount:e,selectedDuplicate:t,availableAccounts:n,isFilling:r,onSelectionChange:a}){const o=n&&n.length>0;return S("div",{className:cm,children:[S("div",{className:um,children:[o?E(lm,{selectedAccount:t,setSelectedAccount:a,mergeDestination:am,bankAccounts:n,isFilling:r,warningMessage:sm(am,e,t??null)}):E(rm,{disabled:!0,selectedAccount:t,placeholderText:"No Duplicate Accounts Available"}),S("div",{className:hm,children:[E("div",{className:pm,children:E(Nc,{Component:ko})}),E("div",{className:gm,children:E(Nc,{Component:Yh})})]}),E(tm,{accountName:e.name,accountNo:e.mask,institutionId:e.integration.apiInstitutionId??""})]}),E("div",{className:dm,children:E(ui,{alignment:"horizontal"})})]})}const vm=async e=>{const t=e.queryKey,n={path:"/expenses/vendors",accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Fi({id:e.id,prefix:"VENDOR"})})):[];return{...r,data:a}};function bm(){return Mn({queryKey:["expenses/vendors"],queryFn:vm})}const fm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/expenses/vendor",bodyParams:{vendor:{name:e}},accessToken:t,endpointManager:Mr(n)};return await Sr(r)},ym=Pt(Yt({body:"default"}),St({display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flex:1,border:"none",outline:"none",background:"transparent","&::placeholder":{color:"typography.base.weak"}})),km=St({display:"flex",alignItems:"center",width:"100%",gap:"8px"}),xm=St({display:"flex",alignItems:"center",justifyContent:"center",background:"brand.success",color:"typography.contrast",border:"none",cursor:"pointer",padding:"2px 6px",borderRadius:"sm",outline:"none"});function Tm({placeholder:e,value:t,onChange:n,onSubmit:r,onCancel:a,inputRef:o}){return S("div",{className:km,children:[E("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:ym}),E("button",{type:"button",onClick:r,className:xm,children:E(ga,{children:"Add"})})]})}function Cm({promptText:e,placeholderText:t,onSubmit:n}){const[r,a]=f(!1),[o,i]=f(""),l=p(null);return k(()=>{r&&l.current&&l.current.focus({preventScroll:!0})},[r]),E(Tu,{onClick:r?void 0:()=>{a(!0)},children:r?E(Tm,{placeholder:t,value:o,onChange:i,onSubmit:()=>{o.trim()&&(n(o.trim()),i(""),a(!1))},onCancel:()=>{i(""),a(!1)},inputRef:l}):E(Rp,{promptText:e})})}const wm={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Am({vendors:e,searchTerm:t,onClick:n,isLoading:r,onCreateVendor:a}){const o=g(()=>new xe(e??[],wm),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:a}),0===i.length?E(wu,{text:"No results found"}):i.map(e=>E(Tu,{onClick:()=>n(e),children:E(ml,{children:e.name})},e.id))]})}function Em({vendors:e,onClick:t,isLoading:n,onCreateVendor:r}){return n?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a vendor",placeholderText:"Enter vendor name...",onSubmit:r}),e.map(e=>E(Tu,{onClick:()=>t(e),children:E(ml,{children:e.name})},e.id))]})}function Im({onClick:e}){const{query:{data:t,isLoading:n}}=bm(),{mutate:r}=md({mutationFn:fm,onSuccess:async()=>Pn.invalidateQueries({queryKey:["expenses/vendors"]})}),a=t?.data??[];return E(hu,{onClick:e,placeholder:"Search vendors...",SearchList:Am,DefaultList:Em,extraProps:{vendors:a,isLoading:n,onCreateVendor:e=>{r(e)}},listLength:a.length})}const Sm=async e=>{const t=e.queryKey,n={path:"/clientMgmt/clients",accessToken:t[1].accessToken,environment:t[1].environment},r=await Ko(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Fi({id:e.id,prefix:"CUSTOMER"})})):[];return{...r,data:a}};function Nm(){return Mn({queryKey:["clientMgmt/clients"],queryFn:Sm})}const Pm=async({data:e,accessToken:t,environment:n})=>{const r={path:"/clientMgmt/client",bodyParams:{client:{name:e}},accessToken:t,endpointManager:Mr(n)};return await Sr(r)},Dm={keys:[{name:"name"}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Rm({customers:e,searchTerm:t,onClick:n,isLoading:r,onCreateCustomer:a}){const o=g(()=>new xe(e??[],Dm),[e]),i=g(()=>e?o.search(t).map(e=>e.item):[],[e,t,o]);return r?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:a}),0===i.length?E(wu,{text:"No results found"}):i.map(e=>E(Tu,{onClick:()=>n(e),children:E(ml,{children:e.name})},e.id))]})}function Mm({customers:e,onClick:t,isLoading:n,onCreateCustomer:r}){return n?E(Eu,{}):S(I,{children:[E(Cm,{promptText:"Add a customer",placeholderText:"Enter customer name...",onSubmit:r}),e.map(e=>E(Tu,{onClick:()=>t(e),children:E(ml,{children:e.name})},e.id))]})}function Om({onClick:e}){const{query:{data:t,isLoading:n}}=Nm(),{mutate:r}=md({mutationFn:Pm,onSuccess:async()=>Pn.invalidateQueries({queryKey:["clientMgmt/clients"]})}),a=t?.data??[];return E(hu,{onClick:e,placeholder:"Search customers...",SearchList:Rm,DefaultList:Mm,extraProps:{customers:a,isLoading:n,onCreateCustomer:e=>{r(e)}},listLength:a.length})}function Lm({frequencies:e,onClick:t}){const n=Dl();return E(ql,{children:E(su,{children:e.map(e=>E(Tu,{onClick:()=>(t(e),void n.setOpen(!1)),children:E(ha,{children:e.name})},e.value))})})}const Fm=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],Bm=["FEDERAL","STATE","SALES"],Um=["Q1","Q2","Q3","Q4"],Vm=[{value:"FEDERAL",label:"Federal/Self-Employed Income Tax"},{value:"STATE",label:"State Income Tax"},{value:"SALES",label:"Sales Tax"}];function Wm({onClick:e}){const t=Dl();return E(ql,{children:E(su,{children:Vm.map(n=>E(Tu,{onClick:()=>{return r=n.value,e(r),void t.setOpen(!1);var r},children:E(ha,{children:n.label})},n.label))})})}function Hm({headerLabel:e="Back",onClick:t}){const n=Dl();return E(ph,{title:e,children:S(bh,{children:[E(ha,{children:"Tax Categories"}),E("div",{children:Vm.map(e=>E(mh,{text:e.label,handleClick:()=>(t(e.value),void n.setOpen(!1))},e.value))})]})})}const qm=St({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"}),{useAppForm:jm,withForm:zm}=ye({formContext:Pd,fieldContext:Dd,formComponents:{SaveButton:Ld},fieldComponents:{DiscreteAmountField:function({label:e}){const t=p(null),n=Rd();return E(Kd,{inputRef:t,label:e,children:E(Xd,{value:n.state.value,onChange:n.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const n=p(null),r=Rd();return E(eu,{inputRef:n,label:e,children:E(Xd,{value:r.state.value,onChange:r.handleChange,inputRef:n,autofocus:t})})},ExpenseCategoryField:function({category:e,onClick:t,childrenField:n,totalAmount:r,glAccount:a}){const{query:{data:o,isFetched:i},isFilling:l}=vu(),s=o?.data??jh,c=th(),d=()=>{const t=Math.floor(r/2*100)/100,o=r-t;n?.pushValue({amount:t,category:e,classSegments:[],glAccount:a}),n?.pushValue({amount:o,category:e,classSegments:[],glAccount:a})};return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>S(eu,{label:"Category",popupTriggerProps:t,children:[S("button",{className:Hh,type:"button",children:[S("div",{className:qh,children:[E(Nc,{Component:Zu(e?.name)}),E(ha,{children:e?.name||"Uncategorized"})]}),E(Nc,{Component:ko})]}),n&&E($u,{onClick:d})]})}),c?E(Wh,{onClick:t,categories:s,isFetched:i,isFilling:l}):E(Hu,{onClick:t})]})},DateInput:function({label:e,maxDate:t,minDate:n,autofocus:r=!1,editable:a=!1}){const o=Rd(),i=fe(o.store,e=>e.meta.isDefaultValue),l=p(null),[s,c]=f(()=>o.state.value?hn(o.state.value):/* @__PURE__ */new Date),d=o.state.value?hn(o.state.value):null,[u,h]=f(""),g=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=un(r);if(a){let e=a;t&&n?e=mn(gn(a,t),n):t?e=gn(a,t):n&&(e=mn(a,n)),o.handleChange(pn(e)),c(e)}else o.handleChange("")},m=u||(d?cn(d):""),[v,b]=f(!1),y=e=>{v&&(()=>{if(d&&!i){const e=un(u);(t&&e&&sn(e,t)||n&&e&&sn(n,e))&&h(cn(d))}})(),b(e)},k=e=>{"Enter"===e.key&&(e.preventDefault(),y(!v))},x=a?eu:Kd;return S(Pl,{placement:"bottom-start",onOpenChange:y,open:v,children:[E(Rl,{children:t=>E(x,{label:e,inputRef:l,popupTriggerProps:t,onClick:()=>b(!0),children:E("input",{...sp,ref:l,type:"text",id:o.name,value:m,onChange:g,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:k,autoComplete:"off"})})}),E(ql,{initialFocus:!1,children:E(lp,{selectedDate:d,onDateSelect:e=>{o.handleChange(pn(e)),h(cn(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=Rd(),o=p(null);return E(eu,{label:e,inputRef:o,children:E("textarea",{...cp,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:Ip,SplitExpenseCategoryField:function({value:e,onChange:t}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>S("button",{...Yp,...t,type:"button",children:[E(Nc,{Component:Zu(e?.name)}),E(ha,{stylists:[_p],children:e?.name||"Uncategorized"})]})}),E(Hu,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:n}){const[r,a]=f(!1);return E("div",{...Gp,"data-clicked":r,children:E(Xd,{value:e,onChange:t,onClick:()=>a(!0),onBlur:()=>(a(!1),void n())})})},ManualBankAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Rd(),r=Wp(t.id),{query:{data:a},isFilling:o}=dd({select:e=>({...e,data:jp(e?.data)})}),i=a?.data,l=xn(e)||!Pp(e);return E(Up,{label:"Bank Account",disabled:l,onClick:e=>{var t;n({id:(t=e).id,name:t.name})},bankAccount:r,bankAccountOptions:i,isFilling:o})},GlAccountField:function(){const e=th(),{query:{data:t,isFetched:n},isFilling:r}=Jp(),a=Rd(),o=a.state.value,i=e=>{const t=lg(e);a.handleChange(t)};return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(eu,{label:"Category",popupTriggerProps:e,children:S("button",{className:Eg,type:"button",children:[E(ha,{children:sg(o.accountNo,o.name)}),E(Nc,{Component:ko})]})})}),e?E(Ag,{onClick:i,glAccounts:t??[],isFetched:n,isFilling:r}):E(fg,{onClick:i,types:og})]})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:n}=Rd(),{query:{data:r}}=$p(),a=function(e){const{query:t}=dd({select:t=>({...t,data:Vp(t.data,e)})});return t.data?.data}(t?.id),{query:{data:o},isFilling:i}=dd({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?Ad(e.amount):"";return E(Up,{label:s,onClick:e=>{const t=(a=r,o=e,a?.flatMap(e=>[e,...e.children??[]]).find(e=>e.id===o.glAccountId?.split("_")[1]));var a,o;t&&n(lg(t))},bankAccount:a,bankAccountOptions:l,isFilling:i})},MatchingBankTransferField:function({transaction:e}){const t=th(),n=Rd(),{query:{data:r,isFetched:a},isFilling:o}=Pi(Ig),i=r?.data?.filter(t=>t.id!==e?.id&&"ACTIVE"===t.status&&t.amount===e?.amount),l=Tn(i)&&i.length>0,s=e=>{const t={id:(r=e).id,description:r?.description,amount:r?.amount,date:r?.date,bankAccountId:r?.bankAccount?.id,apiName:r?.apiName};var r;n.handleChange(t),n.handleBlur()},c=n.state.value,d=c?Dp(c):"Select",u=c?[]:[Vg];return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(eu,{label:"Matching Bank Transfer",popupTriggerProps:e,children:S("button",{className:Ug,children:[E(ha,{stylists:u,children:d}),E(Nc,{Component:ko,stylists:u})]})})}),t?E(Bg,{bankTransfers:i??[],isFetched:a,isFilling:o,onClick:s}):E(Og,{onClick:s,transactionId:e?.id??"",amount:e?.amount??0,noMatches:!l})]})},ButtonGroupField:function({label:e,options:t}){const n=Rd(),r=t.find(e=>e.value===n.state.value);return E(eu,{label:e,disableHover:!0,children:E(zg,{options:t,selected:r,handleClick:e=>{n.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:zg,GenericSelectorField:function({options:e,label:t,disabled:n}){const r=Rd();return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:a=>E(eu,{label:t,popupTriggerProps:a,disabled:n,children:E("button",{...Yg,type:"button",children:r.state.value?E(ha,{children:Gg(e,r.state.value)}):E(ha,{stylists:[_g],children:`Select ${t}...`})})})}),E(Kg,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:n,disabled:r,placeholder:a="Enter value..."}){const o=Rd(),i=p(null);return E(eu,{label:e,disabled:r,inputRef:i,kind:"text",type:t,maxLength:n,children:E("input",{className:Qg,value:o.state.value,onChange:e=>o.handleChange(e.target.value),type:t,maxLength:n,ref:i,placeholder:a})})},BulkMergeAccountRowField:mm,VendorFieldInput:function({label:e,onClick:t,vendor:n,editable:r=!1}){const a=p(null),o=r?eu:Kd;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(o,{inputRef:a,label:e,popupTriggerProps:t,children:E(ha,{children:n?.name??"Select a vendor..."})})}),E(Im,{onClick:t})]})},CustomerFieldInput:function({label:e,onClick:t,customer:n,editable:r=!1}){const a=p(null),o=r?eu:Kd;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(o,{inputRef:a,label:e,popupTriggerProps:t,children:E(ha,{children:n?.name??"Select a customer..."})})}),E(Om,{onClick:t})]})},FrequencyFieldInput:function({label:e,onClick:t,frequency:n}){const r=p(null),a=`${n?.name??wi[0].name}`;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:t=>E(eu,{inputRef:r,label:e,popupTriggerProps:t,children:E(ha,{children:a})})}),E(Lm,{frequencies:wi,onClick:t})]})},TaxCategoryField:function({region:e,onClick:t}){const n=th(),r=function(e){if(!xn(e))return Vm.find(t=>t.value===e)?.label}(e)??"Select tax category...";return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(eu,{label:"Category",popupTriggerProps:e,children:S("button",{className:qm,type:"button",children:[E(ha,{children:r}),n&&E(Nc,{Component:ko})]})})}),E(n?Hm:Wm,{onClick:t})]})}}});const Km=[Wt(null,St({"& path":{stroke:"icon.base"}}))];function Ym({showIcon:e=!0,textContent:t="Cancel",onClick:n}){return S(ll,{type:"button",onClick:n,children:[e&&E(Eo,{Component:Ml,stylists:Km}),E(ha,{children:t})]})}const _m=St({display:"flex",flexDirection:"column",gap:"20px",padding:"20px",width:"100%",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minWidth:{md:"800px",base:"100%"}}),Gm=St({display:"flex",flexDirection:"column",gap:"10px",flexShrink:0}),Qm=St({maxWidth:"600px"}),Zm=St({display:"flex",flexDirection:"column",gap:"15px",flexGrow:1,flexShrink:1,minHeight:0,overflowY:"auto"}),Xm=St({display:{base:"none",md:"grid"},gridTemplateColumns:"300px auto 175px",gap:"10px",alignItems:"center"}),Jm=St({display:"flex",justifyContent:"flex-start",alignItems:"center"}),$m=St({display:"flex",justifyContent:{md:"center",base:"flex-start"},alignItems:"center"}),ev=St({display:"flex",justifyContent:{md:"flex-end",base:"flex-start"},alignItems:"center"}),tv=St({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"15px",justifyContent:"flex-end",paddingTop:"10px",borderTop:"1px solid",borderColor:"border.layout",flexShrink:0}),nv=e=>{Yd(e),_d(e)};function rv({destinationAccounts:e,matchingAccountPairs:t,handleClose:n}){const{query:{data:r},isFilling:a}=dd(),o={selectedAccounts:e.filter(e=>e.glAccountId&&e.isSupported).map(e=>({duplicateAccount:void 0,destinationAccount:e}))},i=function(e,t,n){const{mutateAsync:r}=Td(),a=In(),o=Rn(),i=Tn(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,Ci({queryKey:kn(Ii({filter:{bankAccount:{id:{in:[t]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),queryFn:Ni,accessToken:n,environment:r}))}),jm({defaultValues:l,onSubmit:async e=>{if(await Sd()===Yc){const n=e.value.selectedAccounts.filter(e=>void 0!==e.duplicateAccount);if(!a)return void(await Nd());const l=i?await Promise.all(n.map(async({destinationAccount:e,duplicateAccount:t})=>{const n=await async function(e,t,n){const r=kn(Ii({filter:{bankAccount:{id:{in:[e]}},status:{in:["ACTIVE"]}},sort:{orderBy:"DATE",direction:"DESC"},limit:1}),{cursor:void 0}),a=await Ti({queryKey:r,queryFn:Ni,accessToken:t,environment:n});return a?.data?.[0]?.date}(t.id,a,o);var r,i,l;return pn((r=hn(e.tranStartDate||""),i=hn(n||""),l=hn(e.tranMinStartDate||""),xn(i)?r:Tn(l)?mn(i,l):(Tn(r)&&mn(i,r),r)))})):[],s=n.map(({duplicateAccount:e,destinationAccount:t},n)=>{const r=l[n];return{...Ed(t),duplicateBankAccountIds:[Bi(e.id)],...r&&{tranStartDate:r}}});try{await r(s),t()}catch{await Nd()}}},onSubmitInvalid:()=>{}})}(o,n,t),l=i.state.values.selectedAccounts.map(e=>e.destinationAccount);return S("form",{className:_m,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),i.handleSubmit()},onKeyDown:nv,children:[S("div",{className:Gm,children:[E(ha,{children:"Merge Accounts"}),E("div",{className:Qm,children:E(ml,{wrap:"wrap",children:"If you have historical transactions from imported accounts, you can merge them into your linked accounts."})})]}),S("div",{className:Zm,children:[S("div",{className:Xm,children:[E("div",{className:Jm,children:E(ha,{children:"Duplicate Account"})}),E("div",{className:$m,children:E(ha,{children:"Into"})}),E("div",{className:ev,children:E(ha,{children:"Destination Account"})})]}),E(i.AppField,{mode:"array",name:"selectedAccounts",children:e=>e.state.value.map((t,n)=>E(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)&&Cd(e.apiName)&&"REMOVED"!==e.status)}(l,e.state.value,n,r?.data);return E(mm,{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))})]}),E("div",{className:tv,children:E(i.Subscribe,{selector:e=>e.values.selectedAccounts,children:e=>{const t=e.some(e=>void 0!==e.duplicateAccount);return S(I,{children:[E(Ym,{showIcon:!1,onClick:()=>n()}),E(gd,{onClick:()=>i.reset(o),disabled:!t,children:E(ha,{children:"Clear Selections"})}),E(Ld,{showIcon:!1,disabled:!t,textContent:"Merge"})]})}})})]})}const av=St({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"}),ov=me.createConfirmation(ve(function({show:e,dismiss:t,matchingAccountPairs:n,plaidItemAccounts:r}){const a=n?n.map(e=>e.destinationAccount):r;return E(Xc,{show:e,role:"dialog",size:"lg",padding:"none",outsidePress:!1,escapeKey:!0,children:E("div",{className:av,children:E(rv,{destinationAccounts:a,matchingAccountPairs:n,handleClose:()=>t()})})})}));async function iv({plaidItemAccounts:e,matchingAccountPairs:t}){await ov({matchingAccountPairs:t,plaidItemAccounts:e})}const lv=St({display:"flex",flexDirection:"column",gap:"12px"}),sv=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:Uc(n)},{url:a,headers:o}=wr(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?(vr("Plaid Link Token created successfully",{accessToken:t,plaidItemId:e,link_token:r.link_token}),r.link_token):(br({error:new Error("Plaid Link Token missing in response"),severity:"error",extraData:{accessToken:t,plaidItemId:e,res:r}}),ld("NO_LINK_TOKEN"))}catch(r){return br({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:t,plaidItemId:e,error:r}}),ld("LINK_TOKEN_FAILED")}};async function cv(e,t,n){const r=await async function(e,t){const n=kn(Oc({filter:{apiName:{equal:"PLAID"}}}),{cursor:void 0}),r=await Ti({queryKey:n,queryFn:Lc,accessToken:e,environment:t});return r?.data??[]}(t,n);return r?.find(t=>t.apiInstitutionId===e&&"ACTIVE"===t.status)}async function dv(e,t,n,r){vr("savePlaidItemPublicToken",{publicToken:e,metadata:t,accessToken:n,environment:r});try{t.institution&&t.institution.institution_id&&t.institution.name||vr("Plaid metadata missing institution info",{metadata:t,publicToken:e});const a=await async function(e,t,n){if(e){r=t,a=n,Ci({queryKey:kn(["banks/accounts",{}],{}),queryFn:cd,accessToken:r,environment:a});const o=await cv(e,t,n);if(o){const e=await ud(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:Uc(r)},{url:o,headers:i}=wr(a);return await Ar({url:o,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:t,accessToken:n,environment:r});if(vr("Plaid Public Token exchanged successfully",{metadata:t,publicToken:e}),await async function(){await Promise.all([Pn.invalidateQueries({queryKey:["integrations"]}),Pn.invalidateQueries({queryKey:["banks/accounts",{}]}),Pn.invalidateQueries({queryKey:["banks/transactions",{}]})])}(),function(e){const t=Tn(e.apiErrorType)&&Tn(e.apiErrorCode),n="RELINK"===lc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}).buttonType;return t&&n}(o))return br({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 ud(n,r),s=i?.data?.filter(e=>Cd(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?(br({error:new Error("No accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),async function(e){await td({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:Kc,label:"Cancel"},{key:_c,label:"Chat",type:$c}]})===_c&&od({message:{text:`I tried to link with ${e} and no accounts were returned (CODE: BANK_NO_ACCOUNTS).`,attachments:[]}})}(o||"my bank")):void br({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 br({error:new Error("No new valid accounts were linked from Plaid"),severity:"error",extraData:{metadata:n,publicToken:r,plaidItem:e}}),td({title:"Uh Oh!",body:`There are no new/valid income or expense accounts in your ${o} account.`,buttons:[{key:Kc,label:"OK"}]});const s=i.filter(e=>!e.isSupported);if(e.plaidItemAccounts&&s&&s.length>0)return br({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 td({title:"All set! Ready to track your transactions?",body:S("div",{className:id,children:[E(ml,{wrap:"wrap",children:`Your ${n} ${t} ${nd("account","accounts",n)} are now linked. All transactions will be organized into easy-to-understand categories.`}),E(ml,{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.`}),E("ul",{children:e.map(e=>E("li",{children:E(ml,{wrap:"wrap",children:ad(e.apiAccountName??"",e.apiMask??"")})},e.apiMask))})]}),buttons:[{key:_c,label:"Get Started",type:$c}]})}(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:hd(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 td({title:"Your transactions are being categorized",body:S("div",{className:lv,children:[E(ml,{wrap:"wrap",children:`Your ${e} account(s) are now linked.`}),E(ml,{wrap:"wrap",children:"Hurdlr has detected that the following accounts may be duplicates of the newly linked accounts."}),S("ul",{children:[r.map(({duplicateAccount:e})=>E("li",{children:E(ml,{wrap:"wrap",children:ad(e?.name??"",e?.mask??"")})},e?.id)),a&&E("li",{children:E(ml,{wrap:"wrap",children:"and more..."})})]}),E(ml,{wrap:"wrap",children:"We suggest you merge these accounts into your newly linked accounts. Would you like to review suggestions?"})]}),buttons:[{key:Kc,label:"No thanks"},{key:_c,label:"Review",type:$c}]})===_c&&await iv({matchingAccountPairs:t,plaidItemAccounts:n})}({institutionName:o??"your bank",matchingAccountPairs:c,plaidItemAccounts:c.map(e=>e.destinationAccount)}):e.plaidItemAccounts?(br({error:new Error("Accounts saved successfully"),severity:"info",extraData:{metadata:n,publicToken:r,plaidItem:e}}),d=o,u=e.plaidItemAccounts.length,td({title:"All set! Ready to track your transactions?",body:`Your ${u} ${d} ${nd("account","accounts",u)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:_c,label:"Get started",type:$c}]})):void 0;var d,u}(o,a,t,e,s),{}}catch(a){return br({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:t,publicToken:e,error:a}}),await async function(e){await td({title:"Uh Oh!",body:"It appears something went wrong with your connection while linking your bank. Please try again.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Chat",type:$c}]})===_c&&od({message:{text:`I tried to link with ${e} and it failed (CODE: BANK_POST_FAILURE).`,attachments:[]}})}(t.institution?.name||"my bank"),{}}}async function uv(e,t,n){return xn(e)?(vr("Plaid Link exited by user with error",{metadata:t,error:e,linkToken:n}),!1):(vr("Plaid Link exited by user without error",{metadata:t,linkToken:n}),"ITEM_NO_ERROR"===e.error_code||"item-no-error"===e.error_code?(br({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&&(br({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 td({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:Kc,label:"Cancel"},{key:"chat",label:"Chat"},{key:_c,label:"Banks & Integrations",type:$c}]});"chat"===t?od({message:{text:"Please help me with my bank issue (code: INVALID_UPDATED_USERNAME). Thanks!",attachments:[]}}):t!==_c||(e=>{const t=He.getState().drawerHistory;return Object.keys(t).includes(e)})("BanksAndIntegrations")||ki("BanksAndIntegrations")}(t.institution?.name||"Invalid Updated Username")),!1))}const hv="PLAID_LINK_NEW",pv="PLAID_LINK_UPDATE",gv="PLAID_LINK_UNLINK";function mv({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 vv=m({});function bv({onPlaidLink:e,children:t}){return E(vv.Provider,{value:{onPlaidLink:e},children:t})}function fv(){return v(vv)}async function yv(e){const{url:t,headers:n}=wr(e);return async function(e){const{authorization:t,extraHeaders:n,params:r,url:a}=e,o=xr({extraHeaders:n,authorization:t});vr("HTTP DELETE Request",{url:a,accessToken:t});try{const e=await fetch(a,{method:"DELETE",headers:o,credentials:"include",body:JSON.stringify(r)});return vr("HTTP DELETE Response",{url:a,status:e.status,statusText:e.statusText}),Tr(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:n})}const kv=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:e,accessToken:t,endpointManager:Mr(n)};return await Sr(r)};function xv(){return md({mutationFn:kv,onSuccess:()=>{const e=["integrations"];return Pn.invalidateQueries({queryKey:e})}})}const Tv=async({accessToken:e,environment:t})=>{const n={path:"/banks/refresh",accessToken:e,endpointManager:Mr(t)};return await Sr(n)};function Cv(){return md({mutationFn:Tv,onSuccess:()=>{const e=["integrations"];return Pn.invalidateQueries({queryKey:e})}})}const wv=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/integration",bodyParams:{id:String(Bi(e.id)),removeFromApi:!0},accessToken:t,endpointManager:Mr(n)};return await async function(e){return yv(e)}(r)};function Av(){const{mutate:e}=Cv();return md({mutationFn:wv,onSuccess:()=>{const e=["integrations"];return Pn.invalidateQueries({queryKey:e})},onError:async t=>{br({error:new Error("error while deleting Plaid Item"),severity:"error",extraData:{error:t}}),await td({title:"Uh Oh!",body:"It appears something went wrong with your connection while unlinking your bank. Please try again.",buttons:[{key:Kc,label:"Cancel"},{key:_c,label:"Try Again",type:$c}]})===_c&&e()}})}function Ev(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)=>{vr(`Plaid event: ${e}`,{metadata:t,eventName:e})}}).open()})}async function Iv(e,t,n,r){const a=await sv(e,t,n);if(!a)return;const o=await Ev(a);if("success"===o?.status){const{public_token:e,metadata:a}=o;vr("Plaid link successful",{public_token:e,metadata:a});const i=await dv(e,a,t,n);if(i.relinkPlaidItemId)return Iv(i.relinkPlaidItemId,t,n,r)}else if("exit"===o?.status){const{metadata:e,error:t}=o;vr("Plaid link exited",{metadata:e,error:t}),await uv(t,e,a)&&r()}else br({error:new Error("Plaid Link did not return a status and failed to open"),severity:"error",extraData:{plaidItemId:e,plaidLinkStatus:o,token:a}})}function Sv(){const[e,t]=Mc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=In(),r=Rn(),{mutate:a}=Cv(),{onPlaidLink:o}=fv();return{linkPlaid:e=>{if(Tn(o)){const t=mv(e);o(t)}else Iv(e.plaidItemId?Bi(e.plaidItemId):void 0,n,r,a)},loading:e||Tn(t),hasOnPlaidLinkOverride:Tn(o)}}function Nv(){const[e,t]=Mc({src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",checkForExisting:!0}),n=In(),r=Rn(),{mutate:a}=Cv(),{apiPartnerName:o}=v(rs),{onPlaidLink:i}=fv();return{linkPlaid:e=>{if(Tn(i)){const t=mv(e);i(t)}else!async function(e,t,n,r,a){const o=await sv(e,t,n);if(!o)return;const i=await Ev(o);if("success"===i?.status){const{public_token:e,metadata:o}=i;vr("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 cv(t.institution.institution_id,n,r);if(i)return br({error:new Error("Plaid Item already linked for institution"),severity:"error",extraData:{metadata:t,publicToken:e,plaidItem:i}}),await(o=a,td({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:Kc,label:"Cancel"},{key:_c,label:"Relink",type:$c}]}))===_c?{relinkPlaidItemId:Bi(i.id)}:{}}var o;return vr("Saving Plaid Public Token from search",{metadata:t,publicToken:e}),dv(e,t,n,r)}(e,o,t,n,r);l.relinkPlaidItemId&&Iv(l.relinkPlaidItemId,t,n,a)}else if("exit"===i?.status){const{metadata:e,error:t}=i;vr("Plaid link from search exited",{metadata:e,error:t}),await uv(t,e,o)&&a()}}(e.plaidItemId?Bi(e.plaidItemId):void 0,n,r,o,a)},loading:e||Tn(t),hasOnPlaidLinkOverride:Tn(i)}}const Pv=Wt(null,Qi,St({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"}}}}),xo);function Dv(){const{linkPlaid:e,loading:t}=Sv();return S("button",{onClick:()=>e({plaidEvent:hv,message:"Tile Plaid Link button pressed"}),...Pv,disabled:t,children:[E(Nc,{Component:Sc}),E(ml,{intent:"primary",children:"Link Account"})]})}const Rv=St({width:266,minHeight:32});function Mv(){return E(Wa,{styles:Rv})}const Ov=St({backgroundColor:"money.positive.weak"}),Lv=St({backgroundColor:"money.negative.weak"}),Fv=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),Bv=({defaultRange:e=Jt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r},isFilling:a}=function({filter:e}){return Fr({filter:e,select:Ic})}({filter:e});let o;return o=t?Xa:r??Fv,S(Kr,{isSample:t,children:[E(Hr,{title:"Profit + Loss"}),E(jr,{children:a?S(qa,{children:[E(Mv,{}),E(Mv,{})]}):S(I,{children:[E(ea,{title:la(o.netIncome),label:"Profit"}),S(na,{children:[E(Ac,{amount:o.income,total:o.absoluteSum,colorCss:Ov,label:"Income"}),E(Ac,{amount:o.expenses,total:o.absoluteSum,colorCss:Lv,label:"Expenses"})]})]})}),t&&E(Ga,{size:"sm"}),n&&E(Dv,{})]})},Uv=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],Vv={moneyIn:0,moneyOut:0,netMoneyIn:0};const Wv=async e=>{const t=e.queryKey,n=t[2],r=t[3].accessToken,a=t[3].environment,o={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...tn(n.filter)},accessToken:r,endpointManager:Mr(a)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data[0];return t||xn(n)||xn(n.operatingActivities)||!n.operatingActivities.children?Vv:function(e){let t=new L(0),n=new L(0);for(const r of e.children)r.total<0?n=n.plus(L(r.total).abs()):t=t.plus(r.total);return{moneyIn:t.toNumber(),moneyOut:n.toNumber(),netMoneyIn:e.total}}(n.operatingActivities)}(await Sr(o))},Hv=St({backgroundColor:"money.positive.weak"}),qv=St({backgroundColor:"money.negative.weak"}),jv=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),zv=({defaultRange:e=Jt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:n})=>{const{query:{data:r,isFetched:a},isFilling:o}=function({filter:e}){return Mn({queryKey:Uv({filter:e}),queryFn:Wv})}({filter:e});let i;i=t?$a:r??jv;let l=0;return(t||a)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),S(Kr,{isSample:t,children:[E(Hr,{title:"Cash Flow"}),E(jr,{children:o?S(qa,{children:[E(Mv,{}),E(Mv,{})]}):S(I,{children:[E(ea,{title:la(i.netMoneyIn),label:"Change in Cash"}),S(na,{children:[E(Ac,{amount:i.moneyIn,total:l,colorCss:Hv,label:"Money In"}),E(Ac,{amount:i.moneyOut,total:l,colorCss:qv,label:"Money Out"})]})]})}),t&&E(Ga,{size:"sm"}),n&&E(Dv,{})]})},Kv=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),Yv=Wt(null,St({display:"flex",justifyContent:"end"}));function _v({color:e,bulletLabel:t,moneySummary:n}){return S("div",{...Kv,children:[E(Ta,{color:e,label:t}),E("div",{...Yv,children:E(ml,{children:n})})]})}const Gv={total:0,children:[]},Qv=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,n=e.json?.data?.[0];return t||xn(n)||xn(n.expenses)||!n.expenses.children?Gv:{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},Zv=Wt(null,St({display:"flex",gap:"10px",alignItems:"center"})),Xv=St({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),Jv=Wt(null,Xv);function $v({bulletAmount:e=3,shimmer:t=!1}){return E(I,{children:Array.from({length:e},(e,n)=>S("div",{...Zv,children:[E(Ta,{color:fa.var("colors.brand.secondary")}),t?E(Wa,{styles:Xv}):E("div",{...Jv})]},n))})}const eb=Wt(null,St({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),tb=[fa.var("colors.brand.primary"),fa.var("colors.brand.success"),fa.var("colors.brand.action")],nb=Object.freeze({total:0,children:[]});function rb({defaultRange:e=Jt.THIS_YEAR,monthIndex:t,isSample:n=!1,showLinkAccountButton:r}){const a=He(e=>e.externalOptions).dataVisualizationColors??tb,{query:{data:o},isFilling:i}=function({filter:e}){return Fr({filter:e,select:Qv})}({filter:e});let l;l=n?Ja:o??nb;const s=void 0===t?"Total Expenses":`${rn[t]} Total`,c=l.children.length>0;return S(Kr,{isSample:n,children:[E(Hr,{title:"Expenses"}),E(jr,{children:i?E(qa,{children:E($v,{shimmer:!0})}):S(I,{children:[E("div",{...eb,children:E(ea,{title:la(l.total),label:s})}),E(na,{children:c?l.children.map((e,t)=>E(_v,{color:a[t],bulletLabel:e.name,moneySummary:la(e.total)},t)):E($v,{})})]})}),n&&E(Ga,{size:"sm"}),r&&E(Dv,{})]})}const ab=Wt(null,St({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function ob({period:e,handleDateChange:t,todayPeriod:n,showSamples:r,showLinkAccountButton:a}){const o=(i=e.month,{beginDate:Zt(l=e.year,i,1),endDate:Zt(l,i+1,0)});var i,l,s,c,d,u,h,p;return S("div",{...ab,children:[S(qt,{children:[E(Gt,{children:"Monthly Review"}),E(gc,{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})]}),S(vc,{children:[E(Bv,{defaultRange:o,isSample:r,showLinkAccountButton:a}),E(zv,{defaultRange:o,isSample:r,showLinkAccountButton:a}),E(rb,{defaultRange:o,monthIndex:e.month,isSample:r,showLinkAccountButton:a})]})]})}const ib="Oldest to Newest",lb="Newest to Oldest",sb="A-Z",cb="Z-A",db="Lowest to Highest",ub="Highest to Lowest",hb="A-Z",pb="Z-A";function gb(){const[e,t]=f(void 0),n=g(()=>{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 Ai)??!1,n=(e.direction&&e.direction in Ei)??!1;return t&&n})(e)&&t(e)},apiSort:n}}const mb=St({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"}}}),vb=St({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),bb=St({background:"brand.primary.strong",border:"none"});function fb({checked:e,onClick:t}){const[n,r]=f(e??!1),a=void 0===e?n:e;return E("button",{...Wt(Ot["checkbox-input"],mb,a?bb:vb,To),type:"button",onClick:a=>{void 0===e&&r(!n),t&&t(a)},"data-is-checked":a,children:a&&E(Ol,{Component:Od})})}const yb=Wt(null,St({paddingLeft:"20px",paddingRight:"5px"}));function kb({checked:e,onClick:t}){return E("div",{...yb,children:E(fb,{checked:e,onClick:t})})}const xb=Wt(Ot.text,St({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),Yr);function Tb({children:e}){return E("div",{...xb,children:e})}const Cb=Wt(Ot["date-cell"],St({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function wb({date:e,annotation:t}){return S("div",{...Cb,children:[t&&E(Tb,{children:t}),E(ml,{children:e})]})}const Ab=St({color:"money.negative"}),Eb=St({color:"money.positive"}),Ib=e=>e.replaceAll("_"," ").toLowerCase().split(" ").map(e=>Cn(e)?e:e[0].toUpperCase()+e.slice(1)).join(" ");function Sb({transaction:e}){const t=(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?Eb:Ab}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?Ab:Eb}})(e);break;case"BANK_TRANSFER":t={type:"BANK_TRANSFER",displayName:"Bank Transfer",css:e.amount<0?Ab:Eb};break;case"PAYOUT":t={type:"PAYOUT",displayName:"Payout",css:e.amount<0?Ab:Eb};break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:Ab};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",n=Eb;return e.amount<0&&(t="Invoice Payment Refund",n=Ab),{type:"INVOICE_PAYMENT",displayName:t,css:n}})(e);break;default:t=(e=>({type:e.type,displayName:Ib(e.type),css:e.amount<0?Ab:Eb}))(e)}return t})(e),n=Wt(Ot["transaction-type-label"],t.css),r=E("span",{...n,children:t.displayName});return E(wb,{date:e.date,annotation:r})}function Nb({label:e,subLabel:t}){return S(I,{children:[E(ha,{children:e}),E(ga,{children:t})]})}function Pb({bankTransaction:e}){return E(Nb,{label:e.description,subLabel:e.bankAccount?.name})}function Db(e){return sa(Sp(e.amount))}function Rb({transaction:e}){return E(ml,{children:Db(e)})}const Mb=Wt(null,St({padding:"0 25px",height:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}));function Ob({annotation:e,accountName:t}){return S("div",{...Mb,children:[e&&E(ga,{children:e}),t&&E(ha,{children:t})]})}const Lb=Wt(Ot["cell-button"],St({border:"none",backgroundColor:"transparent",padding:"0 25px",gap:"10px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"row",flex:1,outline:"none",borderRadius:"md",boxShadow:"0 0 0 0 transparent","&:focus-visible":{transition:"none",position:"relative"},"&:focus-visible::before":{content:"''",position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"md",outline:"4px solid",outlineColor:"border.layout",pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.hover"},"&[data-state='open']":{backgroundColor:"surface.intent.action.active"},"& .Tight-text":{position:"relative"},"& .Tight-text::after":{content:"''",position:"absolute",bottom:0,left:0,width:0,height:"1px",backgroundColor:"currentColor",transition:"width 100ms ease-out",_supportHover:{width:"100%",transition:"width 300ms ease-out"}},"&[data-state='open'] > .Tight-text::after":{width:"100%",transition:"width 300ms ease-out"}}),To),Fb=T(function({children:e,...t},n){return E("button",{ref:n,...Lb,...t,children:e})}),Bb=async({data:e,accessToken:t,environment:n})=>Vb({data:{data:e},accessToken:t,environment:n}),Ub=async({data:e,accessToken:t,environment:n})=>Bb({data:[e],accessToken:t,environment:n}),Vb=async({data:e,accessToken:t,environment:n})=>{const r={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:ho(n)};return await Ir(r)};function Wb(){return md({onSuccess:async()=>{const e=["banks/transactions"];return vr("mutation successful, invalidating BT queries"),Pn.invalidateQueries({queryKey:e}).catch(e=>br({error:e,severity:"error"}))},mutationFn:Bb})}function Hb(){return md({onSuccess:async()=>(vr("mutation successful, invalidating BT queries"),Pn.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>br({error:e,severity:"error"}))),mutationFn:Ub})}function qb({transaction:e,parentTransaction:t,accountNo:n,accountName:r}){const{startPrefetch:a,cancelPrefetch:o}=_o({prefetchFn:Uo(Qp,Zp)}),{mutate:i}=Hb(),l=void 0!==t;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(Fb,{...e,onMouseEnter:a,onMouseLeave:o,children:E(ha,{children:sg(n,r)})})}),E(fg,{onClick:l?n=>{if(n?.id&&l){const{id:r,children:a}=t,{id:o}=e,l=a.map(e=>e.id===o?{...e,glAccountId:n.id.toString()}:e);i({id:r,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:og})]})}function jb({transaction:e,parentTransaction:t}){const{startPrefetch:n,cancelPrefetch:r}=_o({prefetchFn:Uo(pu,gu)}),a=e.category?.name??"Uncategorized",{mutate:o}=Hb(),i=void 0!==t;return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>S(Fb,{...e,onMouseEnter:n,onMouseLeave:r,children:[E(Nc,{Component:Zu(a)}),E(ha,{children:a})]})}),E(Hu,{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()})}})]})}const zb=Wt(null,St({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Kb=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Yb({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),n=new Set(t),r=[...n].join(", "),a=nd("Category","Categories",n.size,!0);return E(kl,{children:S("div",{...Kb,children:[E(Nc,{Component:Xu}),S("div",{...zb,children:[E(ha,{children:a}),E(ga,{children:r})]})]})})}function _b({transaction:e,parentTransaction:t}){return e.children?.length>0?E(Yb,{transaction:e}):E(jb,{transaction:e,parentTransaction:t})}function Gb({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return E(_b,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return E(Ob,{annotation:Ad(e.amount),accountName:e.bankAccount?.name});default:return E(qb,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Qb({name:e}){return E(I,{children:e&&E(ml,{children:e})})}const Zb={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"},Xb=[{name:"Partner Review Required",value:Zb.PARTNER_REVIEW_REQUIRED},{name:"User Review Required",value:Zb.USER_REVIEW_REQUIRED},{name:"Accountant Review Required",value:Zb.ACCOUNTANT_REVIEW_REQUIRED},{name:"Reconciliation Staged",value:Zb.RECONCILIATION_STAGED},{name:"Reconciled",value:Zb.RECONCILED},{name:"Reconciliation Discrepancy",value:Zb.RECONCILIATION_DISCREPANCY}],Jb=fo(e=>h.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),$b=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),ef=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),h.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),tf=St({maxWidth:"100%",width:"fit-content",display:"inline-flex",padding:"4px 5px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{},"& .Tight-sub-label":{color:"typography.base"},"& .Tight-medium-icon > path":{stroke:"icon.base"}}),nf=St({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary"},_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}}}),rf=St({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}}}),af=St({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success"},_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}}}),of=St({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning"},_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}}}),lf=St({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger"},_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}}}),sf=Wt(Ot.badge,tf),cf=Wt(null,Gr),df=Wt(null,To),uf=Wt(Ot["neutral-badge"],nf),hf=Wt(Ot["highlight-badge"],rf),pf=Wt(Ot["success-badge"],af),gf=Wt(Ot["warning-badge"],of),mf=Wt(Ot["critical-badge"],lf);function vf({type:e,children:t,onClick:n,disabled:r,popupTriggerProps:a}){let o;switch(e){case"critical":o=mf;break;case"warning":o=gf;break;case"neutral":o=uf;break;case"success":o=pf;break;case"highlight":o=hf}const i=Kt([sf,cf,o,df]);return E("button",{...i,onClick:n,disabled:r,...a,children:t})}const bf=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],ff=[{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 yf({onClick:e}){const t=Dl(),{userRole:n}=v(rs),r=(e=>{switch(e){case"OWNER":default:return bf;case"ACCOUNTANT":return ff}})(n)||[];return E(ql,{children:E(su,{children:r.map(({status:n,displayName:r})=>E(Tu,{onClick:()=>(e(n),void t.setOpen(!1)),children:r},n))})})}function kf({status:e,transactionId:t}){const[n,r]=f(!1),{mutate:a}=Hb(),o=()=>{r(!1)},i=()=>{r(!n)},{userRole:l}=v(rs),{text:s,type:c,Icon:d}=((e,t)=>{const n=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Zb.ACCOUNTANT_REVIEW_REQUIRED;case"OWNER":return e===Zb.USER_REVIEW_REQUIRED}})(e,t),r=(l=e,"OWNER"===t&&l===Zb.ACCOUNTANT_REVIEW_REQUIRED),a=((e,t)=>"ACCOUNTANT"===t&&e===Zb.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=E(Nc,{Component:ef}),d="neutral"):a?(s="Pending User Review",c=E(Nc,{Component:ef}),d="neutral"):n?(s="Needs Review",c=E(Nc,{Component:Jb}),d="warning"):o?(s="Discrepancy",c=E(Nc,{Component:Fd}),d="critical"):i?(s="Reconciled",c=E(Nc,{Component:$b}),d="success"):(s="Processing",c=E(Nc,{Component:ef}),d="neutral"),{text:s,type:d,Icon:c}})(e,l);return!t||((u=t).startsWith(Oi.TRANSACTION_LINE_ITEM)||u.startsWith(Oi.PROCESSOR_TRANSACTION))?null:S(Pl,{open:n,blockInteraction:!1,onOpenChange:o,enableClickMiddleware:!1,children:[E(Rl,{children:e=>S(vf,{type:c,popupTriggerProps:e,onClick:i,children:[d,E(ga,{children:s})]})}),E(yf,{onClick:e=>{a({id:t,reviewStatus:e}),o()}})]});var u}function xf({status:e,transactionId:t}){return E(kf,{status:e,transactionId:t},t)}const Tf=fo(e=>h.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_9779_2940)"},h.createElement("path",{d:"M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997",stroke:"#182428",strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_9779_2940"},h.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowUp");function Cf({row:e}){const t=e.getIsExpanded();return e.getCanExpand()?E(Zl,{"aria-label":t?"Collapse row":"Expand row","aria-expanded":t,children:E(Eo,{Component:t?Tf:Yh})}):E(Zl,{active:!1,children:E(Eo,{Component:ko})})}function wf({row:e}){return E(Cf,{row:e})}const Af=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),Ef=Wt(null,St({stroke:"icon.base.weak"}));function If({hasConversation:e,hasUnread:t=!1}){return E(I,{children:e?E(Ws,{hasUnread:t}):E("div",{"data-testid":"no-conversations-dash",children:E(Ol,{Component:Af,stylists:[Ef]})})})}function Sf({conversationId:e}){const{query:{data:t}}=ti(e??null),{startPrefetch:n,cancelPrefetch:r}=ri(),{startPrefetch:a,cancelPrefetch:o}=qi(),i=Tn(t),l=i&&"READ"==t?.readStatus,s=y(()=>{Tn(e)&&(n({id:e}),a({id:e}))},[e,n,a]),c=y(()=>{Tn(e)&&(r(),o())},[e,r,o]);return E("div",{onMouseEnter:s,onMouseLeave:c,children:E(If,{hasConversation:i,hasUnread:!l})})}const Nf=_(),Pf=[Nf.display({id:je.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?E(kb,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),Nf.accessor("date",{id:je.DATE,cell:e=>E(kl,{children:E(Sb,{transaction:e.row.original})}),header:()=>E(es,{columnName:"Date",sortDef:"DATE",sortAscDisplay:ib,sortDescDisplay:lb}),size:130,maxSize:144}),Nf.accessor("description",{id:je.DESCRIPTION,cell:e=>E(kl,{children:E(Pb,{bankTransaction:e.row.original})}),header:()=>E(es,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:sb,sortDescDisplay:cb}),size:180}),Nf.accessor("amount",{id:je.AMOUNT,cell:e=>E(kl,{children:E(Rb,{transaction:e.row.original})}),header:()=>E(es,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:db,sortDescDisplay:ub}),size:130,maxSize:180}),Nf.accessor("category.id",{id:je.CATEGORY,cell:({row:e})=>E(Gb,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>E(es,{columnName:"Category"}),size:130,meta:{clickable:!0}}),Nf.accessor(e=>e.classSegments[0]?.id,{id:je.CLASS_SEGMENT,cell:e=>E(kl,{children:E(Qb,{name:e.row.original.classSegments[0]?.name})}),header:()=>E(es,{columnName:"Business"}),size:130}),Nf.accessor("reviewStatus",{id:je.REVIEW_STATUS,cell:e=>E(kl,{children:E(xf,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>E(es,{columnName:"Reviewed",sortDef:"REVIEW_STATUS",sortAscDisplay:hb,sortDescDisplay:pb}),size:130,maxSize:160,meta:{clickable:!0}}),Nf.display({id:je.COMMENTS,cell:e=>{const t=e.row.original;return E(kl,{alignVariant:"center",children:E(Sf,{conversationId:t.conversation?.id})})},header:()=>E(es,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),Nf.display({id:je.EXPAND,cell:e=>E(wf,{row:e.row}),size:40,maxSize:60})];function Df(e){return e?Pf.filter(t=>e.includes(t.id)):Pf}function Rf(e){if(e)return Object.values(je).reduce((t,n)=>(t[n]=e.includes(n),t),{})}const Mf=[];function Of({transactions:e,columns:t}){return G({data:e??Mf,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??Mf.length,columns:Df(t),getCoreRowModel:Q(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,matchingBankTransaction:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],conversation:null};var t}),getExpandedRowModel:Z(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:t,columnVisibility:Rf(t)}})}const Lf=[je.COMMENTS,je.DATE,je.DESCRIPTION,je.AMOUNT,je.CATEGORY,je.REVIEW_STATUS];function Ff(e,t){return ki("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function Bf(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);if("comments"===e.column.id){const e=t.getParentRow();Ff(e?.original.id??t.original.id,"conversation")}else if(!n||o)if(r)t.toggleExpanded();else{const e=t.getParentRow();Ff(e?.original.id??t.original.id)}}function Uf({rowData:e,hasSelect:t=!0}){const{startPrefetch:n,cancelPrefetch:r}=Mi(),a=y(()=>n({id:e.original.id}),[n,e.original]);return E(yi,{rowData:e,onMouseEnter:a,onMouseLeave:r,onCellClick:Bf,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 Vf(){return S(I,{children:[E(xs,{Component:$b}),E(ha,{wrap:"wrap",children:"All caught up"}),E(ga,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Wf=Wt(Ot["button-warning"],St({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 Hf({children:e,stylists:t=[],...n}){return E(ol,{stylists:[Wf,...t],...n,children:e})}function qf(){const{linkPlaid:e,loading:t}=Sv();return E(Hf,{onClick:()=>e({plaidEvent:hv,message:"Plaid Link button pressed"}),disabled:t,children:E(ha,{children:"Link your bank"})})}const jf=Wt(null,St({whiteSpace:"wrap"}));function zf(){return S(I,{children:[E(xs,{Component:Ku}),E(ha,{stylists:[jf],children:"Your bank transactions will be categorized for you"}),E(ga,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),E(qf,{})]})}const Kf=St({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Yf(){return S(I,{children:[E("div",{className:Kf,children:E(Nc,{Component:ef})}),E(ha,{children:"Transactions are being processed"}),E(ga,{children:"Any transactions that require review will show up here."})]})}const _f=St({minWidth:"900px"});function Gf({hasLinkedAccount:e,sortInstance:t,setSortInstance:n,isFilling:r,paginationControls:a,transactions:o}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return Of({transactions:e,columns:t?[...t,je.EXPAND]:void 0})}({transactions:e,columns:Lf})}({transactions:o}),{query:{data:l},isFilling:s}=Pi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=!xn(l?.data?.[0])&&!s,d=function(e,t,n){let r;return e||t?!e||n||t?e&&n&&!t&&(r=E(Vf,{})):r=E(Yf,{}):r=E(zf,{}),r}(e??!1,o.length>0,c);return S("div",{className:_f,children:[E("div",{id:oo}),S(Ao.Provider,{value:a,children:[S(qt,{children:[E(Gt,{children:"Transactions For Your Review"}),E(Is,{children:E(Do,{})})]}),E(ul,{dashboard:"businessOwnerDashboard",children:r?E(Bo,{}):S(I,{children:[E(hl.Provider,{value:{sortInstance:t,setSortInstance:n},children:E(li,{headerGroups:i.getHeaderGroups()})}),xn(d)?E(ci,{children:i.getRowModel().rows.map(e=>E(Uf,{rowData:e,hasSelect:!1},e.id))}):E(ks,{children:d})]})})]})]})}function Qf(){const{sortInstance:e,setSortInstance:t,apiSort:n}=gb(),{query:{data:r},isFilling:a,paginationControls:o}=Pi({filter:lo,sort:n,limit:10}),i=r?.data??co,{hasPlaidLinkedBankAccount:l,isFilling:s}=qp();return E(Gf,{sortInstance:e,setSortInstance:t,isFilling:a||s,paginationControls:o,transactions:i,hasLinkedAccount:l??!1})}const Zf=Wt(Ot["button-action"],St({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 Xf({children:e,stylists:t=[],...n}){return E(ol,{stylists:[Zf,...t],...n,children:e})}const Jf=fo(e=>h.createElement("svg",{stroke:"currentColor",width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),h.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),$f=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Bs,buttonText:"Respond"};case"TRANSACTION_REVIEW":return{Icon:Jb,buttonText:"Review"};case"LINK_BANK":return{Icon:Ku,buttonText:"Link"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:Ku,buttonText:"Fix"};case"RELINK":return{Icon:Ku,buttonText:"Relink"};case"CHAT":return{Icon:Fd,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Jf,buttonText:"Complete"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:$b,buttonText:""};default:return{Icon:Fd,buttonText:""}}},ey=Wt(null,St({display:"flex",alignItems:"center",gap:"15px"})),ty=Wt(null,St({width:"20px",height:"20px"}));function ny({title:e,type:t}){const{Icon:n}=$f(t);return S("div",{...ey,children:[E(Nc,{Component:n,stylists:[ty]}),E(ha,{wrap:"wrap",children:e})]})}const ry=Wt(null,St({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"5px",flex:"1 1 0",minWidth:"200px",width:"100%"}));function ay({title:e,description:t,type:n}){return S("div",{...ry,children:[E(ny,{title:e,type:n}),E(ga,{wrap:"wrap",children:t})]})}const oy=Wt(Ot["banner-button"],St({display:"flex",width:"202px",justifyContent:"flex-end",alignItems:"center",gap:"15px",flexShrink:"0"})),iy=Wt(Ot["banner-button-text"]),ly=Wt(Ot["banner-button-icon"]);function sy({priority:e,type:t,handleClick:n}){const{buttonText:r}=$f(t),{Button:a}=(e=>{switch(e){case"URGENT":return{Button:qc};case"HIGH":return{Button:Hf};case"MEDIUM":return{Button:Xf};default:return{Button:ol}}})(e);return S(a,{onClick:n,stylists:[oy],children:[E(ha,{stylists:[iy],children:r}),E(Eo,{stylists:[ly],Component:ko})]})}const cy=Rt({base:{display:"flex",flexDirection:"row",padding:"15px",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",minWidth:"350px",borderRadius:"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"}}}}),dy={HIGH:Ot["banner-high"],MEDIUM:Ot["banner-medium"],LOW:Ot["banner-low"],URGENT:Ot["banner-urgent"]};function uy({task:e,handleClick:t}){const{name:n,description:r,shortDescription:a,type:o,priority:i}=e,l=th()?a:r,s=Wt(Ot.banner,dy[i],cy({priority:i}));return S("div",{...s,children:[E(ay,{title:n,description:l,type:o}),E(sy,{priority:i,type:o,handleClick:t})]})}function hy(e,t){od({message:{text:`Please help me with my ${e} bank issue: (code: ${t}). Thanks!`,attachments:[]}})}function py(e,t,n,r,a){return()=>td({title:e?.shortMessage(t??"your bank")||"Bank Error",body:e?.longMessage({apiInstitutionName:t??"your bank",apiPartnerName:n,isMobile:r}),buttons:a})}function gy(e,t,n,r,a,o){return{alert:py(e,t,a,o,[{key:Kc,label:"Cancel"},{key:ac.CHAT,label:"Chat",type:$c}]),actions:{[ac.CHAT]:()=>hy(t,r)}}}function my(e){const{mutateAsync:t}=Av(),n=In(),r=Rn(),{apiPartnerName:a}=v(rs),o=th(),{linkPlaid:i,loading:l,hasOnPlaidLinkOverride:s}=Sv(),{linkPlaid:c,loading:d}=Sv();if(xn(e))return gy(lc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN",0,"UNKNOWN","",!1);const u=lc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),h="ITEM_LOCKED"===e.apiErrorCode;switch(u.buttonType){case ac.DELETE_OR_RELINK:case ac.RELINK:return l?null:(g=i,m=a,b=o,{alert:py(u,(p=e).apiInstitutionName,m,b,[{key:Kc,label:"Cancel"},{key:_c,label:"Relink",type:$c}]),actions:{success:()=>{g({plaidEvent:pv,plaidItemId:p.id,apiAccessToken:p.apiAccessToken,apiErrorCode:p.apiErrorCode,message:"Relink Bank Error button pressed"})}}});case ac.UNLINK_RELINK:return d?null:function(e,t,n,r,a,o,i){return{alert:py(e,t.apiInstitutionName,a,o,[{key:Kc,label:"Cancel"},{key:ac.CHAT,label:"Chat"},{key:_c,label:"Unlink and Relink",type:$c}]),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"})},[ac.CHAT]:()=>hy(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,t,c,a,o,s);case ac.OPEN_BANK:return l?null:function(e,t,n,r,a,o,i,l){return{alert:py(e,t.apiInstitutionName,i,l,[{key:Kc,label:"Cancel"},{key:ac.CHAT,label:"Chat"},{key:ac.RELINK,label:"Relink"},{key:_c,label:"Go To Bank",type:$c}]),actions:{success:async()=>{const e=await Wc({institutionId:t.apiInstitutionId??void 0,accessToken:r,environment:a}),o=n?e.map.accountLockedUrl:e.map.accountSetupUrl;window.open(o,"_blank")},[ac.RELINK]:()=>{o({plaidEvent:pv,plaidItemId:t.id,apiAccessToken:t.apiAccessToken,apiErrorCode:t.apiErrorCode,message:"Relink button pressed from Bank Error alert"})},[ac.CHAT]:()=>hy(t.apiInstitutionName,t.apiErrorCode)}}}(u,e,h,n,r,i,a,o);case ac.UNLINK_ONLY:return function(e,t,n,r,a,o,i){return{alert:py(e,t.apiInstitutionName,a,o,[{key:Kc,label:"Cancel"},{key:_c,label:"Unlink",type:$c}]),actions:{success:()=>{i?r({plaidEvent:gv,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 gy(u,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,a,o)}var p,g,m,b}const vy=async({alert:e,actions:t})=>{const n=await e();if("string"==typeof n&&t[n])try{await t[n]()}catch(r){br({error:new Error("error while handling bank error alert action"),severity:"error",extraData:{error:r}})}};function by({task:e}){const{linkPlaid:t,loading:n}=Sv(),{loading:r}=Nv(),a=my(e?.meta?.plaidItem),o=n&&"RELINK"===e.type,i=r&&"LINK_BANK"===e.type&&!1,l="RELINK"!==e.type&&"LINK_BANK"!==e.type&&xn(a);return o||i||l?null:E(uy,{task:e,handleClick:()=>{"RELINK"===e.type?t({plaidEvent:pv,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?ki("NewConnection"):Tn(a)&&(vr("Plaid Banner Bank Error clicked",{plaidItem:e?.meta?.plaidItem}),vy(a))}})}const fy=Wt(Ot.banner,Ot["banner-default"],cy({priority:"DEFAULT"}));function yy(){const e=th()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return E("div",{...fy,children:E(ay,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const ky=Wt(Ot.banner,Ot["banner-default"],cy({priority:"DEFAULT"}));function xy(){const e=th()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return E("div",{...ky,children:E(ay,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const Ty=St({width:"100%",height:72,minWidth:"300px"});function Cy(){return S(I,{children:[E(Wa,{styles:Ty}),E(Wa,{styles:Ty}),E(Wa,{styles:Ty})]})}function wy({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:n,isFilling:r}){const a=e.length>0;return r?E(Cy,{}):a?e.map(e=>{if(void 0===po[e.type]||"ONBOARDING_FORM"===e.type&&xn(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(ac).includes(e.type))return E(by,{task:e},e.id);const n=e.actionLink,r=Tn(n)?()=>window.open(n,"_blank"):()=>t(e.type);return E(uy,{task:e,handleClick:r},e.id)}):E(n?xy:yy,{})}function Ay(){const e=dd({params:{filter:{status:{equal:"ACTIVE"}}},select:e=>({...e,hasActiveBankAccount:e?.data??!1})});return S(ll,{onClick:()=>{ki(e?"BanksAndIntegrations":"NewConnection")},children:[E(Eo,{Component:Sc}),E(Cl,{children:"Banks & Integrations"})]})}function Ey(){return Fc({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 Iy=Wt(Ot["business-owner-dashboard"],St({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),Sy=St({display:"flex",width:"100%",justifyContent:"center"}),Ny=e=>{const t=io[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},Py={status:{in:["ACTIVE","INACTIVE"]}},Dy={filter:{status:{in:["ACTIVE"]}}};function Ry({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 Go)??!1,n=(e.direction&&e.direction in Qo)??!1;return t&&n}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:o},isFilling:i,paginationControls:l}=$o({limit:10,sort:a,filter:so}),s=o?.data??uo,c=th(),{query:{data:d},isFilling:u}=(h={select:e=>((e,t)=>{const n=xn(r=e)||xn(r.data)?[]:[...r.data].sort((e,t)=>mo[e.priority]-mo[t.priority]);var r;return t?n.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):n})(e,c)},p=Dy,Mn({...h,queryKey:p?go(p):["tasks",{}],queryFn:vo}));var h,p;const{query:{data:m}}=dd({select:e=>{return{...e,plaidItemAccountsReadyToSync:Hp(e.data),hasPlaidLinkedBankAccount:(t=e.data,void 0!==t?.find(e=>wd(e.apiName)))};var t}}),{query:{data:v}}=Bc({select:e=>({...e,data:e?.data?.filter(({status:e,apiErrorType:t,apiErrorCode:n})=>"ACTIVE"===e&&t&&n)})}),b=th(),k=g(()=>{let e=[];const t=v?.data;t&&(e=t.map(e=>cc(e)));let n=[];!1===m?.hasPlaidLinkedBankAccount&&(n=[sc]);const r=d??[];return[...e,...n,...r]},[d,m,v]),x=function(){const{query:{data:e}}=Pi({filter:Py,limit:1});return(e?.data?.length??0)>0}(),T=function(e,t){const n=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&n}(x,m),C=/* @__PURE__ */new Date,w={month:C.getMonth(),year:C.getFullYear()};const[A,N]=Sl(w,e,t),P=(D=A.month,{beginDate:Zt((R=A.year)-1,D+1,1),endDate:Zt(R,D+1,0)});var D,R;return E("div",{className:Sy,children:S("div",{...Iy,children:[S(qt,{children:[E(Gt,{children:"Action Items"}),E(Ay,{})]}),E(ro,{children:E(wy,{taskBanners:k,handleScrollAction:Ny,isWaitingForPlaidItemAccountsSync:!x&&!0===m?.plaidItemAccountsReadyToSync,isFilling:u})}),!b&&S(I,{children:[E(ob,{period:A,handleDateChange:e=>{var t,n;(t=w).year===(n=e).year&&n.month>t.month||n.year>t.year||N(e)},todayPeriod:w,showSamples:T,showLinkAccountButton:T&&!m?.plaidItemAccountsReadyToSync}),E(qt,{children:E(Gt,{children:"Financial Summary"})}),E(rc,{isSample:T,period:A}),E(to,{filter:P,isSample:T})]}),E(Ps,{sortInstance:n,setSortInstance:r,conversations:s,paginationControls:l,isFilling:i,isMobile:b}),!b&&E(Qf,{})]})})}function My(e){return E(yr||I,{children:e.children})}function Oy({children:e}){return E(My,{children:E("div",{className:Ft(Ot.component),children:e})})}function Ly(e){return E(Oy,{children:E(Ry,{...e})})}function Fy(e){const t={...e,selectedValues:e=>e.filter(e=>e.modelKey===t.key),createFilter:e=>({...e,modelKey:t.key,id:Te()}),searchFunc:e.searchFunc?e.searchFunc:e=>{return n=e,t.name.toLowerCase().includes(n.toLowerCase());var n}};return t}function By(e,t){return e?{...e,...t}:t}function Uy(e){return Fy({key:"category",name:"Category",possibleValues:e})}function Vy(){const e="in";return{values:[...Xb].map(t=>({name:t.name,value:{reviewStatus:{name:t.name,value:{[e]:[t.value]}}}}))}}const Wy=({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}}}}))},Hy=u.object({amount:u.number({message:"Required"}),amountOperator:u.object({value:u.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:u.enum(["Equals","Does not equal","Greater than","Less than","Greater than or equal to","Less than or equal to"])})}),qy=Wt(null,St({display:"flex",flexDirection:"column",gap:"15px",marginInline:"40px",marginTop:"35px"})),jy=Wt(null,St({display:"flex",flexDirection:"row",gap:"16px",justifyContent:"right",marginBottom:"20px"}));function zy({children:e,title:t,onCancelClick:n,onSubmit:r}){return S("form",{onSubmit:e=>{e.preventDefault(),r()},...qy,children:[E(ha,{children:t}),e,S("div",{...jy,children:[E(Ym,{showIcon:!1,onClick:n}),E(Ld,{showIcon:!1,textContent:"Apply"})]})]})}function Ky({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{amount:null,amountOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Hy},onSubmit:n=>{if(null===n.value.amount)return;const r={displayInput:ia(n.value.amount,{cents:"always",dollarSign:!0,signage:"default"}),parsedInput:Np(n.value.amount),operator:n.value.amountOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Amount...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"amountOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),E(r.AppField,{name:"amount",children:e=>E(e.EditableAmountField,{label:"Total",autofocus:!0})})]})}const Yy=[{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"}],_y=u.object({date:u.string().refine(e=>""!==e,{message:"Required"}),dateOperator:u.object({value:u.enum(["equal","notEqual","greaterThan","lessThan","greaterThanEqual","lessThanEqual"]),label:u.enum(["On","Not on","After","Before","On or after","On or before"])})});function Gy({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{date:"",dateOperator:n||{value:"equal",label:"On"}}),validators:{onSubmit:_y},onSubmit:n=>{const r={displayInput:cn(hn(n.value.date)),parsedInput:n.value.date,operator:n.value.dateOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Date...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"dateOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:2,cols:3})}),E(r.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Date",autofocus:!0,editable:!0})})]})}const Qy=[{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"}],Zy=u.object({description:u.string().refine(e=>""!==e,{message:"Required"}),descriptionOperator:u.object({value:u.enum(["equal","notEqual","contain"]),label:u.enum(["Equals","Does not equal","Contains"])})});function Xy({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{description:"",descriptionOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:Zy},onSubmit:n=>{const r={displayInput:`"${n.value.description}"`,parsedInput:n.value.description,operator:n.value.descriptionOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Description...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"descriptionOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),E(r.AppField,{name:"description",children:e=>E(e.TextAreaInput,{label:"Description",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const Jy=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}];function $y(e){return Fy({key:"bankAccount",name:"Bank Account",possibleValues:e})}const ek=async e=>{const t=e.queryKey,n={path:"/clientMgmt/businesses",accessToken:t[2].accessToken,environment:t[2].environment},r=await Ko(n),a=void 0!==r.data?r.data.map(e=>({...e,id:Fi({id:e.id,prefix:"CLASS_SEGMENT"})})):[];return{...r,data:a}};function tk(e){return Fy({key:"classSegments",name:"Business",possibleValues:e})}function nk(e){return Fy({key:"customer",name:"Customer",possibleValues:e})}function rk(e){return Fy({key:"vendor",name:"Vendor",possibleValues:e})}const ak={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"},ok=[{name:"Expense",value:ak.EXPENSE},{name:"Income",value:ak.REVENUE},{name:"Bank Transfer",value:ak.BANK_TRANSFER},{name:"Tax Payment",value:ak.TAX_PAYMENT},{name:"Invoice Payment",value:ak.INVOICE_PAYMENT},{name:"Payout",value:ak.PAYOUT},{name:"Payroll Payment",value:ak.PAYROLL_PAYMENT},{name:"Bill Payment",value:ak.BILL_PAYMENT},{name:"Loan Payment",value:ak.LOAN_PAYMENT}];function ik(){return{values:[...ok].map(e=>function(e){const t="in";return{name:e.name,value:{type:{name:e.name,value:{[t]:[e.value]}}}}}(e))}}const lk={ACTIVE:"ACTIVE",INACTIVE:"INACTIVE",REMOVED:"REMOVED"},sk=[{name:"Active",value:lk.ACTIVE},{name:"Inactive",value:lk.INACTIVE},{name:"Removed",value:lk.REMOVED}],ck=e=>e.map(e=>({id:e.id,status:lk.INACTIVE}));function dk(){const e="in";return{values:[...sk].map(t=>({name:t.name,value:{status:{name:t.name,value:{[e]:[t.value]}}}}))}}const uk=u.object({notes:u.string().refine(e=>""!==e,{message:"Required"}),notesOperator:u.object({value:u.enum(["equal","notEqual","contain"]),label:u.enum(["Equals","Does not equal","Contains"])})});function hk({model:e,handleFilterClick:t}){const n=Dl(),r=function({model:e,handleFilterClick:t}){return jm({defaultValues:(n=e?.operators?.[0],{notes:"",notesOperator:n??{value:"equal",label:"Equals"}}),validators:{onSubmit:uk},onSubmit:n=>{const r={displayInput:`"${n.value.notes}"`,parsedInput:n.value.notes,operator:n.value.notesOperator,model:e,handleFilterClick:t};Wy(r)}});var n}({model:e,handleFilterClick:t});return S(zy,{title:"Notes...",onCancelClick:()=>n.setOpen(!1),onSubmit:r.handleSubmit,children:[E(r.AppField,{name:"notesOperator",children:t=>E(t.ButtonGrid,{options:e.operators,handleClick:t.handleChange,selected:t.state.value,rows:1,cols:3})}),E(r.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note",placeholder:"Search by keywords or phrases...",autofocus:!0,resizeable:!1})})]})}const pk=[{value:"equal",label:"Equals"},{value:"notEqual",label:"Does not equal"},{value:"contain",label:"Contains"}],gk=(mk={bankAccount:!0,vendor:!0,classSegments:!0,customer:!0,category:!0,glAccount:!0,rule:!0,matchingBankTransaction:!0,invoiceItem:!0,bill:!0,payroll:!0,conversation:!0},Object.keys(mk));var mk;function vk(e){return Fy({key:"glAccount",name:"GL Account",possibleValues:e})}function bk(){const{filters:e,addFilters:t,removeFilter:n}={filters:He(e=>e.transactionsDashFilters),addFilters:He(e=>e.addTransactionsDashFilters),removeFilter:He(e=>e.removeTransactionsDashFilter)},{getCategories:r,getBankAccounts:a,getClassSegments:o,getVendors:i,getCustomers:l,getGlAccounts:c}=function(){const e=function(){const{query:{data:e},isFilling:t}=mu(),n=e?.data,r=g(()=>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}=dd(),n=e?.data,r=g(()=>n?.map(e=>{const t=e?.name,n=e?.mask,r=ad(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}=Nm(),n=e?.data,r=g(()=>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}=bm(),n=e?.data,r=g(()=>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}=Mn({queryKey:["clientMgmt/businesses","classSegments"],queryFn:ek}),n=e?.data,r=g(()=>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])}();return{getCategories:e,getBankAccounts:t,getCustomers:n,getVendors:r,getClassSegments:a,getGlAccounts:function(){const{query:{data:e},isFilling:t}=$p(),n=g(()=>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])}()}}(),d=g(()=>({reviewStatus:Fy({key:"reviewStatus",name:"Review Status",possibleValues:Vy}),amount:Fy({key:"amount",name:"Amount",operators:Yy,ModalComponent:Ky}),bankAccount:$y(a),category:Uy(r),classSegments:tk(o),customer:nk(l),date:Fy({key:"date",name:"Date",operators:Qy,ModalComponent:Gy}),description:Fy({key:"description",name:"Description",operators:Jy,ModalComponent:Xy}),glAccount:vk(c),notes:Fy({key:"notes",name:"Notes",operators:pk,ModalComponent:hk}),status:Fy({key:"status",name:"Status",possibleValues:dk}),vendor:rk(i),type:Fy({key:"type",name:"Type",possibleValues:ik})}),[a,o,r,i,l,c]),u=g(()=>[d.reviewStatus,d.amount,d.bankAccount,d.category,d.classSegments,d.customer,d.date,d.description,d.glAccount,d.notes,d.status,d.type,d.vendor],[d.reviewStatus,d.amount,d.bankAccount,d.category,d.classSegments,d.customer,d.date,d.description,d.glAccount,d.notes,d.status,d.type,d.vendor]),h=g(()=>function(e){const t={...e};return gk.forEach(e=>{const n=t[e];t[e]=s(n)?{expand:!0}:{...n,expand:!0}}),t}(e.reduce(fk,{})),[e]),p=y(e=>d[e],[d]);return{filters:e,filterModels:u,addFilters:t,removeFilter:n,apiFilters:h,getModel:p}}function fk(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 By(e,t)}(e.category,r.category.value)),r.reviewStatus&&(n.reviewStatus=function(e,t){return e?{...e,...t}:t}(e.reviewStatus,r.reviewStatus.value)),r.bankAccount&&(n.bankAccount=function(e,t){return By(e,t)}(e.bankAccount,r.bankAccount.value)),r.classSegments&&(n.classSegments=function(e,t){return By(e,t)}(e.classSegments,r.classSegments.value)),r.glAccount&&(n.glAccount=function(e,t){return By(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.status&&(n.status=function(e,t){return e?{...e,...t}:t}(e.status,r.status.value)),r.vendor&&(n.vendor=function(e,t){return By(e,t)}(e.vendor,r.vendor.value)),r.customer&&(n.customer=function(e,t){return By(e,t)}(e.customer,r.customer.value)),r.notes&&(n.notes=r.notes.value),{...e,...n}}const yk=Wt(Ot["filter-search-bar"],St({display:"flex",flexDirection:"row",alignItems:"center",width:"100%",height:"100%",paddingLeft:"5px"})),kk=Wt(null,St({stroke:"icon.base",flexShrink:0,marginRight:"15px"})),xk=Wt(null,St({display:"flex",flex:"1 0 0",flexDirection:"column",justifyContent:"center",border:"none",outline:"none",background:"transparent",height:"100%",fontSize:"sm",fontWeight:"sm"}));function Tk({search:e,setSearch:t}){return S("div",{...yk,children:[E(Eo,{stylists:[kk],Component:Rh}),E("input",{...xk,value:e,onChange:e=>t(e.target.value),placeholder:"Filter and Search",onKeyDown:_d})]})}const Ck=St({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),wk=Wt(null,Ck);function Ak({children:e,clickHandler:t}){const n=Dl();return t||(t=()=>{n.setOpen(!1)}),E(he,{lockScroll:!0,...wk,onClick:t,children:e})}const Ek=Rt({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 Ik({width:e="lg",children:t}){const n=Wt(Ot["modal-popup"],Ek({width:e}));return E("div",{...n,onClick:e=>{e.stopPropagation()},children:t})}function Sk({model:e,handleFilterClick:t}){return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:t=>E(Tu,{...t,children:E(ha,{children:e.name})})}),E(rh,{children:E(Ak,{children:E(Ik,{children:e.ModalComponent&&E(e.ModalComponent,{model:e,handleFilterClick:t})})})})]})}function Nk({filterModels:e,addFilters:t}){const n=Dl(),r=e=>{t([e]),n.setOpen(!1)};return E(ql,{children:E(su,{children:e.map(e=>{const t=e.possibleValues?e.possibleValues():null;return xn(t)?E(Sk,{model:e,handleFilterClick:r},e.key):E(Pk,{model:e,handleFilterClick:r},e.key)})})})}function Pk({model:e,handleFilterClick:t}){if(void 0===e.possibleValues)return;const{values:n,isFilling:r}=e.possibleValues();return E(Fu,{triggerChildren:E(Uu,{icon:e.icon,displayLabel:e.name}),popupChildren:r?E(Eu,{}):E(Dk,{values:n,handleValueClick:n=>{const r=e.createFilter(n);t(r)}})},e.key)}function Dk({values:e,handleValueClick:t}){return E(su,{children:e.length>0?e.map(e=>E(Rk,{handleClick:()=>t(e),value:e},e.name)):E(wu,{text:"No data"})})}function Rk({value:e,handleClick:t}){return E(Tu,{onClick:t,children:E(ha,{children:e.name})})}const Mk=Wt(Ot["filter-bar"],St({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",cursor:"pointer"}));function Ok({filterModels:e,addFilters:t}){const[n,r]=f("");return E(I,{children:S(Pl,{modal:!1,placement:"bottom-start",children:[E(Rl,{children:e=>E("div",{...Mk,...e,children:E(Tk,{search:n,setSearch:r})})}),E(Nk,{filterModels:e,addFilters:t})]})})}const Lk=St({display:"flex",width:"14px",height:"14px",padding:"2px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"12px",borderRadius:"sm"}),Fk=Wt(Ot["filter-pill"],St({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"})),Bk=Wt(null,St({border:"none",background:"none",padding:0,cursor:"pointer"})),Uk=Wt(null,St({maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"}));function Vk({text:e,onClickRemove:t}){return S("div",{...Fk,children:[E("div",{...Uk,children:e}),E("button",{...Bk,onClick:t,children:E(Ol,{Component:Ml,stylists:[Wt(null,Lk)]})})]})}function Wk({filters:e,getModel:t,removeFilter:n}){return e.map((e,r)=>{const a=t(e.modelKey),o=`${a?.name}: ${e.name}`;return E(Vk,{text:o,onClickRemove:()=>{n(r)}},e.id)})}const Hk=Wt(Ot["dashboard-header"],St({display:"flex",flexDirection:"column",alignItems:"flex-start",paddingBottom:"20px",gap:"20px"})),qk=Wt(null,St({display:"flex",alignItems:"center",gap:"20px",padding:"15px 15px 0 15px",width:"100%"})),jk=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",gap:"12px",paddingLeft:"15px",paddingRight:"15px",width:"100%"}));function zk({filterModels:e,filters:t,addFilters:n,removeFilter:r,getModel:a}){return S("div",{...Hk,children:[S("div",{...qk,children:[E(Ok,{filterModels:e,addFilters:n}),E(Do,{})]}),E("div",{...jk,children:E(Wk,{filters:t,getModel:a,removeFilter:r})})]})}const Kk=ze.filter(e=>e!=je.COMMENTS),Yk=Wt(null,St({display:"flex",justifyContent:"center",alignItems:"center",padding:"16px"}));function _k(){return E("div",{...Yk,children:E(Do,{})})}function Gk(){return S(I,{children:[E(Nc,{Component:Eh}),E(ha,{wrap:"wrap",children:"No transactions found"}),E(ga,{wrap:"wrap",children:"Try a different set of filters."})]})}const Qk=m({resetSelected:void 0});function Zk({Icon:e,label:t,children:n,onClick:r}){return n?S(Pl,{placement:"bottom-start",children:[E(Rl,{children:n=>S(Zl,{popupTriggerProps:n,children:[e&&E(Nc,{Component:e}),E(Cl,{children:t})]})}),n]}):S(Zl,{onClick:r,children:[e&&E(Nc,{Component:e}),E(Cl,{children:t})]})}const Xk=fo(e=>h.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),h.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}),h.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),h.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete");function Jk({transactions:e,id:t,label:n}){const{mutate:r}=Wb(),a=Dl(),{resetSelected:o}=v(Qk);return t in Zb?E(Tu,{onClick:()=>(t=>{if(e.length>0){const n=((e,t)=>e.map(e=>({id:e.id,reviewStatus:t})))(e,t);r(n)}a.setOpen(!1),o&&o()})(t),children:n}):null}const $k=fo(e=>h.createElement("svg",{width:16,height:15,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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"}),h.createElement("path",{d:"M7.63599 3.36011V4.63392",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.createElement("path",{d:"M7.63599 8.45532V9.72913",stroke:"#182428",strokeMiterlimit:10,strokeLinecap:"square"}),h.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"),ex=[{id:"delete",label:"Delete",Icon:Xk,component:function({transactions:e,...t}){const{mutate:n}=Wb(),r=()=>{const t=ck(e);n(t)};return E(Zk,{...t,onClick:()=>{return t=e.length,n=r,void(t>0&&td({title:"Delete transactions",body:`Are you sure you want to delete ${t} transactions?`,buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Delete",type:ed}]}).then(e=>{e===Yc&&n()}));var t,n}})}},{id:"recategorize-expenses",label:"Recategorize",Icon:$k,filter:e=>"EXPENSE"===e.type,component:function({transactions:e,label:t,...n}){const{mutate:r}=Wb(),a=e.length;return a>0&&E(Zk,{label:`${t} ${nd("Expense","Expenses",a,!0)}`,...n,children:E(Hu,{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:$b,subActions:[{id:"USER_REVIEW_REQUIRED",label:"Needs Review",component:Jk},{id:"RECONCILIATION_DISCREPANCY",label:"Discrepancy",component:Jk},{id:"RECONCILED",label:"Reconciled",component:Jk}]},{id:"more",label:"More",Icon:Eh,subActions:[{id:"recategorize-revenue",component:function({transactions:e}){const t=Dl(),{mutate:n}=Wb(),{resetSelected:r}=v(Qk),a="Recategorize "+nd("Revenue","Revenues",e.length,!0);return E(Fu,{triggerChildren:E(Uu,{displayLabel:a}),popupChildren:E(fg,{onClick:function(a){var o,i;n((o=e,i=a.id,o.map(e=>({id:e.id,glAccountId:i})))),t.setOpen(!1),r&&r()},types:og})})},filter:e=>"REVENUE"===e.type}]}];function tx({subActionList:e}){return E(su,{children:e})}function nx({subActions:e,transactions:t,label:n,Icon:r}){const a=g(()=>e.map(e=>{const{component:n,id:r,filter:a,label:o}=e,i=t.filter(e=>!a||a(e));return i.length>0?E(n,{id:r,transactions:i,label:o},r):null}).filter(e=>null!==e),[e,t]);return E(Zk,{label:n,Icon:r,children:E(ql,{children:a.length>0?E(tx,{subActionList:a}):E(Tu,{children:E(ml,{children:"No Actions Available for Selection"})},"no-actions")})})}const rx=Wt(Ot["bulk-select"],St({display:"flex",gap:"15px",flexDirection:"row",alignItems:"center",height:"20px",justifyContent:"flex-start"}));function ax({table:e}){const t=e.getSelectedRowModel(),n=g(()=>t.rows.map(e=>e.original),[t]),r=t.rows.length,a=r>0,o=g(()=>({resetSelected:()=>e.resetRowSelection(!0)}),[e]);return S("div",{...rx,children:[E(kb,{checked:e.getIsAllRowsSelected(),onClick:e.getToggleAllRowsSelectedHandler()}),E(Qk.Provider,{value:o,children:a&&S(I,{children:[E(ha,{children:`${r} selected`}),ex.map(e=>{const{component:t,subActions:r,id:a,filter:o,...i}=e,l=n.filter(e=>!o||o(e));return r?E(nx,{subActions:r,transactions:n,...i},a):t&&E(t,{transactions:l,...i},a)})]})})]})}function ox({transactions:e,columns:t,filterState:n,hasLinkedBankAccount:r}){const a=function({transactions:e,columns:t}){const n=Of({transactions:e,columns:t?[je.SELECT,...t,je.EXPAND]:void 0});return function(e,t){const n=!xn(t.getColumn(qe.SELECT)),r=p(n?e:null);if(n){if(r.current!==e&&void 0!==r.current){const e=t.getSelectedRowModel().rows.map(e=>e.id).reduce((e,t)=>(e[t]=!0,e),{});t.setRowSelection(e)}r.current=e}}(e,n),n}({transactions:e,columns:t});let o;return r||0!==e?.length?"FILTERS_MATCHED_NONE"===n?o=E(Gk,{}):r&&0===e?.length&&(o=E(Yf,{})):o=E(zf,{}),S(ul,{dashboard:"transactionDashboard",children:[xn(o)&&E(ax,{table:a}),E(li,{headerGroups:a.getHeaderGroups()}),xn(o)?E(ci,{children:a.getRowModel().rows.map(e=>E(Uf,{rowData:e},e.id))}):E(ks,{children:o})]})}function ix({limit:e=10,columns:t=Kk}){const{sortInstance:n,setSortInstance:r,apiSort:a}=gb(),{filters:o,filterModels:i,addFilters:l,removeFilter:s,apiFilters:c,getModel:d}=bk(),u={limit:e,sort:a,filter:{...c}},{isFilling:h,paginationControls:p,query:{data:g,isError:m,error:v}}=Pi(u),b=g?.data,{hasPlaidLinkedBankAccount:f}=qp(),y=f??!1;if(m)return E("div",{children:`Error: ${v?.message}`});if(h)return E(Bo,{});if(void 0!==b){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,b.length);return E(I,{children:S(Ao.Provider,{value:p,children:[E(zk,{filterModels:i,addFilters:l,filters:o,removeFilter:s,getModel:d}),E(hl.Provider,{value:{sortInstance:n,setSortInstance:r},children:E(ox,{hasLinkedBankAccount:y,filterState:e,transactions:b,columns:t})}),E(_k,{})]})})}return"zero state"}const lx=e=>E(Oy,{children:E(ix,{...e})}),sx=Rt({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function cx({width:e,children:t}){return E("div",{className:sx({width:e}),children:t})}function dx({options:e,handleClick:t,selected:n}){return E(cx,{width:"full",children:e.map(e=>E(jg,{option:e,handleClick:t,selected:n,width:"full",backgroundColor:"foreground"},e.value))})}const ux=St({display:"flex",flexDirection:"column",padding:"15px"});function hx({task:e}){return E("div",{className:ux,children:E(by,{task:e})})}const px=St({padding:"20px 15px 14px 15px",backgroundColor:"surface.foreground"}),gx=St({padding:"15px",borderBottom:"{borderWidths.md} solid {colors.border.layout.weak}",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",gap:"5px"}),mx=St({width:"120px",height:"20px"}),vx=St({width:"80px",height:"12px"}),bx=St({width:"150px",height:"16px"}),fx=St({display:"flex",flexDirection:"column",gap:"15px",marginTop:"15px"}),yx=St({userSelect:"none",cursor:"pointer"});function kx(){return S("div",{className:fx,children:[S("div",{className:yx,children:[E(ui,{alignment:"horizontal",color:"strong"}),E("div",{className:px,children:E(Wa,{styles:mx})}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]}),E(ui,{alignment:"horizontal",color:"strong"})]}),S("div",{className:yx,children:[E(ui,{alignment:"horizontal",color:"strong"}),E("div",{className:px,children:E(Wa,{styles:mx})}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]}),S("div",{className:gx,children:[E(Wa,{styles:vx}),E(Wa,{styles:bx})]})]})]})}function xx({children:e}){return S(Pl,{placement:"bottom-start",children:[E(Rl,{children:e=>E(Zl,{popupTriggerProps:e,children:E(Eo,{Component:Eh})})}),E(ql,{children:e})]})}const Tx=fo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.createElement("path",{d:"M14.075 2.10645H0.924988V5.09395H14.075V2.10645Z",strokeMiterlimit:10}),h.createElement("path",{d:"M14.075 5.09375H0.924988V14.0625H14.075V5.09375Z",strokeMiterlimit:10}),h.createElement("path",{d:"M3.3125 8.08105H4.5125",strokeMiterlimit:10}),h.createElement("path",{d:"M5.70624 8.08105H6.89999",strokeMiterlimit:10}),h.createElement("path",{d:"M8.10004 8.08105H9.29379",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4875 8.08105H11.6875",strokeMiterlimit:10}),h.createElement("path",{d:"M10.4875 11.0752H11.6875",strokeMiterlimit:10}),h.createElement("path",{d:"M3.3125 11.0752H4.5125",strokeMiterlimit:10}),h.createElement("path",{d:"M5.70624 11.0752H6.89999",strokeMiterlimit:10}),h.createElement("path",{d:"M8.10004 11.0752H9.29379",strokeMiterlimit:10}),h.createElement("path",{d:"M3.91254 0.3125V3.3",strokeMiterlimit:10}),h.createElement("path",{d:"M7.5 0.3125V3.3",strokeMiterlimit:10}),h.createElement("path",{d:"M11.0875 0.3125V3.3",strokeMiterlimit:10})),"Date"),Cx=St({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),wx=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),Ax=St({display:"flex",flexDirection:"column",gap:"12px"}),Ex=St({display:"flex",flexDirection:"row",gap:"10px"}),Ix=St({display:"flex",flexDirection:"column",gap:"10px"}),Sx=({acknowledged:e,setAcknowledged:t})=>S("div",{className:Ax,children:[E(ml,{wrap:"wrap",children:"The selected start date is after the existing start date. Transactions before the new start date will be hidden."}),S("div",{className:Ex,children:[E(fb,{checked:e,onClick:()=>t(!e)}),E(ml,{wrap:"wrap",children:"I understand."})]})]});function Nx({bankAccounts:e}){const{apiPartnerName:t}=v(rs),n=e.reduce((e,t)=>{const n=hn(t.tranStartDate||""),r=hn(e.tranStartDate||"");return n&&r&&sn(n,r)?t:e}).tranStartDate||"",r=((e,t)=>{const{mutate:n}=Td();return jm({defaultValues:{tranStartDate:t},onSubmit:t=>{var r,a;td({title:"Start Date Updated",body:S("div",{className:Ix,children:[E(ml,{wrap:"wrap",children:"Your start dates have been updated and your transactions are being removed in the background."}),E(ml,{wrap:"wrap",children:"This process may take a few minutes to complete, but you may close this alert."})]}),buttons:[{label:"Done",key:_c,type:$c}]}),n((r=e,a=t.value.tranStartDate,r.map(e=>({id:Bi(e.id),tranStartDate:a,duplicateBankAccountIds:[]}))))}})})(e,n),a=Dl(),o=()=>{a.setOpen(!1)},[i,l]=f(!1),{query:{data:s}}=Bc(),c=s?.data?.find(t=>t.id===(e[0]?.integration.id??""))?.apiInstitutionName||"bank",d=hn(e.reduce((e,t)=>{const n=hn(t.tranMinStartDate||""),r=hn(e.tranMinStartDate||"");return n&&r&&sn(n,r)?t:e}).tranMinStartDate||""),u=1===e.length?`${t} can pull your transactions for your ${ad(e[0]?.name,e[0]?.mask)} account dating back to ${fn(d)}.`:`${t} can pull your transactions for your ${c} account(s) dating back to ${fn(d)}.`;return S("form",{className:Cx,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit(),a.setOpen(!1)},children:[E(ha,{children:"Set Bank Transaction Start Date"}),E(ml,{wrap:"wrap",children:u}),E(ml,{wrap:"wrap",children:"What date would you like to start pulling transactions back to?"}),E(r.AppField,{name:"tranStartDate",children:e=>E(e.DateInput,{label:"Start Date",maxDate:/* @__PURE__ */new Date,minDate:d,editable:!0})}),E(r.Subscribe,{selector:e=>e,children:e=>{const t=hn(e.values.tranStartDate||""),r=hn(n),a=t&&r&&sn(t,r);return S(I,{children:[e.isDirty&&a&&E(Sx,{acknowledged:i,setAcknowledged:l}),S("div",{className:wx,children:[E(Ym,{showIcon:!1,onClick:o}),E(Ld,{showIcon:!1,textContent:"Confirm",disabled:!!a&&!i})]})]})}})]})}function Px({bankAccounts:e}){return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:e=>S(Tu,{...e,children:[E(Nc,{Component:Tx}),E(ha,{children:"Set Start Date"})]})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(Nx,{bankAccounts:e})})})})]})}const Dx=fo(e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},h.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}),h.createElement("path",{d:"M2.88599 12.625L12.6672 2.84375"})),"Stop"),Rx=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.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}),h.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),h.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),h.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Combine"),Mx=St({display:"flex",flexDirection:"column",gap:"16px"});function Ox({integration:e,accounts:t}){const{mutate:n}=Av(),r=Dl(),{linkPlaid:a,loading:o,hasOnPlaidLinkOverride:i}=Sv(),{query:{data:l}}=(s=e.id,Fc({},{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}}=Kp(e.id),u=d?.data,h="PLAID"===e.apiName,p="UNIT"===e.apiName;return S(su,{children:[h&&!o&&S(Tu,{onClick:()=>(a({plaidEvent:pv,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Add Account button pressed"}),void r?.setOpen(!1)),children:[E(Nc,{Component:Gi}),E(ha,{children:"Add Account"})]}),h&&u&&E(Px,{bankAccounts:u}),t.length>0&&S(Tu,{onClick:()=>iv({plaidItemAccounts:t}),children:[E(Nc,{Component:Rx}),E(ha,{children:"Merge Accounts"})]}),!p&&S(Tu,{onClick:()=>(async()=>{const t=await(async e=>td({title:"Remove Institution",body:E("div",{className:Mx,children:E(ml,{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:Kc,label:"Cancel"},{key:Yc,label:"Remove",type:ed}]}))(e.apiInstitutionName);var o;r?.setOpen(!1),t===Yc&&(h&&i?a({plaidEvent:gv,plaidItemId:e.id,apiAccessToken:c?.apiAccessToken,apiErrorCode:c?.apiErrorCode,message:"Remove Institution confirmed in alert"}):(o=e.id,n({id:o})))})(),children:[E(Nc,{Component:Dx}),E(ha,{children:"Remove Institution"})]})]})}const Lx=Rt({base:{userSelect:"none"},variants:{expandable:{true:{cursor:"pointer"}}}});function Fx({children:e,onClick:t,expandable:n=!1}){return S("div",{onClick:t,className:Lx({expandable:n}),children:[E(ui,{alignment:"horizontal",color:"strong"}),e]})}const Bx=St({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"20px",paddingBottom:"14px",paddingLeft:"15px",paddingRight:"15px",backgroundColor:"surface.foreground"});function Ux({children:e}){return E("div",{className:Bx,children:e})}function Vx({plaidItem:e}){const t=my(e);return S(vf,{type:"critical",onClick:n=>{n.stopPropagation(),t&&(vr(`Plaid Bank Error Badge clicked for item ${e.id}`,{plaidItem:e}),vy(t))},disabled:xn(t),children:[E(Nc,{Component:Fd}),E(ga,{children:"Fix Bank Error"}),E(Eo,{Component:ko})]})}const Wx=Rt({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"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"}}}}});function Hx({bankAccountId:e,name:t,mask:n,syncText:r,active:a}){const o=Pt(Wx({active:a}),To);return S("button",{className:o,onClick:t=>{t.stopPropagation(),ki("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!a,children:[E(Xg,{accountName:t,accountNo:n,syncText:r,active:a}),a&&E(Nc,{Component:ko})]})}const qx={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 jx(e){const{apiPartnerName:t,unitIntegrationBankName:n}=v(rs);return"UNIT"===e?n??t??"Unit":qx[e]||e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}const zx=St({overflow:"hidden"}),Kx=e=>{let t;return t=e.isSupported?e.lastSyncedDate?`Last synced ${bn(e.lastSyncedDate)}`:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function Yx({integration:e,itemIndex:t,numIntegrations:n}){const{query:{data:r}}=Kp(e.id),a=r?.data,o=1===n,{expanded:i,toggleExpanded:l}=function(e,t){const n=He(e=>e.toggleExpandedIntegration),r=He(e=>e.expandedPlaidItems);return{toggleExpanded:n,expanded:He(e=>e.hasExpandedUpdated)?r.includes(e):t}}(e.id,o),s="PLAID"===e.apiName,c=$g(s?e.apiInstitutionId??void 0:void 0),d=jx(e.apiName);if(u=a,!(Array.isArray(u)&&u.length>0))return null;var u;const h=t===n-1;return S(Fx,{onClick:()=>l(e.id,o),expandable:!0,children:[S(Ux,{children:[S(oh,{children:[c?E("img",{src:c,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):E(xs,{Component:Ku}),E(ha,{children:e.apiInstitutionName??d}),E("div",{onClick:e=>e.stopPropagation(),children:E(xx,{children:E(Ox,{integration:e,accounts:a})})})]}),S(oh,{children:[s&&Tn(e.apiErrorCode)&&E(Vx,{plaidItem:e}),E(Zl,{active:!1,children:E(Eo,{Component:i?Tf:Yh})})]})]}),i&&E("div",{className:zx,children:a.map(e=>E(Hx,{bankAccountId:e.id,mask:e.mask,name:e.name,syncText:Kx(e),active:e.isSupported},e.id))}),!h&&E(ui,{alignment:"horizontal",color:"strong"})]})}const _x=St({objectFit:"contain"});function Gx(e,t,n){const r=({size:n=24})=>E("img",{src:e,alt:t,width:n,height:n,style:{minHeight:n,minWidth:n},className:_x});return r.displayName=t,r}const Qx=Gx("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAGttJREFUeAHFnFuMXVd5x9c5c/GMZxxf4sTxNfcmJDSQFGhSkGhRCFChSqWIoqqtkJoXitQHXoqqVkKVWlFVQuIBIdo8oD4g1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AfF0jBgYGDg2jHjM45sx0S6gxa11QKgAxhlYvHTUMjg4KHgNtnb17djaA0iD9Pr16yNjhJZjMxx77kH6JoyVXVhR4bY0NDTY2a30Lc++FqQHVV5eLvCYdVowIVhaWqo3yO59ZwABVnx8vGhubhYYzdotmIbGk4q9CnYD2Z+fc4C0FpWdnS2ampoE+5Esc8K0N8DwBOZ+Qxw5dvUfh1ihUVBQ4PszC/w7vIwm6DQ0HGVw0/ISY3r58iXxcIIw+eiWuApIbxT8Qpgrx1+iMOMJZ5g2b6X/OxT+CgVPoIqzS1+e6v6RAVKtsNt6Sv4gtyt5lOV5gILQ9wCZACTv6g+S6Qk6vY4W9O4EGWS3Ke8AqN/uXE9Qfv14zHufxzn8ivo+j6OdesI7jgzVf+N8wWRPvE90+TeQA5/oAilAAjWssDytrQm2g4Hf98v42E9wT8In87zPBDKEn02Y0wmZAdg6AAAAAElFTkSuQmCC","Uber")};function tT(e){return eT[e]??Ku}const nT=Rt({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"border.layout.weak",backgroundColor:"surface.foreground",display:"flex",flexDirection:"column",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"start",gap:"5px"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}}),rT=St({display:"flex",flexDirection:"column",gap:"16px"}),aT=({integration:e})=>{const{mutate:t}=Av(),n=Dl(),r=jx(e.apiName);return E(su,{children:S(Tu,{onClick:()=>(async()=>{const a=await(async e=>td({title:"Remove Institution",body:E("div",{className:rT,children:E(ml,{wrap:"wrap",children:`Would you like to unlink ${e} altogether?`})}),buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Remove",type:ed}]}))(r);n?.setOpen(!1),a===Yc&&t({id:String(e.id)})})(),children:[E(Nc,{Component:Dx}),E(ha,{children:"Remove Institution"})]})})};function oT({integration:e,isLastItem:t}){const n=jx(e.apiName),r=function(e){if(e)return`Last synced ${bn(e)}`}(e.lastSyncedDate),a=tT(e.apiName),o=Pt(nT({active:!1}),To);return S(Fx,{children:[E(Ux,{children:S(oh,{children:[E(xs,{Component:a}),E(ha,{children:n}),E(xx,{children:E(aT,{integration:e})})]})}),S("div",{className:o,children:[r&&E(ga,{intent:"normal",children:r}),E(ha,{wrap:"wrap",children:n}),e.apiUsername&&E(ha,{wrap:"wrap",children:e.apiUsername})]}),!t&&E(ui,{alignment:"horizontal",color:"strong"})]})}const iT=St({overflow:"hidden"});function lT({manualBankAccounts:e}){return S(Fx,{children:[E(Ux,{children:E(oh,{children:E(ha,{children:"Manually Tracked Accounts"})})}),E("div",{className:iT,children:e.map(e=>E(Hx,{bankAccountId:e.id,name:e.name,mask:e.mask,active:"ACTIVE"===e.status},e.id))})]})}const sT=Pt(St($i,{minWidth:"100%",justifyContent:"start",paddingBlock:"10px",marginBottom:"5px"}),xo),cT=St({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),dT=St({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",marginInline:"15px"});function uT(){const{linkPlaid:e,loading:t}=Nv();return E("button",{className:sT,disabled:t,onClick:()=>{vr("Add New Connection button pressed"),e({plaidEvent:hv,message:"Add New Connection button pressed"})},children:S("div",{className:cT,children:[E(Nc,{Component:Rh}),S("div",{className:dT,children:[E(ha,{children:"Connect your bank"}),E(ga,{children:"Find your banking institution with Plaid"})]}),E(Nc,{Component:ko})]})})}const hT=St({marginBottom:"20px"}),pT=St({display:"flex",marginBlock:"20px",flexDirection:"column",gap:"15px"});function gT({title:e,children:t}){return S("div",{className:hT,children:[E(ga,{children:e}),E("div",{className:pT,children:t}),E(ui,{alignment:"horizontal"})]})}const mT=St({padding:"10px 8px",minWidth:"100%",height:"45px"}),vT=St({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function bT({bank:e}){const t=$g(e.institutionName);return E("div",{className:mT,children:S("div",{className:vT,children:[t?E("img",{src:t,alt:`${e.displayName} logo`,width:"25px",height:"25px"}):E(xs,{Component:Ku}),E(ha,{children:e.displayName})]})})}const fT=St({minWidth:"100%",height:"45px"});function yT(){return S(I,{children:[E(Wa,{styles:fT}),E(Wa,{styles:fT}),E(Wa,{styles:fT})]})}const kT=Pt(St($i,{minWidth:"100%",padding:"10px"}),xo),xT=St({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),TT=St({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),CT=St({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function wT({integration:e}){const{linkPlaid:t,loading:n}=Sv(),r=$g(e.apiInstitutionId??void 0),a="PLAID"===e.apiName,o=tT(e.apiName),i=jx(e.apiName);return E("button",{className:kT,disabled:n||!a,onClick:()=>{vr(`Relink button pressed for plaid item ${e.id}`,{integration:e}),t({plaidEvent:pv,plaidItemId:e.id,apiAccessToken:e.apiAccessToken,apiErrorCode:e.apiErrorCode,message:"Already Connected Plaid Institution button pressed"})},children:S("span",{className:xT,children:[S("div",{className:TT,children:[r?E("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):E(xs,{Component:o}),E(ha,{children:e.apiInstitutionName??i??void 0})]}),a&&S("div",{className:CT,children:[E(Eo,{Component:Sc}),E(ml,{children:"Relink"})]})]})})}const AT=e=>h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:224,height:64,viewBox:"0 0 224 64",...e},h.createElement("g",{fill:"none",fillRule:"nonzero"},h.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"}),h.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"}),h.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"}),h.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"}),h.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"}))),ET=Pt(St($i,{minWidth:"100%",justifyContent:"space-between",paddingBlock:"10px",marginBottom:"5px"}),xo),IT=St({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"}),ST=St({display:"flex",flexDirection:"column",gap:"12px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),NT=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),PT=St({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"}}),DT=St({display:"flex",justifyContent:"center",alignItems:"center",width:"100%"});function RT(){const e=Dl(),{mutateAsync:t}=xv(),[n,r]=f("");return S("div",{className:ST,children:[E(ha,{children:"Enter your shop name"}),E("div",{className:DT,children:E(AT,{})}),E(ml,{children:"Please enter the name of your shop below."}),E("input",{className:PT,value:n,onChange:e=>r(e.target.value),placeholder:"Enter shop name"}),S("div",{className:NT,children:[E(Ym,{showIcon:!1,onClick:()=>{e.setOpen(!1)}}),E(zc,{onClick:async()=>{const r=await t({apiName:"SHOPIFY",apiUserId:n});window.open(r.url),e.setOpen(!1)},children:E(ha,{children:"Connect"})})]})]})}function MT(){const e=tT("SHOPIFY")??Sc;return S(Pl,{placement:"bottom",modal:!0,children:[E(Rl,{children:t=>S("button",{className:ET,...t,children:[S("div",{className:IT,children:[E(xs,{Component:e}),E(ha,{children:"Shopify"})]}),E(Nc,{Component:ko})]})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(RT,{})})})})]})}const OT=Pt(St($i,{minWidth:"100%",justifyContent:"space-between",paddingBlock:"10px",marginBottom:"5px"}),xo),LT=St({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function FT({apiName:e}){const{mutateAsync:t}=xv(),n=jx(e);if("SHOPIFY"===e)return E(MT,{});const r=tT(e)??Sc;return S("button",{className:OT,onClick:async()=>{const n=await t({apiName:e});window.open(n.url)},children:[S("div",{className:LT,children:[E(xs,{Component:r}),E(ha,{children:n})]}),E(Nc,{Component:ko})]})}const BT=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE","UBER"];function UT(e){return BT.includes(e)}const VT=["FRESHBOOKS","GUSTO","SHOPIFY","SQUARE","STRIPE"],WT=St({margin:"15px"}),HT=St({overflowY:"auto"});function qT({connectedBankNames:e=/* @__PURE__ */new Set}){const{query:{data:t},isFilling:n}=Ey(),r=t?.multiAccountIntegrations,a=t?.integrations,o=Tn(r)&&r.length>0||Tn(a)&&a.length>0,i=Vc.filter(t=>!e.has(t.displayName)),l=function({connectedIntegrations:e}){const t=v(rs),n=He(e=>e.externalOptions.banksAndIntegrations?.integrations),r=n?.filter(UT),a=e?.map(e=>e.apiName)||[];let o=r??VT;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:a});return E("div",{className:HT,children:S("div",{className:WT,children:[(n||o)&&E(gT,{title:"Already Connected",children:n?E(yT,{}):S(I,{children:[r?.map(e=>E(wT,{integration:e},e.id)),a?.map(e=>E(wT,{integration:e},e.id))]})}),S(gT,{title:"Banks",children:[E(uT,{}),i.length>0&&S(I,{children:[E("div",{className:St({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"}),children:i.map(e=>E(bT,{bank:e},e.institutionName))}),E(ha,{children:"...and 12,000+"})]})]}),l&&l.length>0&&E(gT,{title:"Integrations",children:E("div",{className:St({display:"flex",flexDirection:"column",gap:"8px"}),children:l.map(e=>E(FT,{apiName:e},e))})})]})})}const jT=St({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"15px",padding:"40px 20px",backgroundColor:"surface.foreground",borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"});function zT({showPlaidItems:e,showNewConnectionContent:t,multiAccountIntegrations:n,integrations:r,numIntegrations:a,manualBankAccounts:o}){return t?E(qT,{}):e?S(I,{children:[n?.map((e,t)=>E(Yx,{integration:e,itemIndex:t,numIntegrations:a},e.id)),r?.map((e,t)=>E(oT,{integration:e,isLastItem:t===r.length-1},e.id))]}):o&&o.length>0?E(lT,{manualBankAccounts:o}):S("div",{className:jT,children:[E(xs,{Component:Ku}),E(ha,{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 KT=Rt({base:{display:"flex",flexDirection:"column",gap:"15px"},variants:{hideManualBanks:{true:{marginTop:"0px"},false:{marginTop:"15px"}}}}),YT=Rt({base:{overflowY:"auto"},variants:{height:{fill:{height:"100%"}},background:{foreground:{backgroundColor:"surface.foreground"}}}}),_T=Rt({base:{paddingTop:"20px",paddingBottom:"20px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0,backgroundColor:"surface.background"},variants:{hasPlaidItems:{true:{borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}}}}),GT=[{label:"Connected Accounts",value:"connected"},{label:"Manually Tracked Banks",value:"manual"}];function QT({showCloseButton:e=!1,onPlaidLink:t,hideManualBanks:n}){Sv();const{query:{data:r},isFilling:a}=Ey(),o=r?.multiAccountIntegrations,i=r?.integrations,{query:{data:l}}=dd({select:e=>{return{...e,plaidItemAccounts:(t=e?.data,t?.filter(e=>wd(e.apiName)&&("ACTIVE"===e.status||"INACTIVE"===e.status||!1===e.isSupported))),manualAccounts:jp(e?.data)};var t}}),{mutate:s}=Cv(),c=l?l.manualAccounts:null,d=o&&i?o.length+i.length:0,u=o?.find(e=>e.apiErrorCode),h=u&&cc(u,!1),p=He(e=>e.externalOptions.banksAndIntegrations),g=p?.integrations,m=n??(void 0!==g&&!g.includes("MANUAL_ENTRY")),v=He(e=>e.banksAndIntegrationsSelectedTab),b=He(e=>e.setBanksAndIntegrationsSelectedTab),f=m||"connected"===v.value,y=0===d&&f,k=f?"Add New Connection":"Add New Account";return E(bv,{onPlaidLink:t,children:S(I,{children:[E(lh,{hideDivider:m,children:S(oh,{children:[e&&E(dh,{}),E(ha,{children:"Banks & Integrations"}),E(Zl,{onClick:()=>s(),active:!1,children:E(Nc,{Component:Sc})})]})}),h&&E(hx,{task:h}),!m&&E(dx,{options:GT,handleClick:e=>b(e),selected:v}),a?E(kx,{}):S(I,{children:[E("div",{className:YT({height:y?"fill":void 0,background:y?"foreground":void 0}),children:E("div",{className:KT({hideManualBanks:m}),children:E(zT,{showPlaidItems:f,showNewConnectionContent:y,multiAccountIntegrations:o,integrations:i,numIntegrations:d,manualBankAccounts:c})})}),!(f&&y)&&E("div",{className:_T({hasPlaidItems:d>0}),children:S(gd,{onClick:()=>{ki(f?"NewConnection":"BankAccountForm")},disabled:f&&!1,children:[E(Nc,{Component:Gi}),E(ha,{children:k})]})})]})]})})}function ZT({onPlaidLink:e,hideManualBanks:t}){return E(Oy,{children:E(QT,{showCloseButton:!1,onPlaidLink:e,hideManualBanks:t})})}const XT=Ce("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),JT={queryClient:Pn,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await XT).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await XT).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await XT).delete("queryClient",e)}(e)}}}(),maxAge:Nn,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function $T({children:e}){return E(we,{client:Pn,persistOptions:JT,children:e})}const eC=St({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"}),tC=St({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"}),nC=Wt(null,Ot.component,tC);function rC({children:e}){const t=p(null),n=p(null);return S(he,{lockScroll:!0,children:[E("div",{className:eC}),E("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,He.getState().requestCloseAllDrawers())},ref:t,...nC,children:e})]})}const aC=m({drawerHistory:[]});function oC({children:e}){const t=He(e=>e.drawerHistory),n=g(()=>({drawerHistory:t}),[t]),r=t.length>0;return E(aC.Provider,{value:n,children:r&&E(rC,{children:e})})}const iC=m({isActive:!0,isInHistory:!0});function lC({Component:e,name:t}){const{drawerHistory:n}=v(aC),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]?E(iC.Provider,{value:{isActive:o,isInHistory:i},children:E(e,{...a[t].routeProps})}):void 0}const sC=Rt({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 cC({children:e}){const t=p(null),{isActive:n,isInHistory:r}=v(iC),{animationState:a,handleAnimationEnd:o,shouldDisplay:i}=function({isActive:e,isInHistory:t,focusRef:n}){const r=p(!1),a=p(!1),[o,i]=f("none"),l=He(e=>e.closingDrawerCount),s=l>0,c=e&&s,d=e||s||t;w(()=>{e&&t&&!a.current&&!s&&i("opening"),r.current=e,a.current=t},[e,t,s]),w(()=>{c&&"closing"!==o&&i("closing")},[c,o]);const u=y(e=>{("slide-out-right"===e.animationName||"slide-out-down"===e.animationName)&&(l>1?He.getState().confirmCloseAllDrawers():He.getState().confirmCloseDrawer()),i("none")},[l]);return k(()=>{e&&!s&&n.current?.focus()},[e,s,n]),{animationState:o,handleAnimationEnd:u,shouldDisplay:d}}({isActive:n,isInHistory:r,focusRef:t});return E("div",{ref:t,tabIndex:-1,className:sC({shouldDisplay:i,animationVariant:/* @__PURE__ */function(e){return"none"===e?"none":"opening"===e?"slideInRight":"slideOutRight"}(a)}),onAnimationEnd:o,children:e})}const dC=Wt(null,St({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 uC({children:e}){return E("div",{tabIndex:-1,...dC,children:e})}const hC=Rt({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 pC({background:e,children:t}){return E("div",{className:hC({background:e}),children:t})}const gC=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function mC(e){return void 0!==gC[e]}function vC(e){return gC[e]}const bC=fo(e=>h.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},h.createElement("defs",null,h.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),h.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"}),h.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),fC=St({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function yC({cldrShortName:e}){return E("div",{className:fC,children:vC(e)})}const kC=Rt({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),xC=St({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 TC({reactions:e,type:t,handleClick:n}){return E("div",{className:xC,children:e.map((e,r)=>E("button",{className:kC({type:t}),onClick:"received"===t?()=>n(e.emojiCode):void 0,children:E(yC,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${r}`))})}const CC=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:ho(n)};return await Ir(o)},wC=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:ho(n)};return await async function(e){return yv(e)}(o)};function AC(e,t,n){return yn(Ui({id:e}),t,n)}async function EC(e){const t=Ui({id:e});return vr("mutation successful, invalidating messages queries"),Pn.invalidateQueries({queryKey:t}).catch(e=>br({error:e,severity:"error"}))}function IC(e,t,n){const r=[...e];return r[n]=t,r}const SC=St({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),NC=Object.keys(gC).filter(mC).map(e=>({emojiCode:e,authorInfo:[]}));function PC({conversationId:e,messageId:t,type:n,reactions:r,reactionIsOpen:a,setReactionIsOpen:o}){const{userId:i}=v(rs),{mutate:l}=function(e){const{userId:t,userEmail:n}=v(rs);return md({mutationFn:CC,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=AC(n,t,r);await Pn.cancelQueries({queryKey:i});const l=Pn.getQueryData(i);return Pn.setQueryData(i,t=>{const n=t.findIndex(t=>t.id===e.id);return-1===n?t:IC(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:()=>EC(e)})}(e);return S(Pl,{placement:"top-end",open:a,onOpenChange:o,blockInteraction:!0,children:[E(Rl,{children:e=>E("button",{className:SC,...e,children:E(Nc,{Component:bC})})}),E(ql,{type:"reaction",children:E(TC,{reactions:NC,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 DC=Rt({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function RC({reactions:e,type:t,handleClick:n}){const r=DC({type:t});return E("div",{className:r,children:E(TC,{reactions:e,handleClick:n,type:t})})}const MC=Rt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),OC=Rt({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"}}}}),LC=St({position:"relative",display:"flex",flexDirection:"column"});function FC({conversationId:e,messageId:t,sentByCurrentUser:n,children:r,reactions:a=[]}){const o=p(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,n]=f(!1),[r,a]=f(!1);return k(()=>{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}=v(rs);return md({mutationFn:wC,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=AC(n,t,r);await Pn.cancelQueries({queryKey:o});const i=Pn.getQueryData(o);return Pn.setQueryData(o,t=>{const n=t.findIndex(t=>t.id===e.id),r=t[n];return xn(r)||0===r.reactions.length?t:IC(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:()=>EC(e)})}(e),u=n?"sent":"received",h=a.filter(e=>mC(e.emojiCode)),g=h.length>0;return S("div",{className:MC({type:u,hasReactionsOnMessage:g}),ref:o,onMouseEnter:()=>"received"===u&&l(!0),children:[S("div",{className:LC,children:[E("div",{className:OC({type:u}),children:r}),g&&E(RC,{reactions:h,type:u,handleClick:e=>d({id:t,emojiCode:e})})]}),i&&E(PC,{conversationId:e,messageId:t,type:u,reactions:h,reactionIsOpen:s,setReactionIsOpen:c})]})}const BC=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("path",{d:"M14.1641 9.87903V14.125H0.835876V9.87903",strokeMiterlimit:10}),h.createElement("path",{d:"M7.49988 10.4883V0.1875",strokeMiterlimit:10}),h.createElement("path",{d:"M11.7395 6.85162L7.4999 11.0913L3.26025 6.85162",strokeMiterlimit:10})),"Download"),UC=Rt({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}}}}),VC=St({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}),WC=St({display:"flex",flexDirection:"column",gap:"4px",flex:1,minWidth:0}),HC=St({textDecoration:"none",color:"inherit",cursor:"pointer"});function qC({sentByCurrentUser:e,attachment:t}){const{fileName:n,fileSize:r,url:a}=t,o=e?"sent":"received",i=th();return E("div",{className:UC({type:o}),children:E("div",{onClick:async()=>{if(i)window.open(a,"_self","noopener,noreferrer");else try{const e=await fetch(a),t=await e.blob(),r=URL.createObjectURL(t),o=document.createElement("a");o.href=r,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}catch(e){await br({error:new Error("error while downloading attachment"),severity:"error",extraData:{error:e}}),window.open(a,"_blank","noopener,noreferrer")}},className:HC,children:S("div",{className:VC,children:[S("div",{className:WC,children:[E(ml,{children:n}),E(ga,{children:`${r}`})]}),E(Nc,{Component:BC})]})})})}const jC=Wt(null,St({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function zC({children:e}){return E("div",{...jC,children:e})}const KC=Wt(null,St({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"})),YC=St({minHeight:1,width:"100%"}),_C=T(function({children:e,activeKeyboard:t,setActiveKeyboard:n,inputRef:r},a){const o=p(null);t&&r?.current?.focus();const i=y(()=>{t&&Tn(r?.current)&&(n(!1),r.current.blur())},[t,r,n]);return function(e,t,n){k(()=>{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),S("div",{tabIndex:-1,...KC,ref:o,children:[E("div",{className:YC,ref:a}),e]})}),GC=Object.freeze({message:{text:"",attachments:[]}});function QC(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 ZC=St({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"}),XC=St({display:"flex",flexDirection:"row",gap:"8px"}),JC=St({display:"grid",flexDirection:"column"});function $C({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:QC(r.size)};var r;return S("div",{className:ZC,children:[S("div",{className:XC,children:[E(Nc,{Component:pp}),S("div",{className:JC,children:[E(ml,{children:e.name}),E(ga,{intent:n.intent,accent:n.accent,children:n.text})]})]}),!e.isPending&&E(Zl,{onClick:()=>t(e),children:E(Eo,{Component:Ml})})]})}const ew=St({width:"100%"});function tw({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:jm({defaultValues:t??GC,onSubmit:t=>{up.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=p(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}=md({mutationFn:mp,onSuccess:async()=>Pn.invalidateQueries({queryKey:["files/attachments"]})}),g=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 E("form",{className:ew,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:E(s.Subscribe,{selector:e=>e.values.message.attachments,children:e=>S(I,{children:[e.map(e=>E($C,{attachment:e,onRemove:g},e.localId)),E(s.AppField,{name:"message",children:t=>E(t.MessageAreaInput,{blockSubmit:n,scrollRef:a,setActiveKeyboard:o,ref:i,onFileSelect:d,onUploadComplete:u,hideFileUpload:e.length>=5})})]})})})}function nw(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:[]}}async function rw(){const e=["conversations/messages"],t=["tasks"],n=["conversations"];return vr("mutation successful, invalidating messages queries"),Promise.all([Pn.invalidateQueries({queryKey:e}),Pn.invalidateQueries({queryKey:t}),Pn.invalidateQueries({queryKey:n})]).catch(e=>br({error:e,severity:"error"}))}const aw=async({data:e,accessToken:t,environment:n})=>(async({data:e,accessToken:t,environment:n})=>ni({data:{data:e},accessToken:t,environment:n}))({data:[e],accessToken:t,environment:n}),ow=async({data:e,accessToken:t,environment:n})=>ni({data:{data:[e]},accessToken:t,environment:n}),iw=St({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),lw=St({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),sw=St({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),cw="Marked As Resolved";function dw({resolver:e}){const t=e?`${e} ${cw}`:cw;return S("div",{className:lw,children:[E("div",{className:iw}),E("div",{className:sw,children:t}),E("div",{className:iw})]})}const uw=Rt({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 hw({width:e="md",height:t="md"}){return E(Wa,{styles:uw({width:e,height:t})})}const pw=St({display:"flex",flexDirection:"row-reverse"});function gw(){return S(I,{children:[E(hw,{width:"lg",height:"lg"}),E("div",{className:pw,children:E(hw,{width:"md",height:"lg"})}),E("div",{className:pw,children:E(hw,{width:"lg",height:"xl"})}),E(hw,{width:"md",height:"lg"})]})}const mw=St({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function vw({isConversationLoading:e,isFilling:t,message:n}){return e?n?E(zC,{children:E(FC,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:n})}):null:!e&&t?E(zC,{children:E(gw,{})}):S("div",{className:mw,children:[E(ha,{stylists:[Wt(null,St({whiteSpace:"normal",textAlign:"center"}))],children:"Send your bookkeeper a message"}),E(ml,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const bw=Wt(null,St({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 fw({conversationId:e,setConversationId:t,isResolved:n,isUnread:r,isMobile:a=!1,attachedEntityId:o,defaultValues:i}){const{userId:l}=v(rs),{mutate:s}=function(){const{userId:e}=v(rs);return md({mutationFn:Hi,onMutateFn:({data:t,accessToken:n,environment:r})=>async function({data:e,accessToken:t,environment:n,userId:r}){const a=yn(Ui({id:e.conversationId}),t,n);await Pn.cancelQueries({queryKey:a});const o=Pn.getQueryData(a);return Pn.setQueryData(a,t=>[nw(e,r),...t]),{oldMessages:o}}({data:t,accessToken:n,environment:r,userId:e}),onSettled:rw})}(),{query:{data:c},isFilling:d}=function(e){const t=Tn(e);return Mn({queryKey:Ui({id:e??""}),queryFn:Wi,select:Vi,enabled:t})}(e),{mutate:u,isPending:h,variables:g}=(C=t,w=o,md({mutationFn:ow,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(xn(e)||xn(t))return;C(t);const n=["conversations"],r=["banks/transactions",{}],a=["summaries",{}];let o=async()=>{},i=async()=>{};if(Tn(w)){const e={id:w};Li(w,Oi.BANK_TRANSACTION)?o=async()=>{const t=Si(e);return await Pn.invalidateQueries({queryKey:t})}:Li(w,Oi.FINANCIAL_SUMMARY)&&(i=async()=>await Pn.invalidateQueries({queryKey:a}))}return vr("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([Pn.invalidateQueries({queryKey:n}),Pn.invalidateQueries({queryKey:r}),o(),i()]).catch(e=>br({error:e,severity:"error"}))}})),{mutate:m}=md({mutationFn:aw,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return vr("mutation successful, invalidating conversations queries"),Promise.all([Pn.invalidateQueries({queryKey:e}),Pn.invalidateQueries({queryKey:t})]).catch(e=>br({error:e,severity:"error"}))}}),[b,y]=f(!1),x=p(null),T=p(null);var C,w;k(()=>{n&&r&&e&&m({id:e,readStatus:"READ"})},[n,r,e,m]),k(()=>{hp(T)},[c,T]);const A=xn(e)||xn(c)||d;return S(I,{children:[A?E(_C,{ref:T,inputRef:x,activeKeyboard:b,setActiveKeyboard:y,children:E(vw,{isConversationLoading:h,isFilling:d,message:g?.message?.text})}):S(_C,{ref:T,activeKeyboard:b,setActiveKeyboard:y,inputRef:x,children:[n&&E(dw,{resolver:"Conversation"}),c.map((t,n)=>{const r=t[0].author.userId===l;return E(zC,{children:t.map(t=>S(I,{children:[t.attachments?.map(e=>E(qC,{sentByCurrentUser:r,attachment:e},e.id)),t.text&&E(FC,{conversationId:e,messageId:t.id,sentByCurrentUser:r,reactions:t.reactions,children:t.text},t.id)]}))},n)})]}),E("div",{...bw,children:E(tw,{scrollRef:T,inputRef:x,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(xn(e)){let e="";if(c){const t=40;e=a.slice(0,t)}else d&&(e=i[0].name);const t=(h=a,p=l,{subject:e,status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...Tn(g=o)&&{attachedEntityId:g},message:{text:h,...p.length>0&&{attachmentIds:p}}});u(t)}else s({conversationId:e,text:a,...d&&{attachmentIds:l}});var h,p,g},setActiveKeyboard:y,defaultValues:i})})]})}function yw({conversationId:e,attachedEntityId:t}){const[n,r]=f(e),{query:{data:a}}=ti(n),o="CLOSED"===a?.resolutionStatus;return S(pC,{children:[E(lh,{}),E(fw,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,attachedEntityId:t})]})}const kw=Wt(Ot["form-body"],St({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",minWidth:{base:0,sm:"512px"}}));function xw({children:e}){return E("div",{...kw,children:e})}function Tw({active:e,icon:t,onClick:n,ariaLabel:r,popupTriggerProps:a}){return E(Zl,{ariaLabel:r,onClick:n,active:e,popupTriggerProps:a,children:E(xs,{Component:t})})}function Cw({activeTab:e,onClick:t,popupTriggerProps:n}){return E(Tw,{active:"conversation"===e,onClick:()=>t("conversation"),icon:Bs,ariaLabel:"conversation-tab",popupTriggerProps:n})}const ww=St({display:"flex",flexDirection:"column",position:"fixed",inset:0,backgroundColor:"surface.background"});function Aw({conversationId:e,attachedEntityId:t}){const n=Dl(),[r,a]=f(e),{query:{data:o}}=ti(r),i="CLOSED"===o?.resolutionStatus;return E(rh,{children:S("div",{className:ww,children:[E(lh,{children:S(oh,{children:[E(dh,{Icon:yo,handleClose:()=>n.setOpen(!1)}),E(ha,{children:"Back"})]})}),E(fw,{conversationId:r,setConversationId:a,isResolved:i,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})})}const Ew=Wt(null,St({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),Iw=Wt(null,St({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),Sw=St({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),Nw=e=>{Yd(e),_d(e)},Pw=({children:e,onSubmit:t,Header:n,initialTab:r,conversationId:a,transactionId:o})=>{const i=th(),[l,s]=f(r??null),c=e=>s(e===l?null:e);return E(cC,{children:S("div",{...Ew,children:[E(pC,{children:S("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:Nw,...Iw,children:[n,E(xw,{children:e})]})}),null!==l&&E("div",{className:Sw}),"conversation"===l&&E(yw,{conversationId:a,attachedEntityId:o}),E(uC,{children:i?S(Pl,{children:[E(Rl,{children:e=>E(Cw,{onClick:c,activeTab:l,popupTriggerProps:e})}),E(Aw,{conversationId:a,attachedEntityId:o})]}):E(Cw,{onClick:c,activeTab:l})})]})})},Dw=Wt(null,St({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function Rw({transaction:e,bankAccount:t}){const n=e?e.description:"",r=xn(t)||xn(e)?"":((e,t)=>{const n="BANK_TRANSFER"===t.type,r=Ad(t.amount);return`${n?`${r} `:""}${ad(e.name,e.mask)}`})(t,e);return S("div",{...Dw,children:[E(ha,{wrap:"wrap",children:n}),t&&E(ga,{children:r})]})}const Mw=u.object({type:u.enum([ak.EXPENSE,ak.REVENUE,ak.BANK_TRANSFER,ak.TAX_PAYMENT,ak.INVOICE_PAYMENT,ak.PAYOUT,ak.PAYROLL_PAYMENT,ak.BILL_PAYMENT,ak.LOAN_PAYMENT]),amount:u.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:u.string("Required").refine(e=>(function(e,t){const n=Zt(e.getFullYear(),e.getMonth(),e.getDate()),r=Zt(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()}(new Date(e),/* @__PURE__ */new Date)||on(new Date(e),/* @__PURE__ */new Date))&&sn(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),vendor:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),customer:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),frequency:u.union([u.object({name:u.string(),value:u.enum(["ONE_TIME","WEEKLY","MONTHLY","YEARLY"])}),u.undefined()]),category:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}).nullable(),classSegments:u.array(u.object({id:u.string(),name:u.string().optional()})),bankAccount:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}),glAccount:u.object({id:u.string(),name:u.string().optional(),accountNo:u.string().optional()},{message:"Required"}),notes:u.string().nullable()}),Ow=Mw.extend({children:u.array(u.object({amount:u.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:u.object({id:u.string(),name:u.string().optional()},{message:"Required"}),glAccount:u.object({id:u.string()},{message:"Required"}),classSegments:u.array(u.object({id:u.string(),name:u.string().optional()}))}))}),Lw=Mw.extend({id:u.string(),type:u.literal(Object.values(ak)),description:u.string(),status:u.literal(Object.values(lk)),reviewStatus:u.literal(Object.values(Zb)),apiName:u.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:u.string().nullable(),customer:u.object({id:u.string(),name:u.string().optional(),email:u.string().optional()}).nullable(),vendor:u.object({id:u.string(),name:u.string().optional()}).nullable(),invoiceItem:u.object({id:u.string(),description:u.string().optional()}).nullable(),bill:u.object({id:u.string(),name:u.string().optional()}).nullable(),payroll:u.object({id:u.string(),date:u.string().optional(),checkDate:u.string().optional(),description:u.string().optional()}).nullable(),apiItemId:u.string().nullable()});Lw.extend({});const Fw=Ow.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"]})}),Bw=Ow.extend({matchingBankTransaction:u.object({id:u.string(),description:u.string().optional(),amount:u.number().optional(),date:u.string().optional(),bankAccountId:u.string().optional(),apiName:u.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.matchingBankTransaction?.amount,n=e.amount;return!!xn(t)||t===n},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>Bw.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success});Lw.extend({});const Uw=Ow.extend({});Lw.extend({});const Vw=u.object({tax:u.object({paymentInfo:u.object({region:u.enum(Bm,{message:`Tax region must be one of: ${Bm.join(", ")}`}),quarter:u.enum(Um,{message:`Tax quarter must be one of: ${Um.join(", ")}`}),year:u.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: ${Bm.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","quarter"],code:"custom",message:`Tax quarter must be one of: ${Um.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),Ww=u.intersection(Vw,Ow);u.intersection(Vw,Lw);const Hw={type:"EXPENSE",amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",vendor:{id:"",name:""},customer:{id:"",name:"",email:""},frequency:wi[0],notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function qw(e){const{mutate:t}=Hb(),n=e?{type:(r=e).type,amount:Sp(r.amount),category:r.category,date:r.date,vendor:r.vendor,customer:r.customer,frequency:r.frequency,bankAccount:r.bankAccount,glAccount:r.glAccount,notes:r.notes,classSegments:r.classSegments,children:r.children.map(e=>({amount:Sp(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:r.matchingBankTransaction,tax:r.tax}:Hw;var r;return jm({defaultValues:n,validators:{onBlur:Ow,onSubmit:({value:e})=>{const t=function(e){switch(e){case"EXPENSE":return Fw;case"BANK_TRANSFER":return Bw;case"REVENUE":return Uw;case"TAX_PAYMENT":return Ww;default:return}}(e.type);if(!t)return;const n=t.safeParse(e);return n.success?void 0:n.error.issues.map(e=>({path:e.path.join("."),message:e.message}))}},onSubmit:n=>{e&&(t(function(e,t){const n={id:e,type:t.type,amount:t.amount?Np(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?Np(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.matchingBankTransaction?.id};case"TAX_PAYMENT":return{...n,tax:t.tax};default:return n}}(e.id,n.value)),n.formApi.reset(n.value,{keepDefaultValues:!0}))},onSubmitInvalid:()=>{}})}function jw({children:e,onClick:t,Icon:n,closeOnClick:r=!1}){const a=Dl();return S(Tu,{onClick:()=>{r&&a.setOpen(!1),t()},children:[n&&E(Nc,{Component:n}),E(ha,{children:e})]})}function zw({transaction:e}){const{mutate:t}=Wb(),n=()=>t(ck([e]));return E(jw,{onClick:()=>{return e=n,void td({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:Kc,label:"Cancel"},{key:Yc,label:"Delete",type:ed}]}).then(t=>{t===Yc&&e()});var e},children:"Delete"})}function Kw({transaction:e}){const{mutate:t}=Wb();return E(jw,{onClick:()=>{t([e].map(e=>({id:e.id,status:lk.ACTIVE})))},children:"Restore"})}const Yw=zm({defaultValues:Hw,render:function({form:e}){return E(jw,{onClick:()=>{Jn()},closeOnClick:!0,children:"Attach Bill(s)"})}}),_w=zm({defaultValues:Hw,render:function({form:e}){return E(jw,{onClick:()=>{Jn()},closeOnClick:!0,children:"Attach Payroll"})}}),Gw=zm({defaultValues:Hw,render:function({form:e}){return E(jw,{onClick:()=>{Jn()},Icon:Jf,closeOnClick:!0,children:"Attach Invoice(s)"})}}),Qw=wi.filter(e=>"ONE_TIME"!=e.value);function Zw({onClick:e}){const t=Dl();return E(Fu,{triggerChildren:E(Uu,{displayLabel:"Make recurring"}),popupChildren:E(Lm,{frequencies:Qw,onClick:n=>{e(n),t.setOpen(!1)}})})}const Xw=zm({defaultValues:Hw,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:n}){const r=He(e=>e.FEATUREFLAG_ATTACH_TO_GLSOURCE),a=Se(),o=!xn(n)&&Pp(n)&&"EXPENSE"===n.type;return S(lh,{children:[S(oh,{children:[E(dh,{}),E(ha,{children:t}),E(xx,{children:S(su,{children:[n?.status===lk.ACTIVE&&E(zw,{transaction:n}),n?.status===lk.INACTIVE&&E(Kw,{transaction:n}),r&&S(I,{children:["EXPENSE"===n?.type&&E(Yw,{form:e}),"EXPENSE"===n?.type&&E(_w,{form:e}),"REVENUE"===n?.type&&E(Gw,{form:e})]}),o&&E(e.Subscribe,{selector:e=>e.values.frequency,children:t=>{return a&&!(null!=(n=t)&&"ONE_TIME"!=n.value)&&E(Zw,{onClick:t=>e.setFieldValue("frequency",t)});var n}})]})})]}),E(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:E(e.SaveButton,{})})]})}}),Jw=Wt(null,St({position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",outline:"none",border:"none",background:"none",padding:"15px 0px",gap:"15px",width:"100%"})),$w=Wt(null,St({backgroundColor:"border.layout",height:"25px",width:"1px",margin:0})),eA=Wt(null,St({backgroundColor:"border.layout",height:"1px",width:"100%"})),tA=Wt(null,St({background:"none",border:"none",outline:"none",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"md",cursor:"pointer","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:hover":{"& svg":{"& path":{stroke:"icon.accent.danger"}}}}),wo),nA=Wt(null,St({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px"})),rA=zm({defaultValues:Hw,props:{index:0,numRows:1,removeSplit:()=>{}},render:function({form:e,index:t,numRows:n,removeSplit:r}){return S(I,{children:[S("div",{...Jw,children:[E(e.AppField,{name:`children[${t}].category`,children:e=>E(e.SplitExpenseCategoryField,{value:e.state.value,onChange:e.handleChange})}),S("div",{...nA,children:[E("div",{...$w}),E(e.AppField,{name:`children[${t}].amount`,children:e=>E(e.SplitExpenseAmountField,{value:e.state.value,onChange:e.handleChange,onBlur:e.handleBlur})}),E("button",{onClick:()=>r(t),...tA,children:E(Nc,{Component:Xk})})]})]}),t<n-1&&E("div",{...eA})]})}}),aA=Wt(null,St({display:"flex",flexDirection:"column",alignItems:"flex-start",outline:"none",border:"none",background:"none"})),oA=St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout.strong",display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none"}),iA=St({borderColor:"border.intent.danger"}),lA=zm({defaultValues:Hw,render:function({form:e}){const t=fe(e.store,e=>{const t=e.errors?.[0]??{},n=Object.values(t).flat().filter(e=>"object"==typeof e&&null!==e&&"message"in e);return n[0]?.message}),n=Wt(null,oA,t?iA:void 0);return S(I,{children:[S("div",{...n,children:[E(ga,{children:"Category"}),E(e.AppField,{name:"children",mode:"array",children:t=>{const n=n=>{if(t.state.value.length<=2){const r=1-n;e.setFieldValue("category",t.state.value[r].category),t.clearValues()}else t.removeValue(n);e.validate("blur")};return S("div",{...aA,children:[t.state.value.map((r,a)=>E(rA,{form:e,index:a,numRows:t.state.value.length,removeSplit:n},`${r?.category?.id}-${a}`)),E($u,{onClick:()=>{const e=Le(t.state.value)?.category,n=Le(t.state.value)?.classSegments,r=Le(t.state.value)?.glAccount;t.pushValue({amount:0,category:e||{id:"",name:""},glAccount:r||{id:""},classSegments:n||[]})}})]})}})]}),t&&E(Vd,{errorMessage:t})]})}}),sA=zm({defaultValues:Hw,render:function({form:e}){const t=fe(e.store,e=>e.values.amount)??0;return E(e.Subscribe,{selector:e=>e.values.children,children:n=>Array.isArray(n)&&0!==n.length?E(lA,{form:e}):E(e.AppField,{name:"children",mode:"array",children:n=>E(e.AppField,{name:"category",children:r=>E(r.ExpenseCategoryField,{category:r.state.value,glAccount:e.state.values.glAccount,onClick:r.handleChange,childrenField:n,totalAmount:t})})})})}}),cA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){const r=Se();return S(I,{children:[E(e.AppField,{name:"vendor",children:e=>E(e.VendorFieldInput,{label:"Vendor",onClick:e.handleChange,vendor:e.state.value,editable:n})}),E(e.AppField,{name:"customer",children:e=>E(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value,editable:n})}),E(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)&&E(e.AppField,{name:"frequency",children:e=>E(e.FrequencyFieldInput,{label:"Frequency",onClick:e.handleChange,frequency:e.state.value})});var o,i}}),E(sA,{form:e}),n&&E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})})]})}}),dA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return S(I,{children:[E(e.AppField,{name:"customer",children:e=>E(e.CustomerFieldInput,{label:"Customer",onClick:e.handleChange,customer:e.state.value})}),E(e.AppField,{name:"glAccount",children:e=>E(e.GlAccountField,{})}),n&&E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})})]})}}),uA=zm({defaultValues:Hw,props:{transaction:{}},render:function({form:e,transaction:t}){return S(I,{children:[E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})}),E(e.AppField,{name:"glAccount",children:e=>E(e.BankGlAccountField,{transaction:t})}),E(e.AppField,{name:"matchingBankTransaction",children:e=>E(e.MatchingBankTransferField,{transaction:t})})]})}}),hA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return S(I,{children:[E(e.AppField,{name:"tax.paymentInfo.region",children:e=>E(e.TaxCategoryField,{region:e.state.value,onClick:e.handleChange})}),E(e.AppField,{name:"tax.paymentInfo.quarter",children:e=>E(e.ButtonGroupField,{label:"Quarter",options:Fm})}),E(e.AppField,{name:"tax.paymentInfo.year",children:e=>E(e.GenericSelectorField,{label:"Year",options:an({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),n&&E(e.AppField,{name:"bankAccount",children:e=>E(e.ManualBankAccountField,{transaction:t})})]})}}),pA=zm({defaultValues:Hw,props:{transaction:{},isManual:!1},render:function({form:e,transaction:t,isManual:n}){return E(e.Subscribe,{selector:e=>e.values.type,children:r=>{switch(r){case"EXPENSE":return E(cA,{form:e,transaction:t,isManual:n});case"REVENUE":return E(dA,{form:e,transaction:t,isManual:n});case"BANK_TRANSFER":return E(uA,{form:e,transaction:t});case"TAX_PAYMENT":return E(hA,{form:e,transaction:t,isManual:n});default:return null}}})}}),gA={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 mA({transaction:e,form:t,bankAccount:n,isManual:r,conversationId:a,transactionId:o,initialTab:i,currentType:l}){const s=E(Xw,{form:t,transaction:e,title:gA[l]});return S(Pw,{onSubmit:t.handleSubmit,Header:s,initialTab:i,conversationId:a,transactionId:o,children:[e.description&&E(Rw,{transaction:e,bankAccount:n}),E(t.AppField,{name:"amount",children:e=>E(r?e.EditableAmountField:e.DiscreteAmountField,{label:"Total"})}),E(t.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date,editable:r})}),E(pA,{form:t,transaction:e,isManual:r}),E(t.AppField,{name:"notes",children:e=>E(e.TextAreaInput,{label:"Note"})}),E(t.AppField,{name:"type",children:()=>null})]})}function vA({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}=Ri({id:e});return{transaction:t,form:qw(t),bankAccount:Wp(t?.bankAccount.id??""),isManual:!xn(t)&&Pp(t),isLoading:r||n&&!t}}({transactionId:e});if(i||!n)return null;const l=n?.conversation?.id??null;return E(r.Subscribe,{selector:e=>e.values.type,children:i=>E(mA,{transaction:n,form:r,bankAccount:a,isManual:o,conversationId:l,transactionId:e,initialTab:t,currentType:i})})}function bA({transactionId:e,initialTab:t}){const{query:{data:n},isFilling:r}=Ri({id:e});return k(()=>{!r&&xn(n)&&xi()},[n,r]),xn(n)?null:E(vA,{transactionId:e,initialTab:t})}const fA={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"column",...r}},defaultValues:{gap:"8px"}},yA=(e={})=>{const t=yt(fA,e);return fA.transform(t,ft)},kA=e=>St(yA(e));kA.raw=yA;const xA={transform(e){const{justify:t,gap:n,...r}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:n,flexDirection:"row",...r}},defaultValues:{gap:"8px"}},TA=(e={})=>{const t=yt(xA,e);return xA.transform(t,ft)},CA=e=>St(TA(e));function wA({subject:e,children:t}){return S(lh,{children:[S(oh,{children:[E(dh,{}),E(ha,{children:e})]}),E("div",{className:CA({alignItems:"center",gap:15}),children:t})]})}function AA({conversationId:e,defaultValues:t}){const[n,r]=f(e),{query:{data:a}}=ti(n),o="CLOSED"===a?.resolutionStatus;return E(cC,{children:S(pC,{children:[E(wA,{subject:a?.subject??"Conversation"}),E(fw,{conversationId:n,setConversationId:r,isResolved:o,isUnread:"UNREAD"===a?.readStatus,defaultValues:t})]})})}CA.raw=TA;const EA=fo(e=>h.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("g",{clipPath:"url(#clip0_18201_5557)"},h.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}),h.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),h.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_18201_5557"},h.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function IA({onClick:e,active:t}){return E(ll,{type:"button",onClick:e,active:t,children:E(Nc,{Component:EA})})}const SA=St({display:"flex",flexDirection:"column"});function NA({label:e,data:t,isFilling:n,shimmerWidth:r}){return S("div",{className:SA,children:[E(ga,{children:e}),n?E(hw,{width:r}):E(ha,{wrap:"wrap",children:t??""})]})}function PA({transactionId:e,isOpen:t}){const{query:{data:n},isFilling:r}=Ri({id:e}),a=Wp(n?.bankAccount.id??"");if(xn(n))return null;const o=kA({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 S("div",{"data-open":t,className:o,children:[S("div",{className:CA({justifyContent:"space-between"}),children:[E(NA,{label:"Date",data:n?.date,isFilling:r,shimmerWidth:"md"}),E(NA,{label:"Amount",data:sa(Sp(n.amount)),isFilling:r,shimmerWidth:"sm"})]}),E(NA,{label:"Bank Account",data:ad(a?.name??"",a?.mask??""),isFilling:r,shimmerWidth:"lg"}),E(NA,{label:"Description",data:n?.description,isFilling:r,shimmerWidth:"lg"})]})}function DA({conversationId:e,transactionId:t}){const[n,r]=f(e),[a,o]=f(!0),{query:{data:i}}=ti(n),l="CLOSED"===i?.resolutionStatus;return E(cC,{children:S(pC,{children:[E(wA,{subject:i?.subject??"Conversation",children:Tn(t)&&E(IA,{onClick:()=>o(!a),active:a},"infoButton")}),Tn(t)&&E(PA,{transactionId:t,isOpen:a}),E(fw,{conversationId:n,setConversationId:r,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}function RA(){const{query:{data:e}}=Fc({filter:{apiName:{equal:"PLAID"},status:{equal:"ACTIVE"}}}),t=e?.data,n=He(e=>e.drawerHistory).length>1,r=new Set(t?.flatMap(e=>null!=e.apiInstitutionName?[e.apiInstitutionName]:[]));return E(cC,{children:S(pC,{background:"foreground",children:[E(lh,{children:S(oh,{children:[E(dh,n?{Icon:yo}:{}),E(ha,{children:"Add New Connection"})]})}),E(qT,{connectedBankNames:r})]})})}function MA(){return E(lh,{children:S(oh,{children:[E(dh,{}),E(ha,{children:"Financial Summary"})]})})}const OA=St({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),LA=Yt.raw({body:"default"}),FA=St({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},LA);function BA({summaryText:e}){return E("div",{className:OA,children:E("div",{className:FA,children:e})})}const UA=St({display:"flex",flexDirection:"column",overflow:"auto"});function VA({summary:e}){return S("div",{className:UA,children:[E(MA,{}),E(BA,{summaryText:e})]})}const WA=St({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function HA({summaryId:e,conversationId:t}){const{query:{data:n}}=function({id:e}){return Mn({queryKey:zi({id:e}),queryFn:Yi})}({id:e});return E(cC,{children:S("div",{className:WA,children:[E(pC,{children:E(VA,{summary:n?.summary})}),E(ui,{}),E(yw,{conversationId:t??null,attachedEntityId:e})]})})}function qA(){return E(cC,{children:E(pC,{children:E(QT,{showCloseButton:!0})})})}const jA=u.object({id:u.string(),name:u.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),mask:u.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:u.enum(["DEPOSITORY","CREDIT","INVESTMENT","EQUITY","LOAN","OTHER"],{message:"Required"})}),zA={mergeDestination:om,selectedAccount:null};const KA=St({display:"flex",flexDirection:"column",gap:"20px"}),YA=St({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),_A=St.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"flex-start"}),GA=St(_A,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),QA=St(_A,{placeSelf:"center",alignItems:"center",maxWidth:{sm:"300",base:"auto"}}),ZA=St(_A,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),XA=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),JA=St({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),$A=St({width:"100%",display:"flex",justifyContent:"flex-start"}),eE=St({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),tE=St({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),nE=e=>{Yd(e),_d(e)};function rE({account:e}){const t=Dl(),n=function(e,t){const{mutateAsync:n}=xd();return jm({defaultValues:zA,onSubmit:async r=>{if(await Sd()===Yc&&Tn(e)&&Tn(r.value.selectedAccount)){const l=(a=e,o=r.value.mergeDestination,i=r.value.selectedAccount,o===om?{...Ed(i),duplicateBankAccountIds:[Bi(a.id)]}:{...Ed(a),duplicateBankAccountIds:[Bi(i.id)]});try{await n(l),t.setOpen(!1),r.value.mergeDestination===om&&xi()}catch{await Nd()}}var a,o,i},onSubmitInvalid:()=>{}})}(e,t),{query:{data:r},isFilling:a}=dd();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 S("form",{className:KA,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),n.handleSubmit()},onKeyDown:nE,children:[E(ha,{children:"Merge Accounts"}),E("div",{className:YA,children:E(n.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>S(I,{children:[S("div",{className:GA,children:[E("div",{className:$A,children:E(ha,{children:"Duplicate Account"})}),t===om?E(tm,{accountName:e.name,accountNo:e.mask,institutionId:e.integration?.apiInstitutionId??""}):E(n.AppField,{name:"selectedAccount",children:n=>E(lm,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:sm(t,e,n.state.value)})})]}),S("div",{className:QA,children:[E("div",{className:eE,children:E(ha,{children:"Into"})}),E(n.AppField,{name:"mergeDestination",children:e=>E("div",{className:JA,children:E(ll,{onClick:()=>e.handleChange(e.state.value===om?am:om),children:E(Nc,{Component:ko})})})})]}),S("div",{className:ZA,children:[E("div",{className:tE,children:E(ha,{children:"Destination Account"})}),t===om?E(n.AppField,{name:"selectedAccount",children:n=>E(lm,{selectedAccount:n.state.value,setSelectedAccount:n.handleChange,mergeDestination:t,bankAccounts:o,isFilling:a,warningMessage:sm(t,e,n.state.value)})}):E(tm,{accountName:e.name,accountNo:e.mask,institutionId:e?.integration?.apiInstitutionId??""})]})]})})}),S("div",{className:XA,children:[E(Ym,{showIcon:!1,onClick:()=>{t.setOpen(!1)}}),E(n.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>E(Ld,{disabled:xn(e),showIcon:!1,textContent:"Merge"})})]})]})}function aE({bankAccount:e}){return E(su,{children:S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:e=>S(Tu,{...e,children:[E(Nc,{Component:Rx}),E(ha,{children:"Merge Accounts"})]})}),E(rh,{children:E(Ak,{children:E(Ik,{children:E(rE,{account:e})})})})]})})}const oE=St({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"}}}),iE=({tranStartDate:e})=>S(I,{children:[E(ga,{children:"Start Date"}),An(e)?E(ha,{children:`${fn(hn(e))}`}):E(ha,{children:"Set Start Date"})]});function lE({bankAccount:e}){return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:t=>E("button",{className:Pt(oE,To),...t,type:"button",children:E(iE,{tranStartDate:e.tranStartDate})})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(Nx,{bankAccounts:[e]})})})})]})}const sE=e=>["accounting/manualJournalEntry",e.id],cE=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 Ko(a)};function dE({id:e}){return Mn({queryKey:sE({id:String(Bi(e))}),queryFn:cE,enabled:Tn(e)})}const uE=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:Mr(n)};return await Sr(r)})({data:e,accessToken:t,environment:n});const hE=async({data:e,accessToken:t,environment:n})=>{const r={path:"/banks/beginningBalance",bodyParams:e,accessToken:t,endpointManager:Mr(n)};return await Sr(r)},pE=u.object({amount:u.number({message:"Required"}).refine(e=>e>=0,{message:"Amount must be above 0"}),date:u.string("Required")}),gE=(e,t)=>{const n=t?.transactions?.find(t=>e.glAccountId&&t?.glAccountId===Bi(e.glAccountId));return 0===n?.crAmount?n?.drAmount:n?.crAmount},mE=e=>{const t=e.beginningBalanceData.journalEntry?.id,{query:{data:n}}=dE({id:t??null}),r=function(){const{query:{data:e}}=$p();return ig(e,["EQUITY"]).filter(e=>"CAPITAL"===e.equityType||"OPENING_BALANCE"===e.equityType)}(),{mutate:a}=md({mutationFn:hE,onSuccess:async()=>{vr("beginning balance mutation successful, invalidating bank account queries");try{return Pn.invalidateQueries({queryKey:["banks/accounts",{}]})}catch(e){e instanceof Error&&br({error:e,severity:"error"})}}});const{mutate:o}=md({onSuccess:async()=>{vr("mutation successful, invalidating manual journal entry queries");try{return Promise.all([Pn.invalidateQueries({queryKey:["accounting/manualJournalEntry"]}),Pn.invalidateQueries({queryKey:["banks/accounts",{}]})])}catch(e){e instanceof Error&&br({error:e,severity:"error"})}},mutationFn:uE}),i=Dl(),l=((e,t)=>{const n=gE(e,t);return{amount:Tn(e.beginningBalanceData.journalEntry?.id)?n:"",date:Tn(t?.date)?t.date:""}})(e,n);return jm({defaultValues:l,validators:{onBlur:pE},onSubmit:l=>{if(i.setOpen(!1),xn(t)||xn(n))a({bankAccountId:Bi(e.id),balance:Number(l.value.amount),date:l.value.date});else{const t=((e,t,n,r,a)=>{if(xn(e.id))return null;const o={...e,id:e.id},i=a.map(e=>Bi(e.id));let l=0;return o.transactions?.forEach(e=>{r.glAccountId&&e.glAccountId===Bi(r.glAccountId)&&(e.drAmount?(l=Number(e.drAmount)-n,e.drAmount=n):e.crAmount&&(l=Number(e.crAmount)-n,e.crAmount=n))}),xn(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=pn(t)??o.date,o)})(n,hn(l.value.date)||new Date(l.value.date),Number(l.value.amount),e,r);Tn(t)&&o(t)}}})},vE=St({display:"flex",flexDirection:"column",gap:"10px",justifyContent:"space-between",maxWidth:"900px",minWidth:"360px"}),bE=St({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"});function fE({bankAccount:e}){const t=mE(e),n=Dl(),r=()=>{n.setOpen(!1)};return S("form",{className:vE,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),t.handleSubmit()},children:[E(ha,{children:"Set Beginning Balance"}),E(t.AppField,{name:"date",children:e=>E(e.DateInput,{label:"Beginning Balance Date",maxDate:/* @__PURE__ */new Date,editable:!0})}),E(t.AppField,{name:"amount",children:e=>E(e.EditableAmountField,{label:"Beginning Balance Amount"})}),E(t.Subscribe,{selector:e=>e,children:e=>S("div",{className:bE,children:[E(Ym,{showIcon:!1,onClick:r}),E(Ld,{showIcon:!1,textContent:"Confirm",disabled:!e.isDirty})]})})]})}const yE=Rt({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"}}}}),kE=St({display:"flex",flexDirection:"row",gap:"8px",width:"100%"});function xE({bankAccount:e,hasMigrationDate:t,beginningBalanceAmount:n,beginningBalanceDate:r,layout:a="left"}){const o=Pt(yE({layout:a}),To),i=Pt(yE({layout:"right"}),To),l=r&&fn(r);return S(Pl,{placement:"right-start",modal:!0,children:[E(Rl,{children:e=>S("div",{className:kE,children:[S("button",{className:o,...e,type:"button",children:[E(ga,{children:"Beginning Balance"}),E(ha,{children:Tn(n)?`$${n}`:"Set Beginning Balance"})]}),t&&l&&S("button",{className:i,...e,type:"button",children:[E(ga,{children:"Migration Date"}),E(ha,{children:l})]})]})}),E(rh,{children:E(Ak,{children:E(Ik,{width:"sm",children:E(fE,{bankAccount:e})})})})]})}const TE=Rt({base:{display:"flex",gap:"8px",width:"100%"},variants:{layout:{stacked:{flexDirection:"column"},inline:{flexDirection:"row"}}}});function CE({bankAccount:e,showStartDate:t}){const{query:{data:n}}=dE({id:e?.beginningBalanceData.journalEntry?.id??null});if(!e)return null;const r=gE(e,n),a=Tn(n?.date)?hn(n?.date):null,o=Tn(e.tranStartDate)?hn(e.tranStartDate):null,i=Tn(a)&&Tn(o)&&!on(a,o),l=i?"left":t?"right":"left";return S("div",{className:TE({layout:i?"stacked":"inline"}),children:[t&&E(lE,{bankAccount:e}),E(xE,{bankAccount:e,hasMigrationDate:i,layout:l,beginningBalanceAmount:r,beginningBalanceDate:a})]})}const wE=St({marginTop:"15px",marginBottom:"15px"}),AE={id:"",name:"",mask:"",type:void 0};const EE=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],IE=e=>{Yd(e),_d(e)};function SE({bankAccountId:e}){const t=Wp(e),n=t?{id:t.id,name:t.name,mask:t.mask,type:t.type}:AE,[r,a]=f(n),o=function(e,t){const{mutate:n}=xd(),{mutateAsync:r}=kd({mutationFn:bd}),a=An(String(e.id));return jm({defaultValues:e,validators:{onBlur:jA},onSubmit:async e=>{if(a)n(Ed(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:Fi({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||Cd(t.apiName),l=!!t&&wd(t.apiName),s=ad(r?.name??"",r?.mask??""),c=An(s)?s:"New Bank Account",d=l&&Tn(t?.tranStartDate),u=Tn(t)&&(d||!0);return E(cC,{children:E(pC,{children:S("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:IE,children:[S(lh,{children:[S(oh,{children:[E(dh,{}),E(ha,{children:c}),Tn(t)&&E(xx,{children:E(aE,{bankAccount:t})})]}),E(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:E(o.SaveButton,{})})]}),S(xw,{children:[E(o.AppField,{name:"name",children:e=>E(e.TextField,{label:"Name",disabled:!i,placeholder:"Enter name..."})}),E(o.AppField,{name:"mask",children:e=>E(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:!i,placeholder:"0000",maxLength:4})}),E(o.AppField,{name:"type",children:e=>E(e.GenericSelectorField,{label:"Account Type",options:EE,disabled:!i})}),u&&S(I,{children:[E("div",{className:wE,children:E(ui,{alignment:"horizontal"})}),E(CE,{bankAccount:t,showStartDate:d})]})]})]})})})}function NE(){return S(oC,{children:[E(lC,{name:"BankTransactionFormRouter",Component:bA}),E(lC,{name:"Conversation",Component:AA}),E(lC,{name:"MobileConversation",Component:DA}),E(lC,{name:"FinancialSummary",Component:HA}),E(lC,{name:"BanksAndIntegrations",Component:qA}),E(lC,{name:"BankAccountForm",Component:SE}),E(lC,{name:"NewConnection",Component:RA})]})}const PE=({environment:e,children:t})=>E(Dn.Provider,{value:e,children:t}),DE=async e=>{const t=e.queryKey,n={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await Ko(n)};function RE({children:e}){const{query:{data:t}}=Mn({queryKey:["sdk/introspect"],queryFn:DE}),n={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?Fi({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 E(rs.Provider,{value:n,children:e})}const ME=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const OE="SSE connection failed with status";function LE({companyId:e,customerPartnerId:t,sseTypes:n}){const r=Rn();k(()=>{if(!t)return;const a=new AbortController,o=function(e,t,n,r){const a=new URL(`${o=e,Rr[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(`${OE} ${e.status}`)}(e),onmessage:a=>function({event:e,data:t,env:n,sseTypes:r,customerPartnerId:a,companyId:o}){switch(e){case ME.CONNECTED:return void vr("SSE connection established",{env:n,customerPartnerId:a,companyId:o,sseTypes:JSON.stringify(Array.from(r))});case ME.ERROR:throw br({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case ME.CACHE_BUST:return vr("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(()=>{Pn.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>br({error:e,severity:"error"}))},500*Math.random()),vr(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void br({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 br({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(OE))throw e;return 3e3*2**Math.min(t,3)}(e,i++),signal:a.signal}).catch(e=>br({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[r,t,e,n])}const FE=[ME.CACHE_BUST];function BE({children:e}){const{companyId:t,customerPartnerId:n}=v(rs);return LE({companyId:t,customerPartnerId:n,sseTypes:FE}),e}const UE="undefined"!=typeof window?w:k,VE="undefined"==typeof window;function WE(e={}){let{initializeWithValue:t=!0}=e;VE&&(t=!1);const[n,r]=f(()=>t?{width:window.innerWidth,height:window.innerHeight}:{width:void 0,height:void 0}),a=function(e,t=500,n){const r=p();!function(e){const t=p(e);t.current=e,k(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const a=g(()=>{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 k(()=>{r.current=c(e,t,n)},[e,t,n]),a}(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=p(t);UE(()=>{a.current=t},[t]),k(()=>{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),UE(()=>{o()},[]),n}const HE=({children:e})=>{const{width:t,height:n}=WE({debounceDelay:150}),r={dimensions:{width:t,height:n}};return E(eh.Provider,{value:r,children:e})};function qE({children:e,environment:t,accessToken:n}){const r={activeToken:n,accountantToken:void 0};return k(()=>{var e,r;e=n,r=t,ur.setProperties(gr),pr=r,hr=e},[n,t]),E(PE,{environment:t,children:E($T,{children:E(En.Provider,{value:r,children:E(RE,{children:E(BE,{children:S(HE,{children:[E(me.ConfirmationRoot,{}),e,E(NE,{})]})})})})})})}export{ZT as BanksAndIntegrations,Ly as BusinessOwnerDashboard,qE as Tight,lx as TransactionsDashboard,Je as useOptions};
2
2
  //# sourceMappingURL=index.js.map