@tight-embedded/react 1.2.0 → 1.3.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.css +542 -263
- package/dist/index.css.gz +0 -0
- package/dist/index.d.ts +55 -12
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.js.map.gz +0 -0
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{create as e}from"zustand";import{devtools as t}from"zustand/middleware";import{cloneDeep as r,entries as n,mapValues as o,isEqual as a,isEmpty as i}from"lodash-es";import*as l from"zod";import{z as s}from"zod";import*as c from"react";import{useRef as d,useMemo as u,createContext as h,useContext as p,Component as g,useState as m,useCallback as v,useEffect as b,createElement as f,forwardRef as y,useReducer as T,useLayoutEffect as x,useImperativeHandle as k}from"react";import{jsx as w,Fragment as C,jsxs as E}from"react/jsx-runtime";import{QueryClient as I,useIsRestoring as S,useQuery as A,keepPreviousData as N,useMutation as P}from"@tanstack/react-query";import M from"yocto-queue";import D from"big.js";import{ResponsiveContainer as R,BarChart as O,Legend as _,CartesianGrid as L,XAxis as F,YAxis as B,Tooltip as W,Bar as H,ReferenceLine as U,Line as V}from"recharts";import{flexRender as z,createColumnHelper as j,useReactTable as K,getCoreRowModel as $,getExpandedRowModel as q}from"@tanstack/react-table";import{useFloatingNodeId as Y,useFloating as G,offset as Q,flip as X,shift as Z,size as J,autoUpdate as ee,useClick as te,useDismiss as re,useRole as ne,useInteractions as oe,useFloatingParentNodeId as ae,FloatingTree as ie,FloatingNode as le,useMergeRefs as se,FloatingOverlay as ce,FloatingPortal as de,FloatingFocusManager as ue}from"@floating-ui/react";import{ContextAwareConfirmation as he,confirmable as pe}from"react-confirm";import{usePlaidLink as ge}from"react-plaid-link";import me from"fuse.js";import{openDB as ve}from"idb";import{PersistQueryClientProvider as be}from"@tanstack/react-query-persist-client";import{createFormHookContexts as fe,useStore as ye,createFormHook as Te}from"@tanstack/react-form";import{NumericFormat as xe}from"react-number-format";import{fetchEventSource as ke}from"@microsoft/fetch-event-source";function we(e,t){return`${e.trim()}:${t.trim()}`}const Ce=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_HAS_MERGE_ACCOUNTS:!1,FEATUREFLAG_PLAID_CONNECTION_DRAWER:!1,FEATUREFLAG_SERVER_SIDE_EVENTS:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,we("featureFlags","updateFlags"))});function Ee(){return Le(e=>e.FEATUREFLAG_PLAID_CONNECTION_DRAWER)}const Ie="drawerNavigation",Se=e=>({drawerHistory:[],openDrawer:(t,n={})=>e(e=>{const{replaceHistory:o,routeProps:a}=n,i={[t]:{routeProps:a}};if(o||0===e.drawerHistory.length)return{drawerHistory:[i]};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t}}},void 0,we(Ie,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1)}},void 0,we(Ie,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[]}),void 0,we(Ie,"closeAllDrawers"))}),Ae=e=>({externalOptions:{},setOptions:(t,r=!1)=>e(e=>r?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,we("externalOptions","setOptions"))});function Ne(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Pe(e){return e[e.length-1]}const Me="transactionsDashFilters",De=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:[...e.transactionsDashFilters,...t]}),void 0,we(Me,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:Ne(e.transactionsDashFilters,t)}),void 0,we(Me,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:t}),void 0,we(Me,"setFilters"))}),Re={label:"Connected Accounts",value:"connected"},Oe="banksAndIntegrationsState",_e=e=>({banksAndIntegrationsSelectedTab:Re,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,we(Oe,"setBanksAndIntegrationsSelectedTab")),toggleExpandedPlaidItem:(t,r)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||r&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,we(Oe,"toggleExpandedPlaidItem"))}),Le=e()(t((...e)=>({...Ce(...e),...Se(...e),...Ae(...e),...De(...e),..._e(...e)}),{name:"globalStore",enabled:!1,store:"globalStore"})),Fe={SELECT:"select",EXPAND:"expand",DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},Be=[Fe.COMMENTS,Fe.DATE,Fe.DESCRIPTION,Fe.AMOUNT,Fe.CATEGORY,Fe.CLASS_SEGMENT,Fe.REVIEW_STATUS],We=l.object({pageSize:l.optional(l.int32().positive()),columns:l.optional(l.array(l.enum(Be)))}),He=l.optional(l.string().trim()),Ue=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ve=l.optional(l.array(l.string().trim())),ze={transactionsDashboard:e=>{const t=We.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=He.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Ve.safeParse(e);if(!t.success||void 0===t.data)return;const r=t.data.filter(e=>Ue.test(e));return r.length>0?r:void 0}},je=(e,t)=>{if(void 0!==ze[e])return(0,ze[e])(t)};function Ke(e){const t=d(!1),o=Le(e=>e.setOptions);if(e&&!t.current){o(function(e){let t={};for(const[r,o]of n(e)){const e=je(r,o);void 0!==e&&(t={...t,[r]:e})}return t}(e)),t.current=!0}const a=Le(e=>e.externalOptions);return{options:u(()=>r(a),[a]),setOptions:o}}function $e(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function qe(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function Ye(e){return String.fromCharCode(e+(e>25?39:97))}function Ge(e){return function(e){let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Ye(t%52)+r;return Ye(t%52)+r}(function(e,t){let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e}(5381,e)>>>0)}var Qe=/\s*!(important)?/i;function Xe(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var Ze=e=>{const t=/* @__PURE__ */new Map;return(...r)=>{const n=JSON.stringify(r);if(t.has(n))return t.get(n);const o=e(...r);return t.set(n,o),o}},Je=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function et(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(r=>{if(Je.has(r))return;const n=e[r],o=t[r];$e(n)&&$e(o)?e[r]=et(n,o):e[r]=o}),e):e,{})}var tt=e=>null!=e;function rt(e,t,r={}){const{stop:n,getKey:o}=r;return function e(r,a=[]){if("object"==typeof(i=r)&&null!==i){const i={};for(const[l,s]of Object.entries(r)){const c=o?.(l,s)??l,d=[...a,c];if(n?.(r,d))return t(r,a);const u=e(s,d);tt(u)&&(i[c]=u)}return i}var i;return t(r,a)}(e)}function nt(e,t,r=!0){const{utility:n,conditions:o}=t,{hasShorthand:a,resolveShorthand:i}=n;return rt(e,e=>{return Array.isArray(e)?(t=e,r=o.breakpoints.keys,t.reduce((e,t,n)=>{const o=r[n];return null!=t&&(e[o]=t),e},{})):e;var t,r},{stop:e=>Array.isArray(e),getKey:r?e=>a?i(e):e:void 0})}var ot={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},at=/([A-Z])/g,it=/^ms-/,lt=Ze(e=>e.startsWith("--")?e:e.replace(at,"-$1").replace(it,"-ms-").toLowerCase()),st=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),ct=`(?:${"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("|")})`,dt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${ct}$`),ut={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):$e(e)?rt(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&st.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&dt.test(e)},ht=(e,t)=>{if(!e?.defaultValues)return t;const r="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},r,qe(t))};const pt=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(",")),gt=/^@|&|&$/;function mt(e){return pt.has(e)||gt.test(e)}const vt=/^_/,bt=/&|@/,ft=/* @__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,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach(e=>{const[t,r]=e.split(":");ft.set(t,r)});const yt={conditions:{shift:function(e){return e.sort((e,t)=>{const r=mt(e),n=mt(t);return r&&!n?1:!r&&n?-1:0})},finalize:function(e){return e.map(e=>pt.has(e)?e.replace(vt,""):bt.test(e)?`[${Xe(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${ft.get(e)||lt(e)}_${Xe(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Tt=function(e){const{utility:t,hash:r,conditions:n=ot}=e,o=e=>[t.prefix,e].filter(Boolean).join("-");return Ze(({base:a,...i}={})=>{const l=nt(Object.assign(i,a),e),s=/* @__PURE__ */new Set;return rt(l,(e,a)=>{if(null==e)return;const i="string"==typeof(u=e)&&Qe.test(u),[l,...c]=n.shift(a),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(Qe,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,a)=>{let i;if(r){const r=[...n.finalize(e),a];i=o(t.toHash(r,Ge))}else i=[...n.finalize(e),o(a)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(yt),xt=(...e)=>Tt(kt(...e));xt.raw=(...e)=>kt(...e);const{mergeCss:kt}=function(e){function t(t){const r=function(...e){return e.flat().filter(e=>$e(e)&&Object.keys(qe(e)).length>0)}(...t);return 1===r.length?r:r.map(t=>nt(t,e))}return{mergeCss:Ze(function(...e){return et(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(yt);function wt(){let e,t="",r=0;for(;r<arguments.length;)(e=arguments[r++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Ct=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Et(e){const{base:t,variants:r,defaultVariants:n,compoundVariants:o}=Ct(e),a=e=>({...n,...qe(e)});function i(e={}){const n=a(e);let i={...t};for(const[t,o]of Object.entries(n))r[t]?.[o]&&(i=kt(i,r[t][o]));const l=function(e,t){let r={};return e.forEach(e=>{Object.entries(e).every(([e,r])=>"css"===e||(Array.isArray(r)?r:[r]).some(r=>t[e]===r))&&(r=kt(r,e.css))}),r}(o,n);return kt(i,l)}const l=Object.keys(r),s=Object.fromEntries(Object.entries(r).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(Ze(function(e){return xt(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const a=Ct(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(r));return Et({base:kt(t,a.base),variants:Object.fromEntries(i.map(e=>[e,kt(r[e],a.variants[e])])),defaultVariants:et(n,a.defaultVariants),compoundVariants:[...o,...a.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const r=Object.getOwnPropertyDescriptors(e),n=Object.keys(r),o=e=>{const t={};for(let n=0;n<e.length;n++){const o=e[n];r[o]&&(Object.defineProperty(t,o,r[o]),delete r[o])}return t};return t.map(e=>o(Array.isArray(e)?e:n.filter(e))).concat(o(n))}(e,l)},getVariantProps:a})}var It,St=((It=St||{}).component="component",It["dashboard-placeholder-table"]="dashboard-placeholder-table",It["dashboard-header"]="dashboard-header",It["dashboard-table"]="dashboard-table",It["dashboard-table-body"]="dashboard-table-body",It["dashboard-table-cell"]="dashboard-table-cell",It["dashboard-table-column-header"]="dashboard-table-column-header",It["dashboard-table-header"]="dashboard-table-header",It.label="label",It.popup="popup",It["popup-sort-row"]="popup-sort-row",It["progress-bar"]="progress-bar",It["progress-bar-fill"]="progress-bar-fill",It.summation="summation",It["table-parent-row"]="table-parent-row",It["table-row"]="table-row",It["table-sub-row"]="table-sub-row",It.tile="tile",It["tile-bar-label"]="tile-bar-label",It["tile-body"]="tile-body",It["tile-filter-button"]="tile-filter-button",It["tile-filter-list"]="tile-filter-list",It["tile-filter-row"]="tile-filter-row",It["tile-header"]="tile-header",It["tile-title"]="tile-title",It.title="title",It["business-owner-dashboard"]="business-owner-dashboard",It["business-owner-dashboard-header"]="business-owner-dashboard-header",It["business-owner-table"]="business-owner-table",It["transaction-type-label"]="transaction-type-label",It["selector-row"]="selector-row",It["popup-list"]="popup-list",It.badge="badge",It["date-cell"]="date-cell",It["expander-cell"]="expander-cell",It["vertical-divider"]="vertical-divider",It["horizontal-divider"]="horizontal-divider",It["table-cell-divider"]="table-cell-divider",It["checkbox-input"]="checkbox-input",It["bulk-select"]="bulk-select",It["button-base"]="button-base",It["button-discrete-small"]="button-discrete-small",It["button-primary"]="button-primary",It["button-secondary"]="button-secondary",It["button-tertiary"]="button-tertiary",It["button-danger"]="button-danger",It["button-warning"]="button-warning",It["button-action"]="button-action",It.text="text",It["cell-button"]="cell-button",It["month-picker-left-button"]="month-picker-left-button",It["month-picker-right-button"]="month-picker-right-button",It["filter-bar"]="filter-bar",It["filter-search-bar"]="filter-search-bar",It["filter-pill"]="filter-pill",It["discrete-form-input"]="discrete-form-input",It["editable-form-input"]="editable-form-input",It["category-text"]="category-text",It["amount-input-container"]="amount-input-container",It["amount-input"]="amount-input",It["modal-popup"]="modal-popup",It["drawer-header"]="drawer-header",It["drawer-header-border"]="drawer-header-border",It["form-body"]="form-body",It.body="body",It.heading="heading",It["sub-label"]="sub-label",It["strong-label"]="strong-label",It["strong-sub-label"]="strong-sub-label",It["metric-xl"]="metric-xl",It["metric-md"]="metric-md",It["large-icon"]="large-icon",It["medium-icon"]="medium-icon",It["small-icon"]="small-icon",It["tiny-icon"]="tiny-icon",It["neutral-badge"]="neutral-badge",It["highlight-badge"]="highlight-badge",It["success-badge"]="success-badge",It["warning-badge"]="warning-badge",It["critical-badge"]="critical-badge",It["button-group"]="button-group",It["alert-dialog"]="alert-dialog",It["emphasis-label"]="emphasis-label",It["profit-loss-graph"]="profit-loss-graph",It.banner="banner",It["banner-high"]="banner-high",It["banner-medium"]="banner-medium",It["banner-low"]="banner-low",It["banner-urgent"]="banner-urgent",It["banner-default"]="banner-default",It["banner-button"]="banner-button",It["banner-button-text"]="banner-button-text",It["banner-button-icon"]="banner-button-icon",It["empty-dashboard-layout"]="empty-dashboard-layout",It["zero-state-layout"]="zero-state-layout",It["emphasis-sub-label"]="emphasis-sub-label",It);const At="Tight-",Nt=e=>`${At}${e}`;function Pt(e){return e in St}function Mt(e){const t=e.indexOf("-"),r=e.slice(0,t+1),n=e.slice(t+1);return r===At&&n in St}function Dt(e){return!Pt(e)&&!Mt(e)}const Rt=(e,...t)=>{const r=[],n=[];return null!==e&&r.push(Nt(e)),t.forEach(e=>{void 0!==e&&(Dt(e)?n.push(e):Pt(e)&&r.push(Nt(e)))}),{className:wt(...r,...n)}},Ot=Rt(St["business-owner-dashboard-header"],xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80}));function _t({children:e}){return w("div",{...Ot,children:e})}function Lt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Mt(t)&&e.push(t),e),[])],[])}function Ft(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Dt(t)&&e.push(t),e),[])],[])}function Bt(e){const t=Array.isArray(e)?e:[e];return{className:wt(...Lt(t),...Ft(t))}}const Wt=Et({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"}}}}),Ht=Rt(St.heading,Wt({heading:"default"}));function Ut({children:e,stylists:t=[]}){const r=Bt([Ht,...t]);return w("div",{...r,children:e})}function Vt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function zt(e,t,r){return new Date(e,t,r)}function jt(e,t){return Vt(zt(t,e,1))}const Kt={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 Kt.THIS_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear(),0,1));case Kt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return jt(e.getMonth(),e.getFullYear())}();case Kt.LAST_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case Kt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth()-1,1))}();case Kt.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear()-1,e.getMonth(),1))}();default:return""}},qt=e=>{switch(e){case Kt.THIS_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case Kt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth()+1,0))}();case Kt.LAST_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear(),0,0));case Kt.PAST_YEAR:case Kt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth(),0))}();default:return""}},Yt=e=>{return t=e,Object.values(Kt).includes(t)?{beginDate:$t(e),endDate:qt(e)}:{beginDate:Vt((r=e).beginDate),endDate:Vt(r.endDate)};var t,r},Gt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Qt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Xt({yearsBack:e=10,startYear:t}){const r=t??/* @__PURE__ */(new Date).getFullYear(),n=[r];for(let o=r-1;o>=r-e;o--)n.push(o);return n}function Zt(e,t){return e.toDateString()===t.toDateString()}function Jt(e){return Zt(e,/* @__PURE__ */new Date)}function er(e,t){const r=zt(e.getFullYear(),e.getMonth(),e.getDate()),n=zt(t.getFullYear(),t.getMonth(),t.getDate());return r.getTime()>n.getTime()}function tr(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 rr(e,t,r){if(e<1||e>12||t<1||t>31)return!1;const n=zt(r,e-1,t);return!(n.getFullYear()!==r||n.getMonth()!==e-1||n.getDate()!==t)}function nr(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,r,n,o]=t,a=parseInt(r,10),i=parseInt(n,10),l=parseInt(o,10);return rr(a,i,l)?zt(l,a-1,i):null}function or(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})$/);if(!t)return null;const[,r,n,o]=t,a=parseInt(r,10),i=parseInt(n,10),l=parseInt(o,10);return rr(i,l,a)?zt(a,i-1,l):null}function ar(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:""}const ir=(e,t)=>{const r={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",r)},lr=e=>{const t=new Date(e||""),r=/* @__PURE__ */new Date;return Jt(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===r.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):ir(t,{abbreviateMonth:!0,abbreviateYear:!1})};function sr(e,t,r){return[...e,{accessToken:t,environment:r}]}function cr(e,t){return[...e,t]}const dr=e=>null==e,ur=e=>!dr(e);function hr(e){return dr(e)||""===e.trim()}function pr(e){return!hr(e)}const gr=h({activeToken:void 0,accountantToken:void 0});function mr(){const{activeToken:e}=p(gr);return e}const vr=()=>{throw new Error("No access token provided")},br=72e5,fr=new I({defaultOptions:{queries:{gcTime:br,staleTime:3e4,refetchInterval:6e4}}}),yr=h("SANDBOX");function Tr(){return p(yr)}function xr({queryKey:e,queryFn:t,...r}){const n=mr(),o=Tr(),a=pr(n),i=sr(e,n??"",o),l=S(),s=A({...r,queryKey:i,queryFn:a?t:vr,placeholderData:r.keepPreviousDataPlaceholder?N:void 0,...a?{}:{retry:!1,staleTime:1/0}},fr);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class kr{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:r,payloadVersion:n}){const o=/* @__PURE__ */(new Date).toISOString(),a=JSON.stringify({apiKey:e,payloadVersion:n,notifier:r,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":n,"Bugsnag-Sent-At":o},referrerPolicy:"no-referrer",body:a})}}const wr=Symbol("Circular"),Cr=Symbol("AccessError");function Er(e,t,r){return Ir({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:r?.depthLimit,edgeIndex:0,edgesLimit:r?.edgesLimit})}function Ir({key:e,value:t,replacer:r,seen:n,depthLimit:o=1/0,depth:a,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(n.includes(s)&&(s=wr),r&&(s=r(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Sr(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(a>o||i+1>l)return"[...]";if(n.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=Sr(()=>s[i]);e.push(Ir({key:i,value:t,replacer:r,seen:n,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=Sr(()=>s[c]);e[c]=Ir({key:c,value:d,replacer:r,seen:n,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l})}s=e}return n.pop(),s}function Sr(e){try{return e()}catch{return Cr}}const Ar=Object.prototype.toString,Nr=Object.getPrototypeOf;function Pr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Dr=/^(eval@)?(\[native code])?$/;function Rr(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const r=t[2]?parseInt(t[2],10):void 0,n=t[3]?parseInt(t[3],10):void 0;return[t[1],r,n]}function Or(e,t){const r=_r(e,t);let n;"InvalidError"===r.name&&(n={[t]:{"non-error parameter":e}}),void 0!==r.metadata&&Pr(r.metadata)&&(n={...n,[r.name]:r.metadata});const o=[Lr(r)];return o.push(...Wr(r).map(e=>Lr(e,{backtrace:!1}))),{exceptions:o,metadata:n}}function _r(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===Ar.call(t))return!0;t=Nr(t)}return!1}(e))return e;let r=function(e){if(!Pr(e))return null;const t=t=>{const r=e[t];if("string"==typeof r&&e[t.length])return r},r=t("name")||t("errorClass"),n=t("message")||t("errorMessage");if(!r||!n)return null;const o=new Error(n);return o.name=r,o}(e);if(r)return r;switch(typeof r){case"string":case"number":case"boolean":return new Error(String(e));default:return r=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),r.name="InvalidError",r}}function Lr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:Fr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function Fr(e,{backtrace:t}){const r=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 r?function(e){return(e.match(Mr)?e.split("\n").filter(e=>!!e.match(Mr)).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 r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),o=Rr(r?r[1]:n.pop()||"(no location)"),a=n.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0],lineNumber:o[1],columnNumber:o[2],method:a}}):(t=e,t.split("\n").filter(e=>!e.match(Dr)).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=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=Rr(e.replace(t,""));return{file:o[0],lineNumber:o[1],columnNumber:o[2],method:n}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let r=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";r=r.replace(/\?.*$/,"").replace(/#.*$/,"");let n=t.method||"(unknown function)";return n=/^global code$/i.test(n)?"global code":n,e.concat([{file:r,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:n}])},[]);var t}(r):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<Br;){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 Br=20;function Wr(e){const t=e;if(t.cause){const e=_r(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Wr(e))}return[]}function Hr(...e){console.error}const Ur={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 Vr=Date.now();const zr=()=>{Vr=Date.now()},jr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-Vr,!0}),{reset:zr})},Kr=[["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\)$/]],$r=[["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/]],qr=(Yr=function(e){const t=""!==(r=e)&&Kr.reduce((e,[t,n])=>{if(e)return e;const o=n.exec(r);return!!o&&[t,o]},!1);var r;if(!t)return{};const[n,o]=t,a=function(e){for(const[t,r,n]of $r)if(n.exec(e))return{osName:t,osVersion:r};return null}(e),i="iOS"===a?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:n,browserVersion:o[1],osName:a?.osName,osVersion:a?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...Yr(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 Yr;class Gr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new M}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 Qr extends g{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:r,metadata:n}=Or(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let r="";for(let n=0,o=t.length;n<o;n++)t[n].length&&(r+=`${r.length?"\n":""}${t[n]}`);return r}(t.componentStack));const{onError:o,client:a}=this.props;a.notifyEvent({exceptions:r,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...n,react:t},onError:o},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return w(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return w(C,{children:this.props.children})}}const Xr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:r,children:n})=>w(Qr,{client:e,onError:t,FallbackComponent:r,children:n})})},Zr=new class{breadcrumbs=[];config;delivery=new kr(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return Hr(),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 r of this.config.plugins||[])this.plugins.push({name:r.name||"unknown",plugin:r.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:r,metadata:n}=Or(e,"notify");let o,a,i=n;return"function"==typeof t?o=t:(a=t.severity,t.metadata&&(i={...n,...t.metadata})),this.notifyEvent({exceptions:r,metadata:i,severity:a,onError:o},e)}leaveBreadcrumb(e,t,r){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:r||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:n=25}=this.config;this.breadcrumbs.length>n&&this.breadcrumbs.splice(0,this.breadcrumbs.length-n)}async notifyEvent({exceptions:e,unhandled:t,severity:r,severityReason:n,metadata:o,onError:a},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:r||"warning",severityReason:n,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:o||{}},c=[...this.errorCallbacks];a&&c.push(a);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=Er(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){Hr()}}getUser(){return this.config?.user||{}}setUser(e,t,r){this.config&&(this.config.user={id:e,email:t,name:r})}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 Jr="",en="";const tn="prod",rn=Zr.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"1.2.0",appType:"browser",releaseStage:tn,plugins:[jr,qr,Ur,(()=>{const e=new Gr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),Xr]}),nn=(e,t)=>{try{Zr.leaveBreadcrumb(e,t)}catch(r){r instanceof Error?on({error:r,severity:"error"}):on({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:r}})}},on=async e=>{try{await Zr.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:Jr,environment:en}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await on({error:t,severity:"error"}):await on({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},an=rn.getPlugin("react"),ln=an?.BugsnagErrorBoundary,sn=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,cn=({extraHeaders:e,authorization:t})=>{const r={...e};return void 0!==t&&(r.Authorization=t),r},dn=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},un={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function hn(e){const t=(({accessToken:e,extraHeaders:t})=>{const r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...r}:r})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?un:{}}});return{url:(r=e.endpointManager.getUrl(e.path),n=e.pathParams,void 0!==n&&Object.entries(n).forEach(([e,t])=>{r=r.replace(`{${e}}`,t)}),r),headers:t};var r,n}async function pn({authorization:e,extraHeaders:t,includeCredentials:r,method:n="POST",params:o,url:a}){const i=cn({extraHeaders:t,authorization:e});nn("HTTP POST Request",{url:a,accessToken:e});try{const e=await fetch(a,{method:n,headers:i,credentials:"include",body:JSON.stringify(o)});return nn("HTTP POST Response",{url:a,status:e.status,statusText:e.statusText}),dn(e)}catch(l){return Promise.reject(l)}}async function gn(e){const{url:t,headers:r}=hn(e);return pn({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:r})}async function mn(e){return gn(e)}async function vn(e){return gn(e)}const bn=(e,t)=>({getUrl:t=>((e,t)=>{let r=t;for(;r.length>0&&"/"===r.charAt(0);)r=r.slice(1);return`${e}/${r}`})(e,t),baseUrl:e,apiVersion:t}),fn={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},yn={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Tn={...yn,LOCAL:"http://localhost:8082"};function xn(e){return bn(`${t=e,fn[t]}/v5`,"v5");var t}const kn=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],wn=async e=>{const t=e.queryKey,r=t[1],n=t[2].accessToken,o=t[2].environment,a={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...Yt(r.filter),...r.grouping&&{grouping:r.grouping}},accessToken:n,endpointManager:xn(o)};return await vn(a)};function Cn({filter:e,grouping:t,select:r}){return xr({queryKey:kn({filter:e,grouping:t}),queryFn:wn,select:r})}const En="noDataHeight";function In(e){const t=function(e){const t=or(e??"");return null!==t?ir(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}(e.period?.beginDate),r=e.netIncome??0,{profit:n,remainingIncome:o,loss:a,remainingExpenses:i}=function(e,t,r){const n=e>0?e:0,o=e<0?e:0;return{profit:n,remainingIncome:void 0!==t?D(t).minus(n).toNumber():0,loss:o,remainingExpenses:void 0!==r?D(r).plus(o).toNumber():0}}(r,e.income?.total,e.expenses?.total);return{month:{month:t,income:o,expenses:-i,profit:n,loss:a,netIncome:r,hasNoData:/* @__PURE__ */function(e,t,r){return 0===e&&0===t&&0===r}(r,o,i)},netIncome:r}}function Sn(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const r=e.json?.data;if(dr(r))return t;for(const i of r){const{month:e,netIncome:r}=In(i);t.total=D(r).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:n,domainMax:o}=r.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=[n,o],t.hasAnyData=t.months.some(e=>!e.hasNoData);const a=function(e,t){const r=t-e;return r>0?.03*r:3}(n,o);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:a}:e),t}const An=Rt(St["tile-header"],xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Nn({title:e}){return w("div",{...An,children:w(Ut,{children:e})})}const Pn=Rt(St["tile-body"],xt({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 Mn({children:e}){return w("div",{...Pn,children:e})}const Dn=Et({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 Rn({children:e,type:t,isSample:r=!1}){const n=Rt(St.tile,Dn({type:t,isSample:r}));return w("div",{...n,children:e})}const On=xt({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),_n=xt.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),Ln=xt({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),Fn=Rt(St.text,xt({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On);function Bn({children:e}){return w("div",{...Fn,children:e})}const Wn=Rt(St["metric-xl"],Wt({metric:"xl"}));function Hn(e){return w("div",{...Wn,children:e.children})}const Un=Rt(St.summation,xt({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function Vn({title:e,label:t}){return E("div",{...Un,children:[w(Hn,{children:e}),w(Bn,{children:t})]})}const zn=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function jn({children:e}){return w("div",{...zn,children:e})}const Kn=(e,t=0)=>{const r=Math.abs(e);let n;if(t<=0)n=Math.round(r);else{const e=r.toFixed(t);n=parseFloat(e)}return Math.sign(e)*n},$n=(e,t=0,r=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:r}),qn=1e9;function Yn(e,{cents:t="default",condense:r=!1,dollarSign:n=!1,signage:o="default"}={}){const a="string"==typeof e?parseFloat(e):e;if(Number.isNaN(a))return"";let i;const l=Math.abs(a);let s;if(r&&l>99999){s=Math.sign(a)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),r=Math.round(l/t),n=r*t;let o,c=r/1e3;l<qn&&c>=1e3&&(c/=1e3),n>=qn?o="B":n>=1e6?o="M":(c=Math.round(c),o="K"),i=`${$n(c,0,1)}${o}`}else{let e;const r=2,n=0;let o,l;"floor"===t?(o=n,l=n,c=a,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(o=n,l=n,e=Kn(a,o)):"always"===t?(o=r,l=r,e=Kn(a,o)):"default"===t&&Math.abs(a)>=1e3?(o=n,l=n,e=Kn(a,o)):(o=r,e=Kn(a,o),l=e%1==0?n:r),s=Math.sign(e)<0;const d=Math.abs(e);i=$n(d,l,o)}var c,d;let u=i;const h=n?"$":"";return void 0===o||"off"===o?u=i:"parens"===o?u=`${h}${s?`(${i})`:i}`:"always"===o?u=`${s?"-":"+"}${h}${i}`:"default"===o&&(u=`${s?"-":""}${h}${i}`),u}function Gn(e){return Yn(e,{condense:!0,dollarSign:!0})}function Qn(e){return Yn(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const Xn={"sm-sm":Rt(St.text,xt({fontSize:{sm:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"sm-med":Rt(St.text,xt({fontSize:{sm:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"sm-lg":Rt(St.text,xt({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-sm":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-med":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-lg":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On)};function Zn({children:e,size:t,weight:r,stylists:n=[]}){const o=Bt([Xn[`${t}-${r}`],...n]);return w("div",{title:e,...o,children:e})}const Jn=Et({variants:{wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function eo({wrap:e="ellipsis",textAlign:t="start",children:r,stylists:n=[]}){if(hr(r))return null;const o=Rt(St["strong-label"],Wt({label:"strongLabel"}),Jn({wrap:e,textAlign:t}));return w(Zn,{size:"med",weight:"med",stylists:[o,...n],children:r})}const to=Et({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:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}}}});function ro({intent:e,wrap:t="ellipsis",children:r,accent:n}){const o=void 0===e&&void 0===n?"normal":void 0,a=Rt(St["sub-label"],to({intent:o,wrap:t,accent:n}),On);return hr(r)?null:w("div",{...a,children:r})}const no=Rt(null,xt({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 oo({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===En)return null;let r=t[0].value??0;return"expenses"===t[0].dataKey?r+=t[0].payload.loss:"income"===t[0].dataKey&&(r+=t[0].payload.profit),E("div",{...no,children:[w(eo,{children:t[0].name??""}),w(ro,{children:Gn(Number(r))})]})}const ao={"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)"},"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 io(e,t){return ao[e]?.value||t}io.var=function(e,t){return ao[e]?.variable||t};const lo=Rt(null,xt({borderRadius:"50%",flexShrink:0})),so=Rt(null,xt({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),co=io.var("colors.surface.foreground.disabled");function uo({color:e=co,diameter:t=17,label:r}){return E("div",{...so,"data-testid":"bullet-row",children:[w("div",{...lo,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),r&&w(ro,{children:r})]})}const ho=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function po({payload:e}){return void 0===e?null:w("div",{...ho,children:e.map((e,t)=>"none"!==e.type&&w(uo,{color:e.color,label:e.value,diameter:17},t))})}const go={right:20,left:20},mo=["income","profit","expenses","loss"],vo=e=>mo.findIndex(t=>t===e.dataKey),bo={paddingBottom:"20px",marginLeft:"-20px"},fo={stackId:"stack",isAnimationActive:!1},yo=Rt(St["profit-loss-graph"],xt({"& .recharts-surface":{outline:"none"}})),To=io.var("colors.money"),xo=io.var("colors.border.layout"),ko=io.var("colors.border.layout.strong"),wo={fill:io.var("colors.typography.base"),fontSize:io.var("fontSizes.metric.sm")},Co={profit:io.var("colors.money.positive"),income:io.var("colors.money.positive.weak"),loss:io.var("colors.money.negative"),expenses:io.var("colors.money.negative.weak")},Eo=[0,100],Io=["auto","auto"];function So({data:e}){const[t,r]=m(!0);if(void 0===e)return null;const n=e.hasAnyData?Io:Eo;return w(R,{width:"100%",height:"100%",...yo,children:E(O,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:go,children:[w(_,{verticalAlign:"top",itemSorter:vo,wrapperStyle:bo,content:({payload:e})=>w(po,{payload:e})}),w(L,{strokeDasharray:"0",vertical:!1,stroke:xo}),w(F,{dataKey:"month",interval:0,tickLine:!1,stroke:xo,tick:wo}),w(B,{type:"number",tickCount:7,domain:n,axisLine:!1,tickLine:!1,stroke:xo,tick:wo,tickFormatter:e=>Gn(e)}),w(W,{content:({active:e,payload:t})=>w(oo,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),w(H,{name:"Profit",dataKey:"profit",fill:Co.profit,...fo}),w(H,{name:"Income",dataKey:"income",fill:Co.income,...fo}),w(H,{name:"Loss",dataKey:"loss",fill:Co.loss,...fo}),w(H,{name:"Expenses",dataKey:"expenses",fill:Co.expenses,...fo}),w(H,{dataKey:En,fill:xo,legendType:"none",...fo}),w(U,{y:0,stroke:ko}),w(V,{dataKey:"netIncome",fill:To,stroke:To,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>r(!0),onAnimationEnd:()=>r(!1)})]})})}const Ao=xt({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 No({styles:e}){const t=Rt(null,Ao,e);return w("div",{...t,"data-testid":"shimmer-block"})}const Po=xt({width:"40%",minHeight:65});function Mo({children:e}){return E(C,{children:[w(No,{styles:Po}),w(jn,{children:e})]})}const Do=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),Ro=xt({width:"80px",height:"17px",marginBottom:"10px"}),Oo=xt({width:"100%",height:"100%"});function _o(){return E(C,{children:[E("div",{...Do,children:[w(No,{styles:Ro}),w(No,{styles:Ro}),w(No,{styles:Ro}),w(No,{styles:Ro})]}),w(No,{styles:Oo})]})}const Lo=Et({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 Fo({size:e}){const t=Lo({size:e});return w("div",{className:t,children:"Sample"})}const Bo=20200,Wo=5043,Ho=Object.freeze({income:Bo,expenses:Wo,netIncome:15157,absoluteSum:Math.abs(Bo)+Math.abs(Wo)}),Uo=Object.freeze({total:Wo,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),Vo=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),zo=[{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 jo({filter:e=Kt.PAST_YEAR,isSample:t=!1}){const{query:{data:r},isFilling:n}=function({filter:e,grouping:t}){return Cn({filter:e,grouping:t,select:Sn})}({filter:e,grouping:"MONTHLY"}),o=t?function(){const e=[],t=/* @__PURE__ */new Date;let r=0,n=0,o=0;for(let a=11;a>=0;a--){const i=new Date(t.getFullYear(),t.getMonth()-a,1),l=ir(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=zo[11-a],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),r+=c,n=Math.max(n,s.income),o=Math.max(o,s.expenses)}return{total:r,domain:[-o,n],months:e,hasAnyData:!0}}():r;return E(Rn,{type:"chart",children:[w(Nn,{title:"Profit + Loss"}),w(Mn,{children:n?w(Mo,{children:w(_o,{})}):E(C,{children:[w(Vn,{title:Gn(o?.total??0),label:"Profit"}),w(jn,{children:w(So,{data:o})})]})}),t&&w(Fo,{size:"xl"})]})}const Ko=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}));function $o({children:e}){return w("div",{...Ko,children:e})}const qo="conversations-section",Yo="transactions-section",Go={MESSAGE_REVIEW:qo,TRANSACTION_REVIEW:Yo,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},Qo={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},Xo={resolutionStatus:{in:["OPEN"]}},Zo=[],Jo=[];function ea(e){return bn(`${t=e,yn[t]}`,"v6");var t}const ta={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"},ra=e=>["tasks",e??{}],na={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},oa=async e=>{const t=e.queryKey,r=t[1],n={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...r},endpointManager:ea(t[2].environment)},o=await mn(n);return"SUCCESS"===o.result&&void 0!==o.data?{data:o.data}:{data:void 0}},aa=Et({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 ia(e,t){const r=({size:t=24,fill:r="transparent",stylists:n})=>{const o=Bt([Rt(null,aa()),...n]);return w(e,{...o,style:{minHeight:t,minWidth:t},width:t,height:t,fill:r})};return r.displayName=t,r}const la=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),sa=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"#182428",strokeMiterlimit:10})),"ArrowRight"),ca=xt({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"}}),da=xt({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),ua=xt({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});xt({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}});const ha=xt({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}}),pa=h({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function ga({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["small-icon"]),...t??[]],size:12})}const ma=Rt(null,xt({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}})),va=Rt(null,xt({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"}}),da),ba=Rt(null,xt({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center"})),fa=Rt(null,xt({height:{sm:"12px",base:"20px"},width:{sm:"12px",base:"20px"}}));function ya(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:r,pageBackwards:n}=function(){const e=p(pa);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return E("div",{...ma,children:[w("div",{...ba,children:w("button",{...va,onClick:n,disabled:!t,children:w(ga,{Component:la,stylists:[fa]})})}),w("div",{...ba,children:w("button",{...va,onClick:r,disabled:!e,children:w(ga,{Component:sa,stylists:[fa]})})})]})}const Ta=xt({width:"100%",height:"50px"});function xa(){return w(No,{styles:Ta})}const ka=Rt(St["dashboard-placeholder-table"],xt({display:"flex",flexDirection:"column",gap:"4px"})),wa=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Ca=xt({width:"100px",height:"20px"});function Ea({numColumns:e=6}){return E("div",{...ka,children:[w("div",{...wa,children:Array.from({length:e},(e,t)=>w(No,{styles:Ca},t))}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{})]})}function Ia(e,t){const r=mr(),n=Tr();return v(o=>{const a=pr(r),i=a?{}:{retry:!1,staleTime:1/0};return fr.prefetchQuery({queryKey:sr(e(o),r??"",n),queryFn:a?t:vr,...i})},[e,t,r,n])}const Sa=Object.freeze({}),Aa=Object.freeze({cursor:"FINAL_PAGE"});function Na({queryKey:e,queryFn:t,...r}){const[n,o]=m(Sa),i=d(e);a(i.current,e)||(i.current=e,o(Sa));const l=xr({...r,queryKey:cr(e,n),queryFn:t,keepPreviousDataPlaceholder:!0}),s=u(()=>{return e=l.query.data?.cursor,t=o,{getFirstPage:()=>t(Sa),getLastPage:()=>t(Aa),hasNextPage:ur(e?.after),hasPreviousPage:ur(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[l.query.data?.cursor]),c=Ia(v(t=>cr(e,t),[e]),t),h=Ia(v(t=>cr(e,t),[e]),t);return b(()=>{const e=l.query.data?.cursor;!l.query.isFetching&&e&&(e.after&&c({cursor:e.after}).catch(e=>{on({error:e,severity:"error"})}),e.before&&h({cursor:e.before}).catch(e=>{on({error:e,severity:"error"})}))},[l.query.data?.cursor,l.query.isFetching,c,h]),{...l,paginationControls:s}}async function Pa({authorization:e,extraHeaders:t,includeCredentials:r,params:n,url:o,cache:a}){const i=cn({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let r=e;const n=null==(o=t)?"":Object.entries(o).map(([e,t])=>{let r;return r=Array.isArray(t)?t.map(t=>sn(e,t)).join("&"):sn(e,t),r}).join("&");var o;return""!==n&&(r+=`?${n}`),r})({url:o,params:n});nn("HTTP GET Request",{url:o,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:a});return nn("HTTP GET Response",{url:o,status:e.status,statusText:e.statusText}),dn(e)}catch(s){return Promise.reject(s)}}async function Ma(e){const{url:t,headers:r}=hn(e);return Pa({url:t,params:e.params,includeCredentials:!0,extraHeaders:r})}async function Da(e){return Ma({...e,endpointManager:ea(e.environment)})}async function Ra(e){return Ma({...e,endpointManager:xn(e.environment)})}function Oa({delay:e,callback:t}){const r=u(()=>function({delay:e,callback:t}){let r;const n=()=>{r&&(clearTimeout(r),r=void 0)};return{startCallback:o=>{n(),r=setTimeout(()=>{t(o)},e)},cancelCallback:()=>n()}}({delay:e,callback:t}),[e,t]);return b(()=>()=>{r.cancelCallback()},[r]),{startCallback:v(e=>{r.startCallback(e)},[r]),cancelCallback:v(()=>{r.cancelCallback()},[r])}}function _a({prefetchFn:e}){const{startCallback:t,cancelCallback:r}=Oa({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:r}}const La={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"},Fa={ASC:"ASC",DESC:"DESC"},Ba=e=>["conversations",e??{}],Wa=e=>["conversations","conversation",e],Ha=async e=>{const t=e.queryKey,r={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ea(t[3].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data,cursor:n.cursor}:{data:void 0,cursor:void 0}};function Ua(e){return Na({queryKey:e?Ba(e):["conversations",{}],queryFn:Ha})}const Va=async e=>{const t=e.queryKey,{id:r}=t[2],n={path:"/v6/conversations/{id}",pathParams:{id:r},accessToken:t[3].accessToken,environment:t[3].environment},o=await Da(n);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null};function za(e){const t=ur(e);return xr({queryKey:Wa({id:e??""}),queryFn:Va,enabled:t})}const ja=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:ea(r)};return await mn(n)};function Ka(){return _a({prefetchFn:Ia(Wa,Va)})}function $a(e){const t=e.getSize(),r=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==r?`${r}px`:"auto"}}function qa({header:e}){const t=$a(e.column);return w("div",{...Rt(St["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:z(e.column.columnDef.header,e.getContext())})}const Ya=Rt(St["dashboard-table-header"],xt({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function Ga({headerGroups:e}){return w("div",{children:e.map(e=>f("div",{...Ya,key:e.id},e.headers.map(e=>w(qa,{header:e},e.id))))})}const Qa=Rt(St["dashboard-table-body"],xt({display:"flex",flexDirection:"column"}));function Xa({children:e}){return w("div",{...Qa,children:e})}const Za=Et({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 Ja({alignment:e="vertical",color:t="normal",additionalClassName:r}){const n=Rt("vertical"===e?St["vertical-divider"]:St["horizontal-divider"],r,Za({alignment:e,color:t}));return w("div",{...n})}function ei(){return w(Ja,{additionalClassName:St["table-cell-divider"]})}function ti({cell:e,index:t,onCellClick:r,shouldDisplayDivider:n}){const o=$a(e.column),a=Rt(St["dashboard-table-cell"],xt({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Rt(null,xt({display:"flex",flexDirection:"row",height:"100%"})),l=n(t);return E("div",{...i,style:o,onClick:()=>{r&&r(e)},children:[l&&w(ei,{}),w("div",{style:o,...a,children:z(e.column.columnDef.cell,e.getContext())})]})}const ri=Rt(St["table-sub-row"],xt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function ni({rowData:e,onCellClick:t,shouldDisplayDivider:r}){const n=e.getVisibleCells();return w("div",{...ri,children:n.map((e,n)=>w(ti,{cell:e,index:n,onCellClick:t,shouldDisplayDivider:r,isChild:!0},e.id))})}const oi=xt({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),ai=xt({background:"surface.background"}),ii=Rt(St["table-row"],xt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{sm:"60px",base:"85px"},minWidth:"fit-content"}));function li({rowData:e,onMouseEnter:t,onMouseLeave:r,onCellClick:n,shouldDisplayDivider:o}){const a=e.getIsExpanded(),i=Rt(St["table-parent-row"],oi,e.index%2==0?ai:void 0),l=e.getVisibleCells();return E("div",{...i,onMouseEnter:t,onMouseLeave:r,children:[w("div",{...ii,children:l.map((e,t)=>w(ti,{cell:e,index:t,onCellClick:n,shouldDisplayDivider:o},e.id))}),a&&w("div",{children:e.subRows.map(e=>w(ni,{rowData:e,onCellClick:n,shouldDisplayDivider:o},e.id))})]})}const si=(e,t={})=>{Le.getState().openDrawer(e,t)},ci=()=>{Le.getState().closeDrawer()},di={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},ui={ASC:"ASC",DESC:"DESC"},hi=e=>["banks/transactions",e??{}],pi=e=>["banks/transactions",e.id],gi=async e=>{const t=e.queryKey,r={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ea(t[3].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data,cursor:n.cursor}:{data:void 0,cursor:void 0}};function mi(e){return Na({queryKey:hi(e),queryFn:gi})}const vi=async e=>{const t=e.queryKey,r={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},n=await Da(r);return"SUCCESS"===n.result&&void 0!==n.data?n.data:null};function bi({id:e}){return xr({queryKey:pi({id:e}),queryFn:vi})}function fi(){return _a({prefetchFn:Ia(pi,vi)})}const yi={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 Ti(e,t){return!hr(e)&&e.startsWith(t)}function xi({id:e,prefix:t}){return void 0!==e?`${yi[t]}_${e}`:""}const ki=e=>["conversations/messages",e];function wi(e){if(dr(e)||0===e.length)return null;const t=[[e[0]]];for(let r=1;r<e.length;r++){const n=e[r],o=t[t.length-1],a=o[0].author.userId;n.author.userId===a?o.push(n):t.push([n])}return t}const Ci=async e=>{const t=e.queryKey,{id:r}=t[1],n={path:"/v6/conversations/{id}/messages",pathParams:{id:r},accessToken:t[2].accessToken,environment:t[2].environment},o=await Da(n);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null},Ei=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:ea(r),accessToken:t};return await mn(n)};function Ii(){return _a({prefetchFn:Ia(ki,Ci)})}const Si=e=>["summaries",e??{}],Ai=e=>["summaries",e.id],Ni=async e=>{const t=e.queryKey,r={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:ea(t[2].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data}:{data:void 0}};const Pi=async e=>{const t=e.queryKey,r={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},n=await Da(r);return"SUCCESS"===n.result&&void 0!==n.data?n.data:null};function Mi({rowData:e,isMobile:t}){const{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),{startPrefetch:i,cancelPrefetch:l}=fi(),{startPrefetch:s,cancelPrefetch:c}=_a({prefetchFn:Ia(Ai,Pi)}),d=v(()=>{ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),o({id:e.original.id}),r({id:e.original.id})},[e.original.attachedEntityId,e.original.id,o,r,i,s]),u=v(()=>{ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.BANK_TRANSACTION)?l():ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.FINANCIAL_SUMMARY)&&c(),a(),n()},[l,c,n,a,e.original.attachedEntityId]);return w(li,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,r)=>{r?si("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):ur(t)?Ti(t,yi.BANK_TRANSACTION)?si("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Ti(t,yi.FINANCIAL_SUMMARY)&&(n=e,o=t,si("FinancialSummary",{routeProps:{conversationId:n,summaryId:o}})):function(e){si("Conversation",{routeProps:{conversationId:e}})}(e);var n,o})(e.original.id,e.original.attachedEntityId,t)})}const Di=ia(e=>c.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},c.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),c.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),Ri=xt({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}}),Oi=xt({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"}}),_i=xt({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),Li=xt({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),Fi=xt.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"}}),Bi=Et({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%"}}}}),Wi={default:_i,small:Li},Hi=e=>{const t=Wi[e];return Rt(St["button-base"],t,Ri,ca)},Ui=["default","small"],Vi={default:{className:""},small:{className:""}};for(const kT of Ui)Vi[kT]=Hi(kT);const zi=y(function({children:e,stylists:t=[],type:r="button",onClick:n,disabled:o,size:a="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=Bt([Vi[a],Rt(null,Bi({width:i})),...t]);return w("button",{ref:u,...h,type:r,onClick:n,disabled:o,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),ji=Rt(St["button-primary"],Oi),Ki=y(function({children:e,active:t,stylists:r=[],width:n,...o},a){return w(zi,{ref:a,stylists:[ji,...r],active:t,width:n,...o,children:e})}),$i=()=>{si("Conversation",{routeProps:{conversationId:null}})};function qi(){return w(Ki,{onClick:$i,children:w(ga,{Component:Di})})}const Yi=Et({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 Gi({children:e,dashboard:t}){const r=Rt(St["dashboard-table"],Yi({dashboard:t}));return w("div",{...r,children:e})}const Qi=h(null),Xi="mobile",Zi=Et({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:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function Ji({children:e,intent:t="default",wrap:r="ellipsis",alignment:n="left"}){const o=Rt(St.label,Zi({intent:t,wrap:r,alignment:n}));return hr(e)?null:w("div",{title:"ellipsis"===r?e:void 0,...o,children:e})}const el=Rt(St["emphasis-label"],xt({lineHeight:"16px"}));function tl({children:e}){return w(Zn,{size:"med",weight:"lg",stylists:[el],children:e})}function rl({text:e,isRead:t}){return w(t?Ji:tl,{children:e})}const nl=Et({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 ol({children:e,alignVariant:t="flexStart"}){const r=Rt(null,nl({alignVariant:t}));return w("div",{...r,children:e})}function al({date:e,isRead:t=!1}){const r=lr(e);return w(rl,{text:r,isRead:t})}const il=Rt(St["strong-sub-label"],Wt({label:"strongSubLabel"}));function ll({children:e,stylists:t=[]}){return hr(e)?null:w(Zn,{size:"sm",weight:"med",stylists:[il,...t],children:e})}const sl=h(null),cl=xt({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),dl=Rt(St["selector-row"],xt({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:"flex-start",gap:"9px",flexShrink:0,textAlign:"start",cursor:"pointer","&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}));function ul(e,t,r){const[n,o]=m(e);return[t??n,r??o]}function hl({children:e}){return null===ae()?w(ie,{children:e}):e}function pl({children:e,modal:t=!1,initialOpen:r,placement:n,offsetPx:o,open:a,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:r=0,modal:n,open:o,onOpenChange:a,enableClickMiddleware:i=!0}={}){const[l,s]=m(),[c,d]=m(),[h,p]=ul(e,o,a),g=Y(),v=G({placement:t,open:h,nodeId:g,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||p(e)},whileElementsMounted:ee,middleware:[Q(r),X({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),Z({padding:8}),J({apply({availableHeight:e,elements:t}){let r=e;if(e<314){const t=37*Math.floor(e/37)-18.5;r=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${r}px`,overflowY:"auto"})},padding:8})]}),b=v.context,f=te(b,{enabled:i}),y=re(b,{bubbles:{escapeKey:!0}}),T=ne(b),x=oe([f,y,T]);return u(()=>({open:h,setOpen:p,...x,...v,modal:n,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:g}),[h,p,x,v,n,l,c,g])}({modal:t,initialOpen:r,placement:n,offsetPx:o,open:a,onOpenChange:i,enableClickMiddleware:s}),d=ae(),h=l&&null===d,p=c.nodeId;return w(hl,{children:w(le,{id:p,children:w(sl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:h},children:e})})})}function gl(){const e=p(sl);if(null==e)throw new Error("Popup components must be wrapped in <PopupManager />");return e}function ml({children:e}){const t=gl(),r=t.refs.setReference,n=t.open?"open":"closed",o={...t.getReferenceProps(),ref:r,"data-state":n};return w(C,{children:e(o)})}const vl=ia(e=>c.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),c.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function bl({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["tiny-icon"]),...t??[]],size:9})}const fl=ia(e=>c.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),c.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),c.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),yl=Rt(null,xt({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"}}),ca),Tl=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),xl=Rt(null,xt({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"}})),kl=Rt(null,xt({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function wl({onClearClick:e,columnName:t,active:r,popupTriggerProps:n}){const o=r||"open"===n?.["data-state"];return E("div",{...yl,"data-active":o,children:[E("button",{...Tl,...n,children:[w(ll,{children:t}),!o&&w("div",{...kl,children:w(bl,{Component:fl})})]}),o&&w("button",{...xl,onClick:e,children:w(bl,{Component:vl})})]})}const Cl=Et({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 El({initialFocus:e=!0,style:t,ref:r,type:n,...o}){const{context:a,blockInteraction:i,...l}=gl(),s=se([l.refs.setFloating,r]),c=Rt(St.popup,Cl({type:n}));return a.open?E(C,{children:[i&&w(ce,{lockScroll:!0}),w(de,{children:w(ue,{context:a,modal:l.modal,initialFocus:e?void 0:-1,children:w("div",{ref:s,...c,style:{...l.floatingStyles,...t},...l.getFloatingProps(o),"aria-labelledby":l.labelId,"aria-describedby":l.descriptionId,children:o.children})})})]}):null}const Il=Rt(St["popup-sort-row"],xt({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 Sl({onClick:e,children:t,active:r}){return w("button",{onClick:e,...Il,children:w(ro,{accent:r?"active":"action",children:t})})}const Al=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),Nl=Rt(null,xt({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function Pl({sortDef:e,sortAscDisplay:t,sortDescDisplay:r,handleSortClick:n,sortInstance:o}){const a=gl(),i=e=>{n(e),a?.setOpen(!1)},l=o?.orderBy===e&&"ASC"===o?.direction,s=o?.orderBy===e&&"DESC"===o?.direction;return E("div",{...Al,children:[w(ll,{stylists:[Nl],children:"Sort by:"}),w(Sl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),w(Sl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:r})]})}const Ml=xt(Fi,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}}),Dl=Rt(St["button-discrete-small"],Ml,ca);function Rl({children:e,active:t,disabled:r,onClick:n,popupTriggerProps:o,ariaLabel:a,ariaExpanded:i}){const[l,s]=m(!1),c=t??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(o?.["data-state"]);return w("button",{type:"button",...Dl,onClick:e=>{void 0===c&&s(!l),n&&n(e)},"data-active":c??l,disabled:r,...o,"aria-label":a,"aria-expanded":i,children:e})}const Ol={minWidth:"140px"};function _l({columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n}){const o=p(Qi);if(!o)return null;const{sortInstance:a,setSortInstance:i}=o,l=a?.orderBy===t,s=()=>{i(void 0)};return t&&r&&n?E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>w(wl,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),w(El,{style:Ol,children:w(Pl,{sortDef:t,sortAscDisplay:r,sortDescDisplay:n,handleSortClick:e=>{i(e)},sortInstance:a})})]}):w(Rl,{disabled:!0,children:w(ll,{children:e})})}const Ll=Rt(null,xt({paddingLeft:"19px"}));function Fl({columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n}){return w("div",{...Ll,children:w(_l,{columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n})})}const Bl="Oldest to Newest",Wl="Newest to Oldest";const Hl=h({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0});function Ul({authorUserId:e,isRead:t}){const{userRole:r,userId:n}=p(Hl);let o="";return e===n?o="Me":"OWNER"===r?o="Bookkeeper":"ACCOUNTANT"===r&&(o="User"),w(rl,{text:o,isRead:t})}const Vl=Rt(St.text,xt({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),On);function zl({children:e,stylists:t=[]}){const r=Bt([Vl,...t]);return w("div",{...r,children:e})}const jl=Rt(St["emphasis-sub-label"],Wt({label:"emphasisSubLabel"}));function Kl({children:e}){return hr(e)?null:w(Zn,{size:"sm",weight:"lg",stylists:[jl],children:e})}const $l=xt({display:"grid",gridTemplateColumns:"3fr 1fr",border:"none",borderRadius:0,padding:"10px",width:"100%",cursor:"pointer",backgroundColor:"transparent",alignItems:"start"}),ql=wt(xt({display:"flex",flexDirection:"column",alignItems:"start",gap:"2px",maxWidth:"100%"}),On),Yl=xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end",gap:"2px"});function Gl({sender:e,subject:t,date:r,message:n,isRead:o,handleFormOpen:a}){return E("button",{className:$l,onTouchEnd:a,children:[E("div",{className:ql,children:[w(Ul,{authorUserId:e,isRead:o}),w(o?ro:Kl,{children:t}),w(ro,{children:n})]}),E("div",{className:Yl,children:[w(al,{date:r,isRead:o}),o?w(ga,{Component:sa}):w(zl,{children:w(ga,{Component:sa})})]})]})}const Ql=j(),Xl=Rt(null,xt({paddingLeft:"25px"})),Zl=[Ql.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>w(ol,{children:w(Ul,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"From"}),size:150,maxSize:150}),Ql.accessor("subject",{id:"subject",cell:({row:e})=>w(ol,{children:w(rl,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"Subject"}),size:150}),Ql.accessor("latestMessage.text",{id:"message",cell:({row:e})=>w(ol,{children:w(rl,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"Message"}),size:200}),Ql.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>w(ol,{children:w(al,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>w(Fl,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:Wl,sortAscDisplay:Bl}),size:130,maxSize:130}),Ql.display({id:Xi,cell:({row:e})=>w(Gl,{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 Jl(e){return e?Zl.filter(e=>e.id===Xi):Zl.filter(e=>e.id!==Xi)}const es=[],ts=xt({display:"flex",flexDirection:"column",height:"250px",width:"100%",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),rs=Rt(St["empty-dashboard-layout"],ts);function ns({children:e}){return w("div",{...rs,"data-testid":"empty-dashboard-layout",children:e})}function os({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["large-icon"]),...t??[]],size:25})}const as=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),is=()=>{si("Conversation",{routeProps:{conversationId:null}})};function ls(){return E(C,{children:[w(os,{Component:as}),w(eo,{wrap:"wrap",children:"Need help with your financials?"}),w(Ki,{onClick:is,children:w(eo,{children:"Talk to a bookkeeper"})})]})}function ss(){return E(C,{children:[w(os,{Component:as}),w(eo,{wrap:"wrap",children:"All caught up"}),w(ro,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const cs=Rt(null,xt({display:"flex",flexDirection:"row",gap:"5px"}));function ds({children:e}){return w("div",{...cs,children:e})}const us=Et({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function hs(e){return w(e?ss:ls,{})}function ps({sortInstance:e,setSortInstance:t,conversations:r,paginationControls:n,isFilling:o,isMobile:a}){const i=function({conversations:e,isMobile:t}){return K({data:e??es,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??es.length,columns:Jl(t),getCoreRowModel:$(),getRowId:e=>e.id})}({conversations:r,isMobile:a}),{query:{data:l},isFilling:s}=Ua({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!dr(l?.data?.[0])&&!s;return E("div",{className:us({isMobile:a}),children:[w("div",{id:qo}),E(pa.Provider,{value:n,children:[E(_t,{children:[w(Ut,{children:"Conversations"}),E(ds,{children:[w(ya,{}),w(qi,{})]})]}),w(Gi,{dashboard:"businessOwnerDashboard",children:o?w(Ea,{numColumns:4}):E(C,{children:[!a&&w(Qi.Provider,{value:{sortInstance:e,setSortInstance:t},children:w(Ga,{headerGroups:i.getHeaderGroups()})}),r.length>0?w(Xa,{children:i.getRowModel().rows.map(e=>w(Mi,{rowData:e,isMobile:a},e.id))}):w(ns,{children:hs(c)})]})})]})]})}const gs=Rt(St.body,Wt({body:"default"}));function ms({children:e,stylists:t=[]}){if(hr(e))return null;const r=Bt([gs,...t]);return w("div",{...r,children:e})}const vs=Rt(null,xt({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),bs=Et({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),fs=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function ys(){return w("div",{...vs,children:fs.map((e,t)=>w(No,{styles:bs({width:e?.width})},t))})}const Ts=ia(e=>c.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),xs=xt({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}"}),ks=xt({position:"relative",width:"25px",height:"25px"});function ws({hasUnread:e}){return E("div",{className:ks,children:[w(os,{Component:Ts}),e&&w("div",{"data-testid":"unread-comment-badge",className:xs,"aria-hidden":"true"})]})}const Cs=xt({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 Es({hasUnreadMessages:e=!1,showMessageIndicator:t}){return E("div",{className:Cs,children:[w(eo,{children:"Message Bookkeeper"}),t&&w(ws,{hasUnread:e})]})}const Is=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function Ss(){return E("div",{className:Is,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),w(ro,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),w(Ki,{onClick:()=>si("Conversation"),children:w(eo,{children:"Talk to a bookkeeper"})})]})}const As=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ns({summaryId:e,conversationId:t}){const{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),i=v(()=>{o({id:t}),r({id:t})},[t,o,r]),l=v(()=>{a(),n()},[a,n]);return E("div",{className:As,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),w(ro,{wrap:"wrap",children:"Pick up where you left off."}),w(Ki,{onClick:()=>si("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:w(eo,{children:"Continue conversation"})})]})}const Ps=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ms({summaryId:e}){return E("div",{className:Ps,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),w(ro,{wrap:"wrap",children:"Your bookkeeper will respond here."}),w(Ki,{onClick:()=>si("FinancialSummary",{routeProps:{summaryId:e}}),children:w(eo,{children:"Talk to a bookkeeper"})})]})}function Ds({summaryId:e,conversationId:t}){const r=ur(t);return dr(e)?w(Ss,{}):r?w(Ns,{conversationId:t,summaryId:e}):w(Ms,{summaryId:e})}const Rs=xt({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"}),Os=xt({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 _s({summaryData:e}){const t=ur(e?.summary),r=ur(e?.conversation);return E("div",{className:Rs,children:[w(Es,{showMessageIndicator:t&&r,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),w("div",{className:Os,children:w(Ds,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const Ls=xt({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),Fs=Et({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:{}}}}),Bs=Rt(null,xt({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),Ws=xt({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function Hs({isSample:e,period:t}){const{query:{data:r},isFilling:n}=function(e){return r={select:e=>e?.data?.[0]},xr({queryKey:(t={limit:1,filter:{date:{equal:jt(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Si(t):["summaries",{}],queryFn:Ni,...r});var t,r}(t),o=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${Bo.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${Wo.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.`}():r?.summary??"A summary of this month's financials will appear here once more data is available.";return E("div",{className:Ws,children:[w("div",{"data-testid":"financial-summary-layout",className:Fs({isSample:e}),children:!e&&n?w(ys,{}):E("div",{className:Ls,children:[w(ms,{stylists:[Bs],children:o}),e&&w(Fo,{size:"lg"})]})}),w(_s,{summaryData:r})]})}async function Us(e){const{url:t,headers:r}=hn(e);return async function(e){const{authorization:t,extraHeaders:r,params:n,url:o}=e,a=cn({extraHeaders:r,authorization:t});nn("HTTP DELETE Request",{url:o,accessToken:t});try{const e=await fetch(o,{method:"DELETE",headers:a,credentials:"include",body:JSON.stringify(n)});return nn("HTTP DELETE Response",{url:o,status:e.status,statusText:e.statusText}),dn(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:r})}function Vs({mutationFn:e,onMutateFn:t,...r}){const n=mr(),o=Tr(),a=!hr(n);return P({...r,mutationFn:a?t=>e({data:t,accessToken:n,environment:o}):vr,onMutate:a&&ur(t)?e=>t({data:e,accessToken:n,environment:o}):void 0},fr)}const zs=async e=>{const t=e.queryKey,r={path:"/banks/plaidItems",accessToken:t[1].accessToken,environment:t[1].environment};return await Ra(r)};function js(e){return xr({...e,queryKey:["banks/plaidItems"],queryFn:zs})}function Ks(){return js({select:e=>{return t=e,t?.filter(e=>"ACTIVE"===e.status);var t}})}const $s=async({data:e,accessToken:t,environment:r})=>{const n={path:"/banks/integration",bodyParams:{id:e.id,removeFromApi:!0},accessToken:t,endpointManager:xn(r)};return await async function(e){return Us(e)}(n)};function qs(){return Vs({mutationFn:$s,onSuccess:()=>{const e=["banks/plaidItems"];return fr.invalidateQueries({queryKey:e})}})}const Ys=Rt(St["button-danger"],xt({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 Gs({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Ys,...t],...r,children:e})}const Qs=Rt(St["button-tertiary"],xt({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 Xs({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Qs,...t],...r,children:e})}const Zs="cancel",Js="danger",ec="success",tc=Rt(null,xt({position:"fixed",inset:0,minHeight:"100dvh",display:"grid",placeItems:"center",backgroundColor:"overlay"})),rc=Rt(St["alert-dialog"],xt({background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",padding:"16px",maxWidth:"360px",gap:"16px",minWidth:0,margin:"32px"})),nc=Rt(null,xt({display:"flex",justifyContent:"flex-end",gap:"8px"})),oc="success",ac="danger",ic=he.createConfirmation(pe(function({show:e,proceed:t,title:r,body:n,buttons:o=[{key:"ok",type:"default",label:"OK"}]}){const{context:a}=G({open:e,strategy:"fixed"}),i=re(a,{outsidePress:!1,escapeKey:!0}),l=ne(a,{role:"alertdialog"}),{getFloatingProps:s}=oe([i,l]);return e?w(de,{children:w(ce,{lockScroll:!0,...tc,children:w(ue,{context:a,modal:!0,returnFocus:!0,children:E("div",{...s(),...rc,children:[w(eo,{wrap:"wrap",children:r}),n&&"string"==typeof n?w(Ji,{wrap:"wrap",children:n}):w(C,{children:n}),w("div",{...nc,children:o.map(e=>{const r=(e=>{switch(e){case ac:return Gs;case oc:return Xs;default:return Ki}})(e.type);return w(r,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:w(eo,{children:e.label})},e.key)})})]})})})}):null}));function lc(e){return bn(`${t=e,fn[t]}/v1`,"v1");var t}const sc=[{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 cc({institutionId:e,accessToken:t,environment:r}){if(!t)throw new Error("Access token is required to get Plaid item institution");const n={path:"/banks2/bankUrl",accessToken:t,endpointManager:lc(r)},{url:o,headers:a}=hn(n);return await Pa({url:o,includeCredentials:!0,extraHeaders:a,params:e?{institutionId:e}:void 0})}function dc(e,t,r,n){const o=1===r?e:t;return n?`${r} ${o}`:o}const uc=async({error:e,metadata:t,additionalInfo:r})=>{const n=await(e=>{const t=(e?.institution?.name?`${e.institution.name} failed to link.`:"Something went wrong.")+" Please try again later.";return ic({title:"Uh oh!",body:t,buttons:[{key:"cancel",label:"Cancel"},{key:"success",label:"Chat"}]})})(t);var o;"success"===n&&(o=e?.error_code?`I need help with my ${t?.institution?.name||"Plaid"} bank connection (code: ${e.error_code}).`:`I need help with my ${t?.institution?.name||"Plaid"} bank connection. ${r||""}`,si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:o}}}))};function hc(e,t){const r=mr(),n=Tr(),[o,a]=m(""),{open:i,ready:l}=function(e,t,r){return ge({token:e,onSuccess:async(e,n)=>{try{const{plaidItem:i}=await async function({publicToken:e,metadata:t,accessToken:r,environment:n}){if(!r)throw new Error("Access token is required to create Plaid link token");const o={path:"/banks2/webPlaidPublicToken",accessToken:r,endpointManager:lc(n)},{url:a,headers:i}=hn(o);return await pn({url:a,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:n,accessToken:t,environment:r});await(o=i.apiInstitutionName,a=i.plaidItemAccounts.length,ic({title:"All set! Ready to track your transactions?",body:`Your ${a} ${o} ${dc("account","accounts",a)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:ec,label:"Get started",type:oc}]})),on({error:new Error("Plaid Public Token exchanged successfully"),severity:"info",extraData:{metadata:n,publicToken:e}}),await fr.invalidateQueries()}catch(i){on({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:n,publicToken:e,error:i}}),uc({additionalInfo:"Error exchanging Plaid public token."})}var o,a},onExit:(t,r)=>{ur(t)?(on({error:new Error(t?.error_message),severity:"error",extraData:{metadata:r,error:t,token:e}}),uc({error:t,metadata:r})):on({error:new Error("Plaid Link exited by user without error"),severity:"info",extraData:{metadata:r,token:e}})},onEvent:(e,t)=>{on({error:new Error(`Plaid event: ${e}`),severity:"info",extraData:{metadata:t,eventName:e}})}})}(o,r,n);return b(()=>{l&&o&&(i(),t?.())},[l,i,o,t]),{linkPlaid:async()=>{try{const t=await async function({accessToken:e,plaidItemId:t,environment:r}){if(!e)throw new Error("Access token is required to create Plaid link token");const n={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:lc(r)},{url:o,headers:a}=hn(n);return Pa({url:o,includeCredentials:!0,extraHeaders:a,params:t?{plaidItemId:t}:void 0})}({accessToken:r,plaidItemId:e,environment:n});on({error:new Error("Plaid Link Token created successfully"),severity:"info",extraData:{accessToken:r,plaidItemId:e}}),a(t.link_token)}catch(t){on({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:r,plaidItemId:e,error:t}}),uc({additionalInfo:"Error creating Plaid link token."})}}}}const pc=h({dimensions:{width:null,height:null}});function gc(){const{dimensions:e}=p(pc);return ur(e.width)&&e.width<parseInt(io("sizes.breakpoint-sm"))}const mc={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},vc={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."}},bc={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INVALID_MFA:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.invalidUpdatedUsername,buttonType:mc.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:vc.short.accountLocked,longMessage:vc.long.accountLocked,buttonType:mc.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.supportChanged,buttonType:mc.CHAT},USER_SETUP_REQUIRED:{shortMessage:vc.short.updateNeeded,longMessage:vc.long.updateNeeded,buttonType:mc.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.mfaUpdateNeeded,buttonType:mc.OPEN_BANK},NO_ACCOUNTS:{shortMessage:vc.short.noAccountsAvailable,longMessage:vc.long.noAccountsUnlink,buttonType:mc.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:vc.short.noAccountsAvailable,longMessage:vc.long.noAccountsUnlink,buttonType:mc.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},ITEM_NOT_FOUND:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PRODUCT_NOT_READY:{shortMessage:vc.short.serverError,longMessage:vc.long.productNotReady,buttonType:mc.CHAT},USER_PERMISSION_REVOKED:{shortMessage:vc.short.connectionError,longMessage:vc.long.permissionRevoked,buttonType:mc.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:vc.short.serverDown,longMessage:vc.long.serverDown,buttonType:mc.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.supportChanged,buttonType:mc.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PLANNED_MAINTENANCE:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankConnectionMaintenance,buttonType:mc.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:vc.short.requestError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:vc.short.inputError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:vc.short.volumeDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:vc.short.updateNeeded,longMessage:vc.long.partnerCredsChange,buttonType:mc.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:vc.short.credentialsExpiring,longMessage:vc.long.credentialsExpiring,buttonType:mc.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:vc.short.relinkNeeded,longMessage:vc.long.relinkForStatements,buttonType:mc.RELINK}},DEFAULT:{DEFAULT:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:vc.short.generic,longMessage:vc.long.generic,buttonType:mc.CHAT}}};function fc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return on({error:new Error("No bank error provided. Should not get here"),severity:"error"}),bc.DEFAULT.DEFAULT;const r=bc[e];if(!r)return on({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),bc.DEFAULT.DEFAULT;return(r[t]??r.DEFAULT)||(on({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),bc.DEFAULT.DEFAULT)}function yc(e,t,r,n,o){return()=>ic({title:e?.shortMessage(t)||"Bank Error",body:e?.longMessage({apiInstitutionName:t,apiPartnerName:r,isMobile:n}),buttons:o})}function Tc(e,t,r,n,o,a){return{alert:yc(e,t,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Chat",type:oc}]),actions:{success:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${r} - ${n}`}}})}}}function xc(e){const{mutate:t}=qs(),r=mr(),n=Tr(),{apiPartnerName:o}=p(Hl),a=gc(),{linkPlaid:i}=hc(e?.id);if(dr(e))return Tc(fc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN","UNKNOWN","UNKNOWN","",!1);const l=fc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),s="ITEM_LOCKED"===e.apiErrorCode;switch(l.buttonType){case mc.DELETE_OR_RELINK:case mc.RELINK:return c=l,d=e.apiInstitutionName,u=i,{alert:yc(c,d,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Relink",type:oc}]),actions:{success:()=>{u()}}};case mc.UNLINK_RELINK:return function(e,t,r,n,o,a,i,l,s){return{alert:yc(e,t,l,s,[{key:Zs,label:"Cancel"},{key:mc.CHAT,label:"Chat"},{key:ec,label:"Unlink and Relink",type:oc}]),actions:{success:()=>{a({id:String(r)}),i()},[mc.CHAT]:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${n} - ${o}`}}})}}}(l,e.apiInstitutionName,e.id,e.apiErrorType,e.apiErrorCode,t,i,o,a);case mc.OPEN_BANK:return function(e,t,r,n,o,a,i,l,s,c,d){return{alert:yc(e,t,c,d,[{key:Zs,label:"Cancel"},{key:mc.CHAT,label:"Chat"},{key:mc.RELINK,label:"Relink"},{key:ec,label:"Go To Bank",type:oc}]),actions:{success:async()=>{const e=await cc({institutionId:r,accessToken:i,environment:l}),t=a?e.map.accountLockedUrl:e.map.accountSetupUrl;t&&window.open(t,"_blank")},[mc.RELINK]:()=>{s()},[mc.CHAT]:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${n} - ${o}`}}})}}}(l,e.apiInstitutionName,e.apiInstitutionId,e.apiErrorType,e.apiErrorCode,s,r,n,i,o,a);case mc.UNLINK_ONLY:return function(e,t,r,n,o,a){return{alert:yc(e,t,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Unlink",type:oc}]),actions:{success:()=>{n({id:String(r)})}}}}(l,e.apiInstitutionName,e.id,t,o,a);default:return Tc(l,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,o,a)}var c,d,u}const kc=async(e,t)=>{const r=await e();"string"==typeof r&&t[r]&&await t[r]()},wc={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function Cc(e,t=!0){const r=fc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:r?.shortMessage(e.apiInstitutionName)||"",description:t&&"RELINK"===r?.buttonType&&r?.longMessage({apiInstitutionName:e.apiInstitutionName,isMobile:!1,apiPartnerName:""})||"",type:r?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}const Ec=async e=>{const t=e.queryKey,r={path:"/banks/accounts",accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r),o=void 0!==n.data?n.data.map(e=>({...e,id:xi({id:e.id,prefix:"BANK_ACCOUNT"})})):[];return{...n,data:o}};function Ic(e){return xr({...e,queryKey:["banks/accounts"],queryFn:Ec})}const Sc=e=>{const{query:{data:t}}=Ic({select:t=>{return r=t?.data,n=e,r?.find(e=>e.id===n);var r,n}});return t},Ac=e=>void 0!==e?.find(e=>"PLAID"===e.apiName),Nc=e=>{if(dr(e))return!1;const t=e.filter(e=>"PLAID"===e.apiName&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||ur(e.lastApiSyncedDate))};function Pc(e){return e?.filter(e=>"USER_IMPORTED"===e.apiName&&"ACTIVE"===e.status)}const Mc=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),Dc=Rt(St["month-picker-left-button"],xt({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),Rc=Rt(St["month-picker-right-button"],xt({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),Oc=Rt(null,xt({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function _c({period:e,setPeriod:t,disableNext:r=!1,disablePrev:n=!1}){const o=zt(e.year,e.month,1),a=ir(o,{abbreviateMonth:!0});return E("div",{...Mc,children:[w(Ki,{stylists:[Dc],onClick:()=>{return t(0===(r=e).month?{month:11,year:r.year-1}:{month:r.month-1,year:r.year});var r},disabled:n,children:w(ga,{Component:la})}),w("div",{...Oc,children:w(eo,{children:a})}),w(Ki,{stylists:[Rc],onClick:()=>{return t(11===(r=e).month?{month:0,year:r.year+1}:{month:r.month+1,year:r.year});var r},disabled:r,children:w(ga,{Component:sa})})]})}const Lc=xt({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function Fc({children:e}){return w("div",{className:Lc,children:e})}const Bc=Rt(St["progress-bar"],xt({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),Wc=Rt(St["progress-bar-fill"],xt({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),Hc=Rt(St["tile-bar-label"],xt({paddingLeft:"10px"}));function Uc({label:e="",percentage:t,color:r,width:n}){const o=void 0===n?"100%":`${n}px`,a=t>=50,i=Bt([Wc,Rt(null,r)]);return E("div",{...Bc,style:{width:o},children:[w("div",{...i,style:{width:`${t}%`},children:a&&w("div",{...Hc,children:w(Ji,{children:e})})}),!a&&w("div",{...Hc,children:w(Ji,{children:e})})]})}const Vc=Rt(St["metric-md"],Wt({metric:"md"}));function zc(e){return w("div",{...Vc,children:e.children})}const jc=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),Kc=Rt(null,xt({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),$c=({label:e,amount:t,total:r,colorCss:n})=>{const o=r>0?function(e,t,r,n=0,o=100){return n+(e-t)*(o-n)/(r-t)}(t,0,r):0;return E("div",{...jc,children:[w(Uc,{label:e,percentage:o,color:n}),w("div",{...Kc,children:w(zc,{children:Gn(t)})})]})},qc={netIncome:0,income:0,expenses:0,absoluteSum:0},Yc=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return qc;const t=e.json?.data?.[0];if(dr(t))return qc;const r=t.income?.total??0,n=t.expenses?.total??0,o=D(r).plus(n).toNumber();return{netIncome:t.netIncome??0,income:r,expenses:n,absoluteSum:o}},Gc=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),c.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),c.createElement("path",{d:"M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356",strokeMiterlimit:10}),c.createElement("path",{d:"M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671",strokeMiterlimit:10})),"Sync");function Qc({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["medium-icon"]),...t??[]],size:15})}const Xc=Rt(null,Ri,xt({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"}}}}),ca);function Zc(){const{linkPlaid:e}=hc();return E("button",{onClick:()=>e(),...Xc,children:[w(Qc,{Component:Gc}),w(Ji,{intent:"primary",children:"Link Account"})]})}const Jc=xt({width:266,minHeight:32});function ed(){return w(No,{styles:Jc})}const td=xt({backgroundColor:"money.positive.weak"}),rd=xt({backgroundColor:"money.negative.weak"}),nd=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),od=({defaultRange:e=Kt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:r})=>{const{query:{data:n},isFilling:o}=function({filter:e}){return Cn({filter:e,select:Yc})}({filter:e});let a;return a=t?Ho:n??nd,E(Rn,{isSample:t,children:[w(Nn,{title:"Profit + Loss"}),w(Mn,{children:o?E(Mo,{children:[w(ed,{}),w(ed,{})]}):E(C,{children:[w(Vn,{title:Gn(a.netIncome),label:"Profit"}),E(jn,{children:[w($c,{amount:a.income,total:a.absoluteSum,colorCss:td,label:"Income"}),w($c,{amount:a.expenses,total:a.absoluteSum,colorCss:rd,label:"Expenses"})]})]})}),t&&w(Fo,{size:"sm"}),r&&w(Zc,{})]})},ad=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],id={moneyIn:0,moneyOut:0,netMoneyIn:0};const ld=async e=>{const t=e.queryKey,r=t[2],n=t[3].accessToken,o=t[3].environment,a={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...Yt(r.filter)},accessToken:n,endpointManager:xn(o)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,r=e.json?.data[0];return t||dr(r)||dr(r.operatingActivities)||!r.operatingActivities.children?id:function(e){let t=new D(0),r=new D(0);for(const n of e.children)n.total<0?r=r.plus(D(n.total).abs()):t=t.plus(n.total);return{moneyIn:t.toNumber(),moneyOut:r.toNumber(),netMoneyIn:e.total}}(r.operatingActivities)}(await vn(a))},sd=xt({backgroundColor:"money.positive.weak"}),cd=xt({backgroundColor:"money.negative.weak"}),dd=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),ud=({defaultRange:e=Kt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:r})=>{const{query:{data:n,isFetched:o},isFilling:a}=function({filter:e}){return xr({queryKey:ad({filter:e}),queryFn:ld})}({filter:e});let i;i=t?Vo:n??dd;let l=0;return(t||o)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),E(Rn,{isSample:t,children:[w(Nn,{title:"Cash Flow"}),w(Mn,{children:a?E(Mo,{children:[w(ed,{}),w(ed,{})]}):E(C,{children:[w(Vn,{title:Gn(i.netMoneyIn),label:"Change in Cash"}),E(jn,{children:[w($c,{amount:i.moneyIn,total:l,colorCss:sd,label:"Money In"}),w($c,{amount:i.moneyOut,total:l,colorCss:cd,label:"Money Out"})]})]})}),t&&w(Fo,{size:"sm"}),r&&w(Zc,{})]})},hd=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),pd=Rt(null,xt({display:"flex",justifyContent:"end"}));function gd({color:e,bulletLabel:t,moneySummary:r}){return E("div",{...hd,children:[w(uo,{color:e,label:t}),w("div",{...pd,children:w(Ji,{children:r})})]})}const md={total:0,children:[]},vd=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,r=e.json?.data?.[0];return t||dr(r)||dr(r.expenses)||!r.expenses.children?md:{total:r.expenses.total??0,children:(n=r.expenses.children,n.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var n},bd=Rt(null,xt({display:"flex",gap:"10px",alignItems:"center"})),fd=xt({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),yd=Rt(null,fd);function Td({bulletAmount:e=3,shimmer:t=!1}){return w(C,{children:Array.from({length:e},(e,r)=>E("div",{...bd,children:[w(uo,{color:io.var("colors.brand.secondary")}),t?w(No,{styles:fd}):w("div",{...yd})]},r))})}const xd=Rt(null,xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),kd=[io.var("colors.brand.primary"),io.var("colors.brand.success"),io.var("colors.brand.action")],wd=Object.freeze({total:0,children:[]});function Cd({defaultRange:e=Kt.THIS_YEAR,monthIndex:t,isSample:r=!1,showLinkAccountButton:n}){const o=Le(e=>e.externalOptions).dataVisualizationColors??kd,{query:{data:a},isFilling:i}=function({filter:e}){return Cn({filter:e,select:vd})}({filter:e});let l;l=r?Uo:a??wd;const s=void 0===t?"Total Expenses":`${Qt[t]} Total`,c=l.children.length>0;return E(Rn,{isSample:r,children:[w(Nn,{title:"Expenses"}),w(Mn,{children:i?w(Mo,{children:w(Td,{shimmer:!0})}):E(C,{children:[w("div",{...xd,children:w(Vn,{title:Gn(l.total),label:s})}),w(jn,{children:c?l.children.map((e,t)=>w(gd,{color:o[t],bulletLabel:e.name,moneySummary:Gn(e.total)},t)):w(Td,{})})]})}),r&&w(Fo,{size:"sm"}),n&&w(Zc,{})]})}const Ed=Rt(null,xt({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Id({period:e,handleDateChange:t,todayPeriod:r,showSamples:n,showLinkAccountButton:o}){const a=(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 E("div",{...Ed,children:[E(_t,{children:[w(Ut,{children:"Monthly Review"}),w(_c,{period:e,setPeriod:t,disableNext:n||(s=e,c=r,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:n})]}),E(Fc,{children:[w(od,{defaultRange:a,isSample:n,showLinkAccountButton:o}),w(ud,{defaultRange:a,isSample:n,showLinkAccountButton:o}),w(Cd,{defaultRange:a,monthIndex:e.month,isSample:n,showLinkAccountButton:o})]})]})}const Sd="Oldest to Newest",Ad="Newest to Oldest",Nd="A-Z",Pd="Z-A",Md="Lowest to Highest",Dd="Highest to Lowest",Rd="A-Z",Od="Z-A";const _d=ia(e=>c.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{id:"icon/check"},c.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check"),Ld=xt({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"}}}),Fd=xt({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Bd=xt({background:"brand.primary.strong",border:"none"});function Wd({checked:e,onClick:t}){const[r,n]=m(e??!1),o=void 0===e?r:e;return w("button",{...Rt(St["checkbox-input"],Ld,o?Bd:Fd,da),type:"button",onClick:o=>{void 0===e&&n(!r),t&&t(o)},"data-is-checked":o,children:o&&w(bl,{Component:_d})})}const Hd=Rt(null,xt({paddingLeft:"20px",paddingRight:"5px"}));function Ud({checked:e,onClick:t}){return w("div",{...Hd,children:w(Wd,{checked:e,onClick:t})})}const Vd=Rt(St.text,xt({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),On);function zd({children:e}){return w("div",{...Vd,children:e})}const jd=Rt(St["date-cell"],xt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function Kd({date:e,annotation:t}){return E("div",{...jd,children:[t&&w(zd,{children:t}),w(Ji,{children:e})]})}const $d=xt({color:"money.negative"}),qd=xt({color:"money.positive"});function Yd({transaction:e}){const t=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let r;return r=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:r,css:t?qd:$d}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?$d:qd}})(e);break;case"BANK_TRANSFER":t=(e=>{let t="Bank Transfer";return e.children?.length>0&&(t="Payout"),{type:"BANK_TRANSFER",displayName:t,css:e.amount<0?$d:qd}})(e);break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:$d};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",r=qd;return e.amount<0&&(t="Invoice Payment Refund",r=$d),{type:"INVOICE_PAYMENT",displayName:t,css:r}})(e)}return t})(e),r=Rt(St["transaction-type-label"],t.css),n=w("span",{...r,children:t.displayName});return w(Kd,{date:e.date,annotation:n})}function Gd({label:e,subLabel:t}){return E(C,{children:[w(eo,{children:e}),w(ro,{children:t})]})}function Qd({bankTransaction:e}){return w(Gd,{label:e.description,subLabel:e.bankAccount?.name})}function Xd(e){return new D(e).div(100).toNumber()}function Zd(e){return new D(e).times(100).toNumber()}function Jd(e){return Qn(Xd(e.amount))}function eu({transaction:e}){return w(Ji,{children:Jd(e)})}const tu=Rt(null,xt({padding:"0 25px",height:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}));function ru({annotation:e,accountName:t}){return E("div",{...tu,children:[e&&w(ro,{children:e}),t&&w(eo,{children:t})]})}function nu(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}const ou=Rt(St["cell-button"],xt({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"}}),da),au=y(function({children:e,...t},r){return w("button",{ref:r,...ou,...t,children:e})}),iu=h(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function lu(e,t){switch(t.type){case"increment":return((e,t)=>{let r;if(null===e.focusedIndex)r=0;else{const n=e.focusedIndex+1;r=!t.repeat&&n>e.maxIndex?0:Math.min(n,e.maxIndex)}return{...e,focusedIndex:r}})(e,t);case"decrement":return((e,t)=>{let r;if(null===e.focusedIndex)r=e.maxIndex;else{const n=e.focusedIndex-1;r=!t.repeat&&n<0?e.maxIndex:Math.max(n,0)}return{...e,focusedIndex:r}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function su(e,t){const r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}function cu(e,t){const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top>=r.top&&n.bottom<=r.bottom&&n.left>=r.left&&n.right<=r.right}function du(e,t,r){if(null===e)return{node:void 0,metadata:void 0};const n=t[e];return{node:n,metadata:r.get(n)}}function uu(e){const[t,r]=m(()=>/* @__PURE__ */new Map),{listRef:n,focusedState:o,isMousing:a,isScrolling:i}=function(e,t){const r=d(null),[n,o]=m(!0),[a,i]=m(!1),l=p(iu),[s,c]=T(lu,{focusedIndex:null,maxIndex:e});b(()=>{const e=r.current,t=()=>{null==s.focusedIndex&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[r,s.focusedIndex,c,l?.popupNodeId]);const u=d(null);return b(()=>{c({type:"max",max:e})},[e]),b(()=>{const e=r.current;if(null!==e){const r=e=>{i(!1);const r=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!r)return;const n=Number(e.target.getAttribute("data-index"));s.focusedIndex===n&&u.current===e.target||(0!==e.movementX||0!==e.movementY)&&r&&(o(!0),u.current=e.target,c({type:"set",focusedIndex:n}),t.setCascadeState(!0,n))},n=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,r="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;o(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):r&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},a=()=>i(!0);return e.addEventListener("mousemove",r),e.addEventListener("keydown",n),e.addEventListener("scroll",a),()=>{e.removeEventListener("mousemove",r),e.removeEventListener("keydown",n),e.removeEventListener("scroll",a)}}},[t,s.focusedIndex]),{listRef:r,focusedState:s,isMousing:n,isScrolling:a}}(t.size-1,e),l=gl(),s=v((e,t)=>{r(r=>new Map(r).set(e,t??null))},[]),c=v(e=>{r(t=>{const r=new Map(t);return r.delete(e),r})},[]),{sortedNodes:h,sortedMap:g}=function(e,t){const r=u(()=>{let r=[];return null!==t.current&&(r=Array.from(e.keys()).sort(su)),r},[e,t]),n=u(()=>{const t=/* @__PURE__ */new Map;return r.forEach((r,n)=>{const o=e.get(r)??{};t.set(r,{...o,index:n})}),t},[r,e]);return{sortedNodes:r,sortedMap:n}}(t,n);!function(e,t,r,n,o,a){b(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=du(n,t,r),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,r){const n=e.placement.includes("left"),o=e?.popupParentNodeId,a=o&&r?.hasCascading&&n?"ArrowLeft":"ArrowRight",i=n?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:r?.hasCascading&&t.key===a,shouldCloseCascade:o&&t.key===i}}(o,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=n,g=l,m=i,v=a,!(!(h=s)||!h.hasCascading||null===p||g&&m&&cu(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),o.setOpen(!1))};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,n,r,o,a])}(n,h,g,o.focusedIndex,l,e);const{startCallback:f,cancelCallback:y}=Oa({delay:200,callback:({focusedIndex:t,node:r,listElement:n})=>{r&&n&&cu(r,n)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return x=o.focusedIndex,b(()=>{const e=E.current;if(null===x||k)return;const{node:t,metadata:r}=du(x,w,C);return I.lastOpenedIndex!==x&&r?.hasCascading&&(I.closeCurrentCascade(),S({focusedIndex:x,node:t,listElement:e})),()=>A()},[x,k=a,E=n,I=e,A=y,w=h,C=g,S=f]),function(e,t,r,n){b(()=>{const{metadata:o}=du(e,t,r);null===e||o?.hasCascading||n.closeCurrentCascade()},[n,e,r,t])}(o.focusedIndex,h,g,e),u(()=>({register:s,unregister:c,map:g,focusedIndex:o.focusedIndex,listRef:n,isMousing:a,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,g,o.focusedIndex,n,a,i,l?.nodeId]);var x,k,w,C,E,I,S,A}const hu=h(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function pu({style:e,children:t}){const r=Rt(St["popup-list"],cl,e),n=function(){const[e,t]=m(null),[r,n]=m(!1),[o,a]=m(null),i=v((r,o)=>{r&&e!==o?(a(o),t(o)):r||e!==o||(n(!1),t(null))},[e,n]),l=v(()=>{t(null),a(null),n(!1)},[t,a,n]),s=v(()=>{t(null),a(null),n(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:r,setFocus:n,lastOpenedIndex:o,closeCurrentCascade:s}}(),o=uu(n);return w("div",{...r,onScroll:n.onScroll,ref:o.listRef,tabIndex:0,children:w(iu.Provider,{value:o,children:w(hu.Provider,{value:n,children:t})})})}function gu({hasCascading:e=!1}={}){const t=d(null),{register:r,unregister:n,map:o,focusedIndex:a,isMousing:i,listRef:l}=p(iu);x(()=>{const o=t.current;if(o)return r(o,{index:0,hasCascading:e}),()=>{n(o)}},[r,n,e]);const s=u(()=>void 0!==o&&null!==t.current?o.get(t.current)?.index??-1:-1,[o]),c=s===a;x(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const h=v(()=>{l?.current?.focus()},[l]),g=u(()=>({onFocus:h,"data-focused":c}),[h,c]);return{itemRef:t,isActive:c,index:s,itemProps:g}}const mu=y(function({onClick:e,index:t,children:r,itemProps:n,popupTriggerProps:o},a){return w("button",{...dl,onClick:e,"data-listitem":!0,"data-index":t,...o,...n,ref:a,children:r})}),vu=y(function({onClick:e,children:t,popupTriggerProps:r},n){const{index:o,itemProps:a,itemRef:i}=gu(),l=se([i,n]);return w(mu,{...dl,onClick:e,index:o,...r,itemProps:a,ref:l,children:t})}),bu=Rt(St.text,Wt({label:"strongLabel"}),xt({maxWidth:"100%"}),On);function fu({children:e,stylists:t=[]}){const r=Bt([bu,...t]);return w("div",{...r,children:e})}function yu({text:e}){return w("div",{...dl,children:e?w(eo,{children:e}):w(No,{styles:xt({width:"100%",height:"16px"})})})}const Tu=Rt(St["popup-list"],cl),xu=()=>E("div",{...Tu,children:[w(yu,{}),w(yu,{}),w(yu,{}),w(yu,{}),w(yu,{})]}),ku=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function wu(e,t){return u(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const Cu=e=>({id:e.id||"",name:e.name,accountNo:e.accountNo}),Eu=()=>["accounting/glAccounts"],Iu=async e=>{const t=e.queryKey,r={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r);return Nu(n)};function Su(e){return xr({...e,queryKey:["accounting/glAccounts"],queryFn:Iu})}function Au(){return Su({select:Ru})}const Nu=e=>e.map(e=>({...e,id:xi({id:e.id,prefix:"GL_ACCOUNT"})}));function Pu(e,t){const r=t.get(e.accountNo)??[];return 0===r.length?[{...e,children:[]}]:r.flatMap(e=>Pu(e,t))}const Mu=e=>!e.parentAccountNo;function Du(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const r of e)if(r.parentAccountNo){const e=t.get(r.parentAccountNo)??[];e.push(r),t.set(r.parentAccountNo,e)}return t}(e);return e.filter(Mu).map(e=>({...e,children:Pu(e,t)}))}function Ru(e){return Du(e).flatMap(e=>[e,...e.children])}function Ou(e,t,r){var n;n=t,r.some(({child:e})=>e.accountNo===n.accountNo)||r.push({parent:e,child:t})}const _u=[Rt(null,xt({marginLeft:"6px",marginRight:"6px"}))],Lu=Rt(null,xt({whiteSpace:"normal"})),Fu={keys:[{name:"accountNo",weight:.3},{name:"name",weight:.7}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Bu({types:e,onClick:t,searchTerm:r}){const{query:{data:n},isFilling:o}=Au(),a=wu(n,e),i=u(()=>new me(a,Fu),[a]),l=u(()=>function(e,t){const r=[];return e.forEach(e=>{const n=e.item,o=(a=n,t.find(e=>e.children.some(e=>e.accountNo===a.accountNo)));var a;!o&&n.children.length>0?function(e,t){e.children.forEach(r=>{Ou(e,r,t)})}(n,r):o&&Ou(o,n,r)}),r}(i.search(r),a),[a,r,i]);return o?w(xu,{}):l.map(({parent:e,child:r})=>w(vu,{onClick:()=>t(r),children:E(fu,{stylists:[Lu],children:[nu(e.accountNo,e.name),w(ga,{Component:sa,stylists:_u}),nu(r.accountNo,r.name)]})},`${r.accountNo}`))}const Wu=y(function({index:e,popupTriggerProps:t,children:r,itemProps:n},o){const a=se([o,t?.ref]);return w(mu,{index:e,ref:a,itemProps:n,popupTriggerProps:t,children:r})});function Hu({triggerChildren:e,popupChildren:t}){const{cascadeIndex:r,setCascadeState:n,focus:o}=p(hu),{itemRef:a,index:i,itemProps:l}=gu({hasCascading:!0}),{isScrolling:s}=p(iu);return E(pl,{open:r===i,onOpenChange:e=>{s||n(e,i)},placement:"right-start",children:[w(ml,{children:t=>w(Wu,{itemProps:l,index:i,ref:a,popupTriggerProps:t,children:e})}),w(El,{initialFocus:o,children:t})]})}const Uu=Rt(null,xt({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Vu({icon:e,displayLabel:t}){return E("div",{...Uu,children:[e,w(eo,{wrap:"wrap",children:t}),w(ga,{Component:sa})]})}function zu({types:e,onClick:t}){const{query:{data:r,isFetching:n},isFilling:o}=Su({select:Du}),a=wu(r,e);return o?w(xu,{}):o||n||void 0!==r?a.map(e=>{const r=nu(e.accountNo,e.name);return w(Hu,{triggerChildren:w(Vu,{displayLabel:r}),popupChildren:w(ju,{glAccount:e,onClick:t})},e.accountNo)}):w(yu,{text:"No data"})}function ju({glAccount:e,onClick:t}){return w(pu,{children:e.children.map(e=>w(vu,{onClick:()=>t(e),children:w(eo,{children:nu(e.accountNo,e.name)})},e.accountNo))})}const Ku=Rt(null,xt({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent",fontSize:"sm",fontWeight:"sm","&::placeholder":{color:"typography.base.weak"}}));function $u({searchTerm:e,setSearchTerm:t,placeholder:r}){const n=d(null);return b(()=>{n.current?.focus({preventScroll:!0});const e=e=>{!n.current||document.activeElement===n.current||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||n.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),w("input",{ref:n,type:"text",placeholder:r,value:e,onChange:e=>t(e.target.value),...Ku})}function qu({onClick:e,types:t}){const r=gl(),[n,o]=m(""),a=pr(n)?xt({maxWidth:"420px",width:"fit-content"}):void 0,i=t=>{e(t),r?.setOpen(!1)};return w(El,{children:E(pu,{style:a,children:[w($u,{searchTerm:n,setSearchTerm:o,placeholder:"Search revenue accounts..."}),pr(n)?w(Bu,{types:t,onClick:i,searchTerm:n}):w(zu,{types:t,onClick:i})]})})}const Yu=async({data:e,accessToken:t,environment:r})=>Qu({data:{data:e},accessToken:t,environment:r}),Gu=async({data:e,accessToken:t,environment:r})=>Yu({data:[e],accessToken:t,environment:r}),Qu=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:ea(r)};return await mn(n)};function Xu(){return Vs({onSuccess:async()=>{const e=["banks/transactions"];return nn("mutation successful, invalidating BT queries"),fr.invalidateQueries({queryKey:e}).catch(e=>on({error:e,severity:"error"}))},mutationFn:Yu})}function Zu(){return Vs({onSuccess:async()=>(nn("mutation successful, invalidating BT queries"),fr.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>on({error:e,severity:"error"}))),mutationFn:Gu})}function Ju({transaction:e,parentTransaction:t,accountNo:r,accountName:n}){const{startPrefetch:o,cancelPrefetch:a}=_a({prefetchFn:Ia(Eu,Iu)}),{mutate:i}=Zu(),l=void 0!==t;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(au,{...e,onMouseEnter:o,onMouseLeave:a,children:w(eo,{children:nu(r,n)})})}),w(qu,{onClick:l?r=>{if(r?.id&&l){const{id:n,children:o}=t,{id:a}=e,l=o.map(e=>e.id===a?{...e,glAccountId:r.id.toString()}:e);i({id:n,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:ku})]})}const eh=()=>["expenses/categories"],th=async e=>{const t=e.queryKey,r={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r);return{...n,data:n.data?(o=n.data,o.map(e=>({...e,id:xi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?xi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var o};function rh(e){return xr({...e,queryKey:["expenses/categories"],queryFn:th})}function nh(e){const t=/* @__PURE__ */new Map;for(const r of e)if(r.parentCategoryId){const e=t.get(r.parentCategoryId)??[];e.push(r),t.set(r.parentCategoryId,e)}return t}function oh(e){if(0===e.length)return[];const t=nh(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function ah(e){if(0===e.length)return[];const t=nh(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}const ih=e=>({id:e.id,name:e.name});function lh(e,t,r){var n;n=t,r.some(e=>e.child.id===n.id)||r.push({parent:e,child:t})}const sh=Rt(null,xt({whiteSpace:"normal"})),ch=[Rt(null,xt({marginLeft:"6px",marginRight:"6px"}))],dh={keys:[{name:"name"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function uh({searchTerm:e,onClick:t}){const{query:{data:r,isFetched:n},isFilling:o}=rh({select:e=>({...e,data:e.data?oh(e.data):void 0})}),a=r?.data,i=!o&&n&&(void 0===a||0===a.length),l=u(()=>new me(a??[],dh),[a]),s=u(()=>a?function(e,t){const r=[];return e.forEach(e=>{const n=e.item,o=(l=n,t.find(e=>e.children?.some(e=>e.id===l.id))),a=!(o||0!==n?.children?.length&&n.children),i=!o&&n.children&&n.children.length>0;var l;o?lh(o,n,r):a?lh(n,n,r):i&&function(e,t){e.children&&e.children.forEach(r=>{lh(e,r,t)})}(n,r)}),r}(l.search(e),a):[],[a,e,l]);return o?w(xu,{}):i?w(yu,{text:"No data"}):0===s.length?w(yu,{text:"No results found"}):w(C,{children:s.map(({parent:e,child:r})=>{const n=e.id===r.id;return w(vu,{onClick:()=>t(ih(r)),children:w(fu,{stylists:[sh],children:n?r.name:E(C,{children:[e.name,w(ga,{Component:sa,stylists:ch}),r.name]})})},`${e.id}_${r.id}`)})})}function hh({category:e,handleCategoryChange:t}){return w(pu,{children:e.children?.map(e=>w(vu,{onClick:()=>t(ih(e)),children:w(eo,{wrap:"wrap",children:e.name})},e.id))})}function ph({onClick:e}){const{query:{data:t,isFetched:r},isFilling:n}=rh({select:e=>({...e,data:e.data?ah(e.data):void 0})}),o=t?.data,a=!n&&r&&void 0===o;return n?w(xu,{}):a?w(yu,{text:"No data"}):w(C,{children:o?.map(t=>t.hasChilds?w(Hu,{triggerChildren:w(Vu,{displayLabel:t.name}),popupChildren:w(hh,{category:t,handleCategoryChange:e})},t.id):w(vu,{onClick:()=>e(ih(t)),children:w(eo,{wrap:"wrap",children:t.name})},t?.id))})}const gh=({onClick:e})=>{const t=gl(),[r,n]=m(""),o=r=>{void 0!==e&&e(r),t.setOpen(!1)};return w(El,{children:E(pu,{children:[w($u,{searchTerm:r,setSearchTerm:n,placeholder:"Search expense categories..."}),pr(r)?w(uh,{searchTerm:r,onClick:o}):w(ph,{onClick:o})]})})},mh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),vh=ia(e=>c.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),bh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),fh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),yh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),Th=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),xh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),kh=ia(e=>c.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function wh(e){switch(e){case"Advertising":case"Advertising and Marketing":return mh;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return fh;case"Health & Fitness":case"Sports":case"Sporting Goods":return yh;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return Th;case"Plane / Train / Bus":case"Airlines":case"Airfare":return xh;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 kh;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 bh;default:return vh}}function Ch({transaction:e,parentTransaction:t}){const{startPrefetch:r,cancelPrefetch:n}=_a({prefetchFn:Ia(eh,th)}),o=e.category?.name??"Uncategorized",{mutate:a}=Zu(),i=void 0!==t;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>E(au,{...e,onMouseEnter:r,onMouseLeave:n,children:[w(Qc,{Component:wh(o)}),w(eo,{children:o})]})}),w(gh,{onClick:i?r=>{if(r?.id&&i){const{id:n,children:o}=t,{id:i}=e,l=o.map(e=>e.id===i?{...e,categoryId:r.id.toString()}:e);a({id:n,children:l})}}:t=>{t?.id&&a({id:e.id,categoryId:t.id.toString()})}})]})}const Eh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668",stroke:"#182428",strokeMiterlimit:10})),"Split"),Ih=Rt(null,xt({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Sh=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Ah({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),r=new Set(t),n=[...r].join(", "),o=dc("Category","Categories",r.size,!0);return w(ol,{children:E("div",{...Sh,children:[w(Qc,{Component:Eh}),E("div",{...Ih,children:[w(eo,{children:o}),w(ro,{children:n})]})]})})}function Nh({transaction:e,parentTransaction:t}){return e.children?.length>0?w(Ah,{transaction:e}):w(Ch,{transaction:e,parentTransaction:t})}function Ph(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function Mh(e,t){return t?e?`${e} ${Ph(t)}`:t?Ph(t):"":e??""}const Dh=e=>e>0?"Deposited to":"Withdrawn from",Rh=e=>Number(e.split("_")[1]),Oh=e=>({id:Rh(e.id),apiAccountName:e.apiAccountName,apiAccountNo:e.apiAccountNo,apiAccountType:e.apiAccountType,duplicateBankAccountIds:[]});function _h({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return w(Nh,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return w(ru,{annotation:Dh(e.amount),accountName:e.bankAccount?.name});default:return w(Ju,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Lh({name:e}){return w(C,{children:e&&w(Ji,{children:e})})}const Fh="USER_REVIEW_REQUIRED",Bh="ACCOUNTANT_REVIEW_REQUIRED",Wh=ia(e=>c.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),Hh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Uh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),Vh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),zh=xt({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"}}),jh=xt({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"}}}),Kh=xt({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"}}}),$h=xt({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"}}}),qh=xt({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"}}}),Yh=xt({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"}}}),Gh=Rt(St.badge,zh),Qh=Rt(null,Ln),Xh=Rt(null,da),Zh=Rt(St["neutral-badge"],jh),Jh=Rt(St["highlight-badge"],Kh),ep=Rt(St["success-badge"],$h),tp=Rt(St["warning-badge"],qh),rp=Rt(St["critical-badge"],Yh);function np({type:e,children:t,onClick:r,popupTriggerProps:n}){let o;switch(e){case"critical":o=rp;break;case"warning":o=tp;break;case"neutral":o=Zh;break;case"success":o=ep;break;case"highlight":o=Jh}const a=Bt([Gh,Qh,o,Xh]);return w("button",{...a,onClick:r,...n,children:t})}const op=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],ap=[{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 ip({onClick:e}){const t=gl(),{userRole:r}=p(Hl),n=(e=>{switch(e){case"OWNER":default:return op;case"ACCOUNTANT":return ap}})(r)||[];return w(El,{children:w(pu,{children:n.map(({status:r,displayName:n})=>w(vu,{onClick:()=>(e(r),void t.setOpen(!1)),children:n},r))})})}function lp({status:e,transactionId:t}){const[r,n]=m(!1),{mutate:o}=Zu(),a=()=>{n(!1)},i=()=>{n(!r)},{userRole:l}=p(Hl),{text:s,type:c,Icon:d}=((e,t)=>{const r=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Bh;case"OWNER":return e===Fh}})(e,t),n=/* @__PURE__ */((e,t)=>"OWNER"===t&&e===Bh)(e,t),o=/* @__PURE__ */((e,t)=>"ACCOUNTANT"===t&&e===Fh)(e,t),a=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);let l,s,c;return n?(l="Pending Review",s=w(Qc,{Component:Vh}),c="neutral"):o?(l="Pending User Review",s=w(Qc,{Component:Vh}),c="neutral"):r?(l="Needs Review",s=w(Qc,{Component:Wh}),c="warning"):a?(l="Discrepancy",s=w(Qc,{Component:Hh}),c="critical"):i?(l="Reconciled",s=w(Qc,{Component:Uh}),c="success"):(l="Processing",s=w(Qc,{Component:Vh}),c="neutral"),{text:l,type:c,Icon:s}})(e,l);return!t||((u=t).startsWith(yi.TRANSACTION_LINE_ITEM)||u.startsWith(yi.PROCESSOR_TRANSACTION))?null:E(pl,{open:r,blockInteraction:!1,onOpenChange:a,enableClickMiddleware:!1,children:[w(ml,{children:e=>E(np,{type:c,popupTriggerProps:e,onClick:i,children:[d,w(ro,{children:s})]})}),w(ip,{onClick:e=>{o({id:t,reviewStatus:e}),a()}})]});var u}function sp({status:e,transactionId:t}){return w(lp,{status:e,transactionId:t},t)}const cp=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2940)"},c.createElement("path",{d:"M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997",stroke:"#182428",strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_9779_2940"},c.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowUp"),dp=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2922)"},c.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_9779_2922"},c.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown");function up({row:e}){const t=e.getIsExpanded();return e.getCanExpand()?w(Rl,{"aria-label":t?"Collapse row":"Expand row","aria-expanded":t,children:w(ga,{Component:t?cp:dp})}):w(Rl,{active:!1,children:w(ga,{Component:sa})})}function hp({row:e}){return w(up,{row:e})}const pp=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),gp=Rt(null,xt({stroke:"icon.base.weak"}));function mp({hasConversation:e,hasUnread:t=!1}){return w(C,{children:e?w(ws,{hasUnread:t}):w("div",{"data-testid":"no-conversations-dash",children:w(bl,{Component:pp,stylists:[gp]})})})}function vp({conversationId:e}){const{query:{data:t}}=za(e??null),{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),i=ur(t),l=i&&"READ"==t?.readStatus,s=v(()=>{ur(e)&&(r({id:e}),o({id:e}))},[e,r,o]),c=v(()=>{ur(e)&&(n(),a())},[e,n,a]);return w("div",{onMouseEnter:s,onMouseLeave:c,children:w(mp,{hasConversation:i,hasUnread:!l})})}const bp=j(),fp=[bp.display({id:Fe.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?w(Ud,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),bp.accessor("date",{id:Fe.DATE,cell:e=>w(ol,{children:w(Yd,{transaction:e.row.original})}),header:()=>w(Fl,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Sd,sortDescDisplay:Ad}),size:130,maxSize:144}),bp.accessor("description",{id:Fe.DESCRIPTION,cell:e=>w(ol,{children:w(Qd,{bankTransaction:e.row.original})}),header:()=>w(Fl,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Nd,sortDescDisplay:Pd}),size:180}),bp.accessor("amount",{id:Fe.AMOUNT,cell:e=>w(ol,{children:w(eu,{transaction:e.row.original})}),header:()=>w(Fl,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:Md,sortDescDisplay:Dd}),size:130,maxSize:180}),bp.accessor("category.id",{id:Fe.CATEGORY,cell:({row:e})=>w(_h,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>w(Fl,{columnName:"Category"}),size:130,meta:{clickable:!0}}),bp.accessor(e=>e.classSegments[0]?.id,{id:Fe.CLASS_SEGMENT,cell:e=>w(ol,{children:w(Lh,{name:e.row.original.classSegments[0]?.name})}),header:()=>w(Fl,{columnName:"Business"}),size:130}),bp.accessor("reviewStatus",{id:Fe.REVIEW_STATUS,cell:e=>w(ol,{children:w(sp,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>w(Fl,{columnName:"Reviewed",sortDef:"REVIEW_STATUS",sortAscDisplay:Rd,sortDescDisplay:Od}),size:130,maxSize:160,meta:{clickable:!0}}),bp.display({id:Fe.COMMENTS,cell:e=>{const t=e.row.original;return w(ol,{alignVariant:"center",children:w(vp,{conversationId:t.conversation?.id})})},header:()=>w(Fl,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),bp.display({id:Fe.EXPAND,cell:e=>w(hp,{row:e.row}),size:40,maxSize:60})];function yp(e){return e?fp.filter(t=>e.includes(t.id)):fp}function Tp(e){if(e)return Object.values(Fe).reduce((t,r)=>(t[r]=e.includes(r),t),{})}const xp=[],kp=[Fe.COMMENTS,Fe.DATE,Fe.DESCRIPTION,Fe.AMOUNT,Fe.CATEGORY,Fe.REVIEW_STATUS];function wp(e,t){return si("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function Cp(e){const t=e.row,r=e.column.columnDef.meta?.clickable,n=t.getCanExpand(),o="BANK_TRANSFER"===t.original.type,a="category"===e.column.id&&(n||o);if("comments"===e.column.id){const e=t.getParentRow();wp(e?.original.id??t.original.id,"conversation")}else if(!r||a)if(n)t.toggleExpanded();else{const e=t.getParentRow();wp(e?.original.id??t.original.id)}}function Ep({rowData:e,hasSelect:t=!0}){const{startPrefetch:r,cancelPrefetch:n}=fi(),o=v(()=>r({id:e.original.id}),[r,e.original]);return w(li,{rowData:e,onMouseEnter:o,onMouseLeave:n,onCellClick:Cp,shouldDisplayDivider:r=>{return n=r,o=t,a=e.getVisibleCells().length,!(0===n||o&&1===n||n===a-1||o||1===n);var n,o,a}})}function Ip(){return E(C,{children:[w(os,{Component:Uh}),w(eo,{wrap:"wrap",children:"All caught up"}),w(ro,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Sp=Rt(St["button-warning"],xt({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 Ap({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Sp,...t],...r,children:e})}function Np(){const{linkPlaid:e}=hc();return w(Ap,{onClick:e,children:w(eo,{children:"Link your bank"})})}const Pp=Rt(null,xt({whiteSpace:"wrap"}));function Mp(){return E(C,{children:[w(os,{Component:fh}),w(eo,{stylists:[Pp],children:"Your bank transactions will be categorized for you"}),w(ro,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),w(Np,{})]})}const Dp=xt({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Rp(){return E(C,{children:[w("div",{className:Dp,children:w(Qc,{Component:Vh})}),w(eo,{children:"Transactions are being processed"}),w(ro,{children:"Any transactions that require review will show up here."})]})}function Op({hasLinkedAccount:e,sortInstance:t,setSortInstance:r,isFilling:n,paginationControls:o,transactions:a}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return function({transactions:e,columns:t}){return K({data:e??xp,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??xp.length,columns:yp(t),getCoreRowModel:$(),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:Tp(t)}})}({transactions:e,columns:t?[...t,Fe.EXPAND]:void 0})}({transactions:e,columns:kp})}({transactions:a}),{query:{data:l},isFilling:s}=mi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=!dr(l?.data?.[0])&&!s,d=function(e,t,r){let n;return e||t?!e||r||t?e&&r&&!t&&(n=w(Ip,{})):n=w(Rp,{}):n=w(Mp,{}),n}(e??!1,a.length>0,c);return E(C,{children:[w("div",{id:Yo}),E(pa.Provider,{value:o,children:[E(_t,{children:[w(Ut,{children:"Transactions For Your Review"}),w(ds,{children:w(ya,{})})]}),w(Gi,{dashboard:"businessOwnerDashboard",children:n?w(Ea,{}):E(C,{children:[w(Qi.Provider,{value:{sortInstance:t,setSortInstance:r},children:w(Ga,{headerGroups:i.getHeaderGroups()})}),dr(d)?w(Xa,{children:i.getRowModel().rows.map(e=>w(Ep,{rowData:e,hasSelect:!1},e.id))}):w(ns,{children:d})]})})]})]})}function _p(){const{sortInstance:e,setSortInstance:t,apiSort:r}=function(){const[e,t]=m(void 0),r=u(()=>{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 di)??!1,r=(e.direction&&e.direction in ui)??!1;return t&&r})(e)&&t(e)},apiSort:r}}(),{query:{data:n},isFilling:o,paginationControls:a}=mi({filter:Qo,sort:r,limit:10}),i=n?.data??Zo,{query:{data:l},isFilling:s}=Ic({select:e=>Ac(e?.data)});return w(Op,{sortInstance:e,setSortInstance:t,isFilling:o||s,paginationControls:a,transactions:i,hasLinkedAccount:l??!1})}const Lp=Rt(St["button-action"],xt({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 Fp({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Lp,...t],...r,children:e})}const Bp=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),c.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),Wp=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Ts,buttonText:"Respond now"};case"TRANSACTION_REVIEW":return{Icon:Wh,buttonText:"Review"};case"LINK_BANK":return{Icon:fh,buttonText:"Link your bank"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:fh,buttonText:"Fix now"};case"RELINK":return{Icon:fh,buttonText:"Relink"};case"CHAT":return{Icon:Hh,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Bp,buttonText:"Fill out form"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:Uh,buttonText:""};default:return{Icon:Hh,buttonText:""}}},Hp=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px"})),Up=Rt(null,xt({width:"20px",height:"20px"}));function Vp({title:e,type:t}){const{Icon:r}=Wp(t);return E("div",{...Hp,children:[w(Qc,{Component:r,stylists:[Up]}),w(eo,{wrap:"wrap",children:e})]})}const zp=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"5px",flex:"1 1 0",minWidth:"200px",width:"100%"}));function jp({title:e,description:t,type:r}){return E("div",{...zp,children:[w(Vp,{title:e,type:r}),w(ro,{wrap:"wrap",children:t})]})}const Kp=Rt(St["banner-button"],xt({display:"flex",width:"202px",justifyContent:"flex-end",alignItems:"center",gap:"15px",flexShrink:"0"})),$p=Rt(St["banner-button-text"]),qp=Rt(St["banner-button-icon"]);function Yp({priority:e,type:t,handleClick:r}){const{buttonText:n}=Wp(t),{Button:o}=(e=>{switch(e){case"URGENT":return{Button:Gs};case"HIGH":return{Button:Ap};case"MEDIUM":return{Button:Fp};default:return{Button:zi}}})(e);return E(o,{onClick:r,stylists:[Kp],children:[w(eo,{stylists:[$p],children:n}),w(ga,{stylists:[qp],Component:sa})]})}const Gp=Et({base:{display:"flex",flexDirection:{sm:"row",base:"column"},padding:"15px",justifyContent:"space-between",alignItems:{sm:"center",base:"flex-start"},alignSelf:"stretch",flexWrap:"wrap",minWidth:"300px",gap:"15px",borderRadius:"lg",border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Qp={HIGH:St["banner-high"],MEDIUM:St["banner-medium"],LOW:St["banner-low"],URGENT:St["banner-urgent"]};function Xp({task:e,handleClick:t}){const{name:r,description:n,type:o,priority:a}=e,i=Rt(St.banner,Qp[a],Gp({priority:a}));return E("div",{...i,children:[w(jp,{title:r,description:n,type:o}),w(Yp,{priority:a,type:o,handleClick:t})]})}function Zp({task:e}){const t=Ee(),{linkPlaid:r}=hc(e?.meta?.plaidItem?.id),{alert:n,actions:o}=xc(e?.meta?.plaidItem);return w(Xp,{task:e,handleClick:()=>{"RELINK"===e.type?r():"LINK_BANK"===e.type?t?si("NewPlaidConnection"):r():kc(n,o)}})}const Jp=Rt(St.banner,St["banner-default"],Gp({priority:"DEFAULT"}));function eg(){const e=gc()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return w("div",{...Jp,children:w(jp,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const tg=Rt(St.banner,St["banner-default"],Gp({priority:"DEFAULT"}));function rg(){const e=gc()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return w("div",{...tg,children:w(jp,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const ng=xt({width:"100%",height:72,minWidth:"300px"});function og(){return E(C,{children:[w(No,{styles:ng}),w(No,{styles:ng}),w(No,{styles:ng})]})}function ag({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:r,isFilling:n}){const o=e.length>0;return n?w(og,{}):o?e.map(e=>{if(void 0===ta[e.type]||"ONBOARDING_FORM"===e.type&&dr(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(mc).includes(e.type))return w(Zp,{task:e},e.id);const r=e.actionLink,n=ur(r)?()=>window.open(r,"_blank"):()=>t(e.type);return w(Xp,{task:e,handleClick:n},e.id)}):w(r?rg:eg,{})}function ig(){return E(Ki,{onClick:()=>si("BanksAndIntegrations"),children:[w(ga,{Component:Gc}),w(ll,{children:"Banks & Integrations"})]})}const lg=Rt(St["business-owner-dashboard"],xt({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),sg=xt({display:"flex",width:"100%",justifyContent:"center"}),cg=e=>{const t=Go[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},dg={status:{in:["ACTIVE","INACTIVE"]}},ug={filter:{status:{in:["ACTIVE"]}}};function hg({period:e,onChangePeriod:t}){const{sortInstance:r,setSortInstance:n,apiSort:o}=function(){const[e,t]=m(void 0);return{sortInstance:e,setSortInstance:v(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in La)??!1,r=(e.direction&&e.direction in Fa)??!1;return t&&r}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:a},isFilling:i,paginationControls:l}=Ua({limit:10,sort:o,filter:Xo}),s=a?.data??Jo,c=gc(),{query:{data:d},isFilling:h}=(p={select:e=>((e,t)=>{const r=dr(n=e)||dr(n.data)?[]:[...n.data].sort((e,t)=>na[e.priority]-na[t.priority]);var n;return t?r.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):r})(e,c)},g=ug,xr({...p,queryKey:g?ra(g):["tasks",{}],queryFn:oa}));var p,g;const{query:{data:b}}=Ic({select:e=>({plaidItemAccountsReadyToSync:Nc(e?.data),hasPlaidLinkedBankAccount:Ac(e?.data)})}),{query:{data:f}}=js({select:e=>{return t=e,t?.filter(({status:e,apiErrorType:t,apiErrorCode:r})=>"ACTIVE"===e&&t&&r);var t}}),y=gc(),T=u(()=>{let e=[];f&&(e=f.map(e=>Cc(e)));let t=[];!1===b?.hasPlaidLinkedBankAccount&&(t=[wc]);const r=d??[];return[...e,...t,...r]},[d,b,f]),x=function(){const{query:{data:e}}=mi({filter:dg,limit:1});return(e?.data?.length??0)>0}(),k=function(e,t){const r=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&r}(x,b),I=/* @__PURE__ */new Date,S={month:I.getMonth(),year:I.getFullYear()};const[A,N]=ul(S,e,t),P=(M=A.month,{beginDate:zt((D=A.year)-1,M+1,1),endDate:zt(D,M+1,0)});var M,D;return w("div",{className:sg,children:E("div",{...lg,children:[E(_t,{children:[w(Ut,{children:"Action Items"}),w(ig,{})]}),w($o,{children:w(ag,{taskBanners:T,handleScrollAction:cg,isWaitingForPlaidItemAccountsSync:!x&&!0===b?.plaidItemAccountsReadyToSync,isFilling:h})}),!y&&E(C,{children:[w(Id,{period:A,handleDateChange:e=>{var t,r;(t=S).year===(r=e).year&&r.month>t.month||r.year>t.year||N(e)},todayPeriod:S,showSamples:k,showLinkAccountButton:k&&!b?.plaidItemAccountsReadyToSync}),w(_t,{children:w(Ut,{children:"Financial Summary"})}),w(Hs,{isSample:k,period:A}),w(jo,{filter:P,isSample:k})]}),w(ps,{sortInstance:r,setSortInstance:n,conversations:s,paginationControls:l,isFilling:i,isMobile:y}),!y&&w(_p,{})]})})}function pg(e){return w(ln||C,{children:e.children})}const gg="undefined"!=typeof window?x:b,mg={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function vg({children:e}){const[t,{width:r,height:n}]=function(e={}){const{debounceMs:t=0}=e,[r,n]=m(null),[o,a]=m(mg),i=u(()=>{let e=null;return new window.ResizeObserver(r=>{if(r[0]){const{x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u}=r[0].contentRect;t>0?(null!==e&&clearTimeout(e),e=setTimeout(()=>{a({x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u}),e=null},t)):a({x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u})}})},[t]);return gg(()=>{if(r)return i.observe(r),()=>{i.disconnect()}},[r]),[n,o]}({debounceMs:150});return w(pg,{children:w(pc.Provider,{value:{dimensions:{width:r,height:n}},children:w("div",{ref:t,className:Nt(St.component),children:e})})})}function bg(e){return w(vg,{children:w(hg,{...e})})}const fg=ve("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),yg={queryClient:fr,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await fg).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await fg).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await fg).delete("queryClient",e)}(e)}}}(),maxAge:br,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function Tg({children:e}){return w(be,{client:fr,persistOptions:yg,children:e})}const xg=xt({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"}),kg=xt({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"}),wg=Rt(null,St.component,kg);function Cg({children:e}){const t=d(null),r=d(null);return E(ce,{lockScroll:!0,children:[w("div",{className:xg}),w("div",{onMouseDown:e=>{r.current=e.target},onClick:e=>{const n=r.current===t.current,o=e.target===t.current;n&&o&&(r.current=null,Le.getState().closeAllDrawers())},ref:t,...wg,children:e})]})}const Eg=h({drawerHistory:[]});function Ig({children:e}){const t=Le(e=>e.drawerHistory),r=u(()=>({drawerHistory:t}),[t]);return w(Eg.Provider,{value:r,children:t.length>0&&w(Cg,{children:e})})}function Sg({Component:e,name:t}){const{drawerHistory:r}=p(Eg),n=r.at(-1);if(void 0===n)return null;const o=n[t];return void 0!==o?w(e,{...o.routeProps}):void 0}const{formContext:Ag,fieldContext:Ng,useFieldContext:Pg,useFormContext:Mg}=fe();function Dg({showIcon:e=!0,textContent:t="Save",disabled:r=!1}){return E(Xs,{type:"submit",disabled:r,children:[e&&w(ga,{Component:_d}),w(eo,{children:t})]})}const Rg=[Rt(null,xt({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Og=Rt(null,xt({display:"flex",alignItems:"center",gap:"4px"}));function _g({errorMessage:e}){return E("div",{...Og,children:[w(Qc,{Component:Hh,stylists:Rg}),w(ro,{intent:"danger",children:e})]})}const Lg=xt({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"}}),Fg=xt({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Bg=xt({display:"flex",justifyContent:"space-between",alignItems:"center"});function Wg({children:e,inputRef:t,popupTriggerProps:r,label:n,isDefaultValue:o,isTouched:a,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=Rt(i||null,Lg,l,Fg,da),[v,b]=m(!0);return E(C,{children:[E("div",{...g,onClick:s,...r,onMouseDown:e=>{b(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{b(!1),c?.()},"data-clicked":v,"data-isdefaultvalue":o,"data-haserror":a&&void 0!==d,"data-disablehover":u,children:[E("div",{className:Bg,children:[void 0!==n&&w(ro,{children:n}),ur(p)&&w(ro,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),a&&d&&w(_g,{errorMessage:d})]})}const Hg=xt({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 Ug({children:e,inputRef:t,popupTriggerProps:r,label:n,onClick:o}){const a=Pg(),i=ye(a.store,e=>e.meta.errors[0]?.message),l=ye(a.store,e=>e.meta.isDefaultValue),s=ye(a.store,e=>e.meta.isTouched);return w(Wg,{label:n,inputRef:t,popupTriggerProps:r,isDefaultValue:l,isTouched:s,className:St["discrete-form-input"],additionalStyles:Hg,errorMessage:i,onClick:o,onBlur:a.handleBlur,children:e})}function Vg(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 zg(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function jg(e){"Enter"===e.key&&e.currentTarget.blur()}const Kg=Rt(St["amount-input"],Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),$g=Rt(null,xt({display:"flex",alignItems:"center",gap:"2px"}));function qg({value:e,onChange:t,inputRef:r,onClick:n,onBlur:o,autofocus:a=!1}){return E("div",{...$g,children:[w(ms,{children:"$"}),w(xe,{...Kg,getInputRef:r,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:n,onBlur:o,onKeyDown:jg,autoFocus:a})]})}const Yg=xt({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),Gg=Et({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function Qg({kind:e,label:t,children:r,inputRef:n,disabled:o,popupTriggerProps:a,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Pg(),u=ye(d.store,e=>e.meta.errors[0]?.message),h=ye(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=ur(c)?c-p:void 0,m=o?Yg:Gg({kind:e});return w(Wg,{label:t,inputRef:n,popupTriggerProps:a,className:St["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:r})}const Xg=Rt(St["button-secondary"],xt({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 Zg({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Xg,...t],...r,children:e})}const Jg=[Rt(null,xt({"& path":{stroke:"surface.foreground"}}))];function em({onClick:e}){return E(Zg,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),e()},children:[w(ga,{stylists:Jg,Component:Eh}),w(ro,{intent:"primary",children:"Add Split"})]})}const tm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0})),rm=Rt(null,xt({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function nm({options:e,onSelect:t,selectedLabel:r}){const n=gl();return w("div",{...rm,children:e.map(e=>w(Sl,{onClick:()=>{return r=Number(e.value),n?.setOpen(!1),void t(r);var r},active:r===e.label,children:e.label},e.value))})}const om=Rt(null,xt({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"}}),ca);function am({selectedLabel:e,options:t,onSelect:r}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E("div",{...om,...t,children:[w(eo,{children:e}),w(bl,{Component:dp})]})}),w(El,{children:w(nm,{options:t,onSelect:r,selectedLabel:e})})]})}const im=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px"})),lm=Qt.map((e,t)=>({value:t,label:e})),sm=Xt({}).map(e=>({value:e,label:String(e)}));function cm({currentMonthYear:e,onMonthYearChange:t}){const r=e.getFullYear(),n=e.getMonth(),o=(e,r)=>{const n=new Date(e,r,1);t(n)};return E("div",{...im,children:[w(am,{selectedLabel:Qt[n],options:lm,onSelect:e=>o(r,e)}),w(am,{selectedLabel:String(r),options:sm,onSelect:e=>o(e,n)})]})}const dm=Rt(null,xt({background:"surface.foreground",padding:"25px",gap:"15px"})),um=Rt(null,xt({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),hm=Rt(null,xt({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"}}),ca),pm=Rt(null,xt({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),gm=Rt(null,xt({padding:"8px",textAlign:"center"})),mm=Rt(null,xt({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"}}),ca),vm=Rt(null,xt({color:"typography.base"}));function bm({date:e,selectedDate:t,currentMonth:r,onClick:n,maxDate:o}){const a=t&&Zt(e,t),i=Jt(e),l=e.getMonth()!==r,s=!!o&&er(e,o);return w("button",{...mm,onClick:()=>n(e),"data-selected":a,"data-today":i,disabled:s,children:w(eo,{stylists:l||s?[vm]:[],children:e.getDate().toString()})})}function fm({selectedDate:e,onDateSelect:t,viewDate:r,onViewDateChange:n,maxDate:o}){const a=gl(),i=r||/* @__PURE__ */new Date,l=i.getFullYear(),s=i.getMonth(),c=function(e,t){const r=zt(e,t,1),n=new Date(r);return n.setDate(n.getDate()-r.getDay()),Array.from({length:42},(e,t)=>{const r=new Date(n);return r.setDate(n.getDate()+t),r})}(l,s),d=Pe(c),u=void 0===o||d&&er(o,d),h=e=>{t(e),a.setOpen(!1)},p=e=>{const t=new Date(i);t.setMonth(i.getMonth()+e),n(t)};return E("div",{...dm,children:[E("div",{...um,children:[w("button",{...hm,onClick:()=>p(-1),children:w(ga,{Component:la})}),w(cm,{currentMonthYear:i,onMonthYearChange:n}),w("button",{...hm,onClick:()=>p(1),disabled:!u,children:w(ga,{Component:sa})})]}),E("div",{...pm,children:[Gt.map(e=>w("div",{...gm,children:w(ro,{children:e})},e)),c.map(t=>w(bm,{date:t,selectedDate:e,currentMonth:s,onClick:h,maxDate:o},t.toISOString()))]})]})}const ym=Rt(null,Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),Tm=Rt(null,Wt({body:"default"}),xt({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"}})),xm=s.object({message:s.string().refine(e=>""!==e,{message:"Required"})});function km(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const wm=xt.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),Cm=xt.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"}),Em=xt(Cm,wm),Im=xt.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Sm=xt(Im,wm,Wt.raw({body:"default"})),Am=xt({display:"block",width:"100%"}),Nm=xt({position:"relative"}),Pm=xt({display:"flex",justifyContent:"flex-end"}),Mm=xt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Dm=y(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:r},n){const o=Pg(),a=d(null),{startCallback:i}=Oa({delay:50,callback:e=>r(e)});k(n,()=>a.current);const l=!e&&xm.safeParse(o.form.state.values).success;return w(Qg,{kind:"text",inputRef:a,disableHover:!0,onClick:()=>(km(t),void i(!0)),children:E("div",{className:Am,children:[E("div",{className:Nm,children:[E("pre",{className:Em,children:[o.state.value,w("br",{})]}),w("textarea",{ref:a,placeholder:"Message...",value:o.state.value,className:Sm,onChange:e=>o.handleChange(e.target.value)})]}),w("div",{className:Pm,children:w(Ki,{disabled:!l,type:"submit",children:w("span",{className:Mm,children:w(Qc,{Component:as})})})})]})})}),Rm=Rt(St["category-text"],xt({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"}}}),ua),Om=Rt(null,xt({color:"inherit"})),_m=Rt(St["amount-input-container"],xt({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"}}),ua),Lm=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Fm=e=>{const t=e?.description;return`${t} | ${Yn(Number(e?.amount),{dollarSign:!0})} | ${tr(or(e?.date||""))}`},Bm=({bankAccounts:e,onClick:t,isFilling:r})=>{const n=gl();return w(El,{children:w(pu,{children:r?w(xu,{}):e?.map(e=>w(vu,{onClick:()=>{return r=e,void 0!==t&&t(r),void n.setOpen(!1);var r},children:w(eo,{wrap:"wrap",children:Mh(e?.apiAccountName,e?.apiAccountNo)})},e?.id))})})};function Wm({onClick:e}){const{query:{data:t},isFilling:r}=Ic(),n=t?.data?.filter(e=>e.glAccountId&&"ACTIVE"===e.status&&e.isSupported);return w(Bm,{bankAccounts:n,isFilling:r,onClick:e})}const Hm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"}));function Um({label:e,disabled:t,bankAccount:r,onClick:n}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:n=>w(Qg,{label:e,popupTriggerProps:n,disabled:t,children:w("button",{...Hm,type:"button",disabled:t,children:w(eo,{children:Mh(r?.apiAccountName,r?.apiAccountNo)})})})}),w(Wm,{onClick:n})]})}const Vm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0,cursor:"pointer"})),zm={filter:{type:{in:["BANK_TRANSFER"]}}},jm=Rt(null,xt({whiteSpace:"normal"}));function Km({onClick:e,transactionId:t}){const{query:{data:r},isFilling:n}=mi(zm),o=r?.data?.filter(e=>e.id!==t),a=gl();return w(El,{children:w(pu,{children:n?w(xu,{}):o?.map(t=>w(vu,{onClick:()=>(e(t),void a?.setOpen(!1)),children:w(eo,{stylists:[jm],children:Fm(t)})},t.id))})})}const $m=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),qm=Rt(null,xt({color:"typography.base.weak"})),Ym=Rt(null,xt({display:"grid",textWrap:"nowrap"}));function Gm({children:e,rows:t,cols:r}){return w("div",{...Ym,style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const Qm=Et({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function Xm({option:e,handleClick:t,selected:r,width:n,backgroundColor:o}){const a=wt(Qm({width:n,backgroundColor:o}),_i,Ri,Oi,ca);return void 0===e?null:w("button",{type:"button",className:a,onClick:()=>t(e),"data-active":r?.value===e.value,children:w(Ji,{wrap:"wrap",alignment:"center",children:e.label})})}function Zm({options:e,handleClick:t,selected:r,rows:n,cols:o}){return w(Gm,{rows:n,cols:o,children:e?.map(e=>w(Xm,{option:e,handleClick:t,selected:r},e.value))})}function Jm({options:e}){const t=gl(),r=Pg();return w(El,{children:w(pu,{children:e.map(e=>w(vu,{onClick:()=>{r.handleChange(e.value),r.handleBlur(),t.setOpen(!1)},children:w(Ji,{children:e.label})},e.value))})})}const ev=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),tv=Rt(null,xt({color:"typography.base.weak"})),rv=(e,t)=>{const r=e.find(e=>e.value===t);return r?.label},nv=xt({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"}),{useAppForm:ov,withForm:av}=Te({formContext:Ag,fieldContext:Ng,formComponents:{SaveButton:Dg},fieldComponents:{DiscreteAmountField:function({label:e}){const t=d(null),r=Pg();return w(Ug,{inputRef:t,label:e,children:w(qg,{value:r.state.value,onChange:r.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const r=d(null),n=Pg();return w(Qg,{inputRef:r,label:e,children:w(qg,{value:n.state.value,onChange:n.handleChange,inputRef:r,autofocus:t})})},ExpenseCategoryField:function({category:e,onClick:t,childrenField:r,totalAmount:n,glAccount:o}){const a=()=>{const t=Math.floor(n/2*100)/100,a=n-t;r?.pushValue({amount:t,category:e,classSegments:[],glAccount:o}),r?.pushValue({amount:a,category:e,classSegments:[],glAccount:o})};return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E(Qg,{label:"Category",popupTriggerProps:t,children:[E("button",{...tm,type:"button",children:[w(Qc,{Component:wh(e?.name)}),w(eo,{children:e?.name||"Uncategorized"})]}),r&&w(em,{onClick:a})]})}),w(gh,{onClick:t})]})},DateInput:function({label:e,maxDate:t,autofocus:r=!1,editable:n=!1}){const o=Pg(),a=ye(o.store,e=>e.meta.isDefaultValue),i=d(null),[l,s]=m(()=>o.state.value?or(o.state.value):/* @__PURE__ */new Date),c=o.state.value?or(o.state.value):null,[u,h]=m(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const n=nr(r);if(n){const e=t?er(a=n,i=t)?i:a:n;o.handleChange(ar(e)),s(e)}else o.handleChange("");var a,i},g=u||(c?tr(c):""),[v,b]=m(!1),f=e=>{v&&(()=>{if(t&&c&&!a){const e=nr(u);e&&er(e,t)&&h(tr(c))}})(),b(e)},y=e=>{"Enter"===e.key&&(e.preventDefault(),f(!v))},T=n?Qg:Ug;return E(pl,{placement:"bottom-start",onOpenChange:f,open:v,children:[w(ml,{children:t=>w(T,{label:e,inputRef:i,popupTriggerProps:t,onClick:()=>b(!0),children:w("input",{...ym,ref:i,type:"text",id:o.name,value:g,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:y,autoComplete:"off"})})}),w(El,{initialFocus:!1,children:w(fm,{selectedDate:c,onDateSelect:e=>{o.handleChange(ar(e)),h(tr(e)),s(e)},viewDate:l,onViewDateChange:s,maxDate:t})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:r=!1,resizeable:n=!0}){const o=Pg(),a=d(null);return w(Qg,{label:e,inputRef:a,children:w("textarea",{...Tm,ref:a,value:o.state.value||"",onChange:e=>o.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:n?"both":"none"},autoFocus:r})})},MessageAreaInput:Dm,SplitExpenseCategoryField:function({value:e,onChange:t}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E("button",{...Rm,...t,type:"button",children:[w(Qc,{Component:wh(e?.name)}),w(eo,{stylists:[Om],children:e?.name||"Uncategorized"})]})}),w(gh,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:r}){const[n,o]=m(!1);return w("div",{..._m,"data-clicked":n,children:w(qg,{value:e,onChange:t,onClick:()=>o(!0),onBlur:()=>(o(!1),void r())})})},BankAccountField:function({transaction:e}){const{state:{value:t},handleChange:r}=Pg(),n=Sc(t.id),o=dr(e)||!Lm(e);return w(Um,{label:"Bank Account",disabled:o,onClick:e=>{var t;r({id:(t=e).id,name:t.apiAccountName})},bankAccount:n})},GlAccountField:function(){const e=Pg(),t=e.state.value;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Qg,{label:"Account",popupTriggerProps:e,children:w("button",{...Vm,type:"button",children:w(eo,{children:nu(t.accountNo,t.name)})})})}),w(qu,{onClick:t=>{const r=Cu(t);e.handleChange(r)},types:ku})]})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:r}=Pg(),{query:{data:n}}=Au(),{query:{data:o}}=function(e){return Ic({select:t=>((e,t)=>{const r=Number(t.split("_")[1]);return e?.find(e=>Number(e.glAccountId)===r)})(t.data,e)})}(t?.id),a=e?Dh(e.amount):"";return w(Um,{label:a,onClick:e=>{const t=(o=n,a=e,o?.flatMap(e=>[e,...e.children??[]]).find(e=>Number(e.id?.split("_")[1])===a.glAccountId));var o,a;t&&r(Cu(t))},bankAccount:o})},MatchingBankTransferField:function({transaction:e}){const t=Pg(),r=t.state.value,n=r?Fm(r):"Select",o=r?[]:[qm];return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Qg,{label:"Matching Bank Transfer",popupTriggerProps:e,children:w("button",{...$m,children:w(eo,{stylists:o,children:n})})})}),w(Km,{onClick:e=>{const r={id:(n=e).id,description:n?.description,amount:n?.amount,date:n?.date,bankAccountId:n?.bankAccount?.id,apiName:n?.apiName};var n;t.handleChange(r),t.handleBlur()},transactionId:e?.id})]})},ButtonGroupField:function({label:e,options:t}){const r=Pg(),n=t.find(e=>e.value===r.state.value);return w(Qg,{label:e,disableHover:!0,children:w(Zm,{options:t,selected:n,handleClick:e=>{r.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Zm,GenericSelectorField:function({options:e,label:t,disabled:r}){const n=Pg();return E(pl,{placement:"bottom-start",children:[w(ml,{children:o=>w(Qg,{label:t,popupTriggerProps:o,disabled:r,children:w("button",{...ev,type:"button",children:n.state.value?w(eo,{children:rv(e,n.state.value)}):w(eo,{stylists:[tv],children:`Select ${t}...`})})})}),w(Jm,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:r,disabled:n,placeholder:o="Enter value..."}){const a=Pg(),i=d(null);return w(Qg,{label:e,disabled:n,inputRef:i,kind:"text",type:t,maxLength:r,children:w("input",{className:nv,value:a.state.value,onChange:e=>a.handleChange(e.target.value),type:t,maxLength:r,ref:i,placeholder:o})})}}}),iv=s.object({amount:s.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:s.string("Required").refine(e=>(function(e,t){const r=zt(e.getFullYear(),e.getMonth(),e.getDate()),n=zt(t.getFullYear(),t.getMonth(),t.getDate());return r.getTime()<n.getTime()}(new Date(e),/* @__PURE__ */new Date)||Zt(new Date(e),/* @__PURE__ */new Date))&&er(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),category:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}).nullable(),classSegments:s.array(s.object({id:s.string(),name:s.string().optional()})),bankAccount:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}),glAccount:s.object({id:s.string(),name:s.string().optional(),accountNo:s.string().optional()},{message:"Required"}),notes:s.string().nullable(),children:s.array(s.object({amount:s.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}),glAccount:s.object({id:s.string()},{message:"Required"}),classSegments:s.array(s.object({id:s.string(),name:s.string().optional()}))}))}),lv=iv.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);i(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"]})}),sv=iv.extend({matchingBankTransaction:s.object({id:s.string(),description:s.string().optional(),amount:s.number().optional(),date:s.string().optional(),bankAccountId:s.string().optional(),apiName:s.enum({BOX:"BOX",CLOVER:"CLOVER",STRIPE:"STRIPE",PLAID:"PLAID",KNOX:"KNOX",UBER:"UBER",FRESHBOOKS:"FRESHBOOKS",HARVEST:"HARVEST",KW:"KW",FRESHBOOKS2:"FRESHBOOKS2",CAPITAL_ONE:"CAPITAL_ONE",SQUARE:"SQUARE",DOTLOOP:"DOTLOOP",REALOGY:"REALOGY",UPWORK:"UPWORK",SHOPIFY:"SHOPIFY",DEDUCTR:"DEDUCTR",ENTERPRISE:"ENTERPRISE",MOXIWORKS:"MOXIWORKS",APPDIRECT:"APPDIRECT",LONEWOLF:"LONEWOLF",LONEWOLF_TRANSACTIONDESK:"LONEWOLF_TRANSACTIONDESK",SAMPLE_BANK:"SAMPLE_BANK",TAXBOT:"TAXBOT",GUSTO:"GUSTO",XERO:"XERO",UNIT:"UNIT",MOOV:"MOOV",QBO:"QBO",QUALPAY:"QUALPAY",BENCH:"BENCH",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",CHECK:"CHECK",RUTTER:"RUTTER",WAVE:"WAVE",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT"}).optional()}).nullish()}).refine(e=>{const t=e.matchingBankTransaction?.amount,r=e.amount;return!!dr(t)||t===r},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>sv.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success}),cv=iv.extend({}),dv=[{value:"FEDERAL",label:"Federal"},{value:"STATE",label:"State"},{value:"SALES",label:"Sales"}],uv=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],hv=["FEDERAL","STATE","SALES"],pv=["Q1","Q2","Q3","Q4"],gv=iv.extend({tax:s.object({paymentInfo:s.object({region:s.enum(hv,{message:`Tax region must be one of: ${hv.join(", ")}`}),quarter:s.enum(pv,{message:`Tax quarter must be one of: ${pv.join(", ")}`}),year:s.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: ${hv.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","quarter"],code:"custom",message:`Tax quarter must be one of: ${pv.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),mv={amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function vv(e){const{mutate:t}=Zu(),r=e?{amount:Xd((o=e).amount),category:o.category,date:o.date,bankAccount:o.bankAccount,glAccount:o.glAccount,notes:o.notes,classSegments:o.classSegments,children:o.children.map(e=>({amount:Xd(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:o.matchingBankTransaction,tax:o.tax}:mv,n=e?function(e){switch(e.type){case"EXPENSE":return lv;case"BANK_TRANSFER":return sv;case"REVENUE":return cv;case"TAX_PAYMENT":return gv;default:return}}(e):void 0;var o;return ov({defaultValues:r,validators:{onBlur:n},onSubmit:r=>{var n;e&&(t({id:e.id,amount:(n=r.value).amount?Zd(n.amount):0,categoryId:n.category?.id,bankAccountId:n.bankAccount.id,glAccountId:n.glAccount?.id,date:n.date,notes:n.notes,classSegmentIds:n.classSegments.map(e=>e.id),children:n.children.map(e=>({amount:e.amount?Zd(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:n.classSegments.map(e=>e.id)})),matchingBankTransactionId:n.matchingBankTransaction?.id,tax:n.tax}),r.formApi.reset(r.value,{keepDefaultValues:!0}))},onSubmitInvalid:()=>{}})}const bv=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete"),fv=Rt(null,xt({position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",outline:"none",border:"none",background:"none",padding:"15px 0px",gap:"15px",width:"100%"})),yv=Rt(null,xt({backgroundColor:"border.layout",height:"25px",width:"1px",margin:0})),Tv=Rt(null,xt({backgroundColor:"border.layout",height:"1px",width:"100%"})),xv=Rt(null,xt({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"}}}}),ha),kv=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px"})),wv=av({defaultValues:mv,props:{index:0,numRows:1,removeSplit:()=>{}},render:function({form:e,index:t,numRows:r,removeSplit:n}){return E(C,{children:[E("div",{...fv,children:[w(e.AppField,{name:`children[${t}].category`,children:e=>w(e.SplitExpenseCategoryField,{value:e.state.value,onChange:e.handleChange})}),E("div",{...kv,children:[w("div",{...yv}),w(e.AppField,{name:`children[${t}].amount`,children:e=>w(e.SplitExpenseAmountField,{value:e.state.value,onChange:e.handleChange,onBlur:e.handleBlur})}),w("button",{onClick:()=>n(t),...xv,children:w(Qc,{Component:bv})})]})]}),t<r-1&&w("div",{...Tv})]})}}),Cv=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"flex-start",outline:"none",border:"none",background:"none"})),Ev=xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout.strong",display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none"}),Iv=xt({borderColor:"border.intent.danger"}),Sv=av({defaultValues:mv,render:function({form:e}){const t=ye(e.store,e=>{const t=e.errors?.[0]??{},r=Object.values(t).flat().filter(e=>"object"==typeof e&&null!==e&&"message"in e);return r[0]?.message}),r=Rt(null,Ev,t?Iv:void 0);return E(C,{children:[E("div",{...r,children:[w(ro,{children:"Category"}),w(e.AppField,{name:"children",mode:"array",children:t=>{const r=r=>{t.removeValue(r),1===t.state.value.length&&(e.setFieldValue("category",t.state.value[0].category),t.removeValue(0)),e.validate("blur")};return E("div",{...Cv,children:[t.state.value.map((n,o)=>w(wv,{form:e,index:o,numRows:t.state.value.length,removeSplit:r},`${n?.category?.id}-${o}`)),w(em,{onClick:()=>{const e=Pe(t.state.value)?.category,r=Pe(t.state.value)?.classSegments,n=Pe(t.state.value)?.glAccount;t.pushValue({amount:0,category:e||{id:"",name:""},glAccount:n||{id:""},classSegments:r||[]})}})]})}})]}),t&&w(_g,{errorMessage:t})]})}}),Av=av({defaultValues:mv,render:function({form:e}){const t=ye(e.store,e=>e.values.amount)??0;return w(e.Subscribe,{selector:e=>e.values.children,children:r=>Array.isArray(r)&&0!==r.length?w(Sv,{form:e}):w(e.AppField,{name:"children",mode:"array",children:r=>w(e.AppField,{name:"category",children:n=>w(n.ExpenseCategoryField,{category:n.state.value,glAccount:e.state.values.glAccount,onClick:n.handleChange,childrenField:r,totalAmount:t})})})})}}),Nv=Rt(null,xt({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"}}));function Pv({children:e}){const t=d(null);return b(()=>{t.current?.focus()},[]),w("div",{ref:t,tabIndex:-1,...Nv,children:e})}const Mv=Rt(null,xt({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 Dv({children:e}){return w("div",{tabIndex:-1,...Mv,children:e})}function Rv({active:e,icon:t,onClick:r,ariaLabel:n}){return w(Rl,{ariaLabel:n,onClick:r,active:e,children:w(os,{Component:t})})}const Ov=Rt(null,xt({display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"}));function _v({children:e}){return w("div",{...Ov,children:e})}const Lv=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function Fv(e){return void 0!==Lv[e]}function Bv(e){return Lv[e]}const Wv=ia(e=>c.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:1.5,width:24,height:24,...e},c.createElement("defs",null,c.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),c.createElement("path",{className:"cls-63ce7444ea57ea6c838005ed-1",d:"M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27"}),c.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),Hv=xt({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function Uv({cldrShortName:e}){return w("div",{className:Hv,children:Bv(e)})}const Vv=Et({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),zv=xt({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 jv({reactions:e,type:t,handleClick:r}){return w("div",{className:zv,children:e.map((e,n)=>w("button",{className:Vv({type:t}),onClick:"received"===t?()=>r(e.emojiCode):void 0,children:w(Uv,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${n}`))})}const Kv=async({data:e,accessToken:t,environment:r})=>{const{id:n,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:n,emojiCode:o},accessToken:t,endpointManager:ea(r)};return await mn(a)},$v=async({data:e,accessToken:t,environment:r})=>{const{id:n,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:n,emojiCode:o},accessToken:t,endpointManager:ea(r)};return await async function(e){return Us(e)}(a)};function qv(e,t,r){return sr(ki({id:e}),t,r)}async function Yv(e){const t=ki({id:e});return nn("mutation successful, invalidating messages queries"),fr.invalidateQueries({queryKey:t}).catch(e=>on({error:e,severity:"error"}))}function Gv(e,t,r){const n=[...e];return n[r]=t,n}const Qv=xt({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),Xv=Object.keys(Lv).filter(Fv).map(e=>({emojiCode:e,authorInfo:[]}));function Zv({conversationId:e,messageId:t,type:r,reactions:n,reactionIsOpen:o,setReactionIsOpen:a}){const{userId:i}=p(Hl),{mutate:l}=function(e){const{userId:t,userEmail:r}=p(Hl);return Vs({mutationFn:Kv,onMutateFn:({data:n,accessToken:o,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:r,environment:n,userId:o,userEmail:a}){const i=qv(r,t,n);await fr.cancelQueries({queryKey:i});const l=fr.getQueryData(i);return fr.setQueryData(i,t=>{const r=t.findIndex(t=>t.id===e.id);return-1===r?t:Gv(t,(n=t[r],i=e,l=o,s=a,{...n,reactions:[...n.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),r);var n,i,l,s}),{oldMessages:l}}({data:n,accessToken:o,conversationId:e,environment:a,userId:t,userEmail:r})},onSettled:()=>Yv(e)})}(e);return E(pl,{placement:"top-end",open:o,onOpenChange:a,blockInteraction:!0,children:[w(ml,{children:e=>w("button",{className:Qv,...e,children:w(Qc,{Component:Wv})})}),w(El,{type:"reaction",children:w(jv,{reactions:Xv,type:r,handleClick:e=>{n.some(t=>{const r=t.emojiCode===e,n=t.authorInfo.some(e=>e.userId===i);return r&&n})||(l({id:t,emojiCode:e}),a(!1))}})})]})}const Jv=Et({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function eb({reactions:e,type:t,handleClick:r}){const n=Jv({type:t});return w("div",{className:n,children:w(jv,{reactions:e,handleClick:r,type:t})})}const tb=Et({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),rb=Et({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"}}}}),nb=xt({position:"relative",display:"flex",flexDirection:"column"});function ob({conversationId:e,messageId:t,sentByCurrentUser:r,children:n,reactions:o=[]}){const a=d(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,r]=m(!1),[n,o]=m(!1);return b(()=>{if(null===a.current||!i||s)return;const e=a.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,a=e,s=n,l=r]),{isHover:t,reactionIsOpen:n,setIsHover:r,setReactionIsOpen:o};var a,i,l,s}(a),{mutate:u}=function(e){const{userId:t}=p(Hl);return Vs({mutationFn:$v,onMutateFn:({data:r,accessToken:n,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:r,environment:n,userId:o}){const a=qv(r,t,n);await fr.cancelQueries({queryKey:a});const i=fr.getQueryData(a);return fr.setQueryData(a,t=>{const r=t.findIndex(t=>t.id===e.id),n=t[r];return dr(n)||0===n.reactions.length?t:Gv(t,function(e,t,r){const n=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===r));return{...e,reactions:n}}(n,e.emojiCode,o),r)}),{oldMessages:i}}({data:r,accessToken:n,conversationId:e,environment:o,userId:t})},onSettled:()=>Yv(e)})}(e),h=r?"sent":"received",g=o.filter(e=>Fv(e.emojiCode)),v=g.length>0;return E("div",{className:tb({type:h,hasReactionsOnMessage:v}),ref:a,onMouseEnter:()=>"received"===h&&l(!0),children:[E("div",{className:nb,children:[w("div",{className:rb({type:h}),children:n}),v&&w(eb,{reactions:g,type:h,handleClick:e=>u({id:t,emojiCode:e})})]}),i&&w(Zv,{conversationId:e,messageId:t,type:h,reactions:g,reactionIsOpen:s,setReactionIsOpen:c})]})}const ab=Rt(null,xt({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function ib({children:e}){return w("div",{...ab,children:e})}const lb=Rt(null,xt({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"})),sb=xt({minHeight:1,width:"100%"}),cb=y(function({children:e,activeKeyboard:t,setActiveKeyboard:r,inputRef:n},o){const a=d(null);t&&n?.current?.focus();const i=v(()=>{t&&ur(n?.current)&&(r(!1),n.current.blur())},[t,n,r]);return function(e,t,r){b(()=>{const n=e.current;if(null!==n){let e=n.scrollTop,o=Date.now();const a=()=>{if(t){const{scrollVelocity:t,currentScrollTop:a,currentTime:i}=function(e,t,r){const n=e.scrollTop,o=Date.now(),a=Math.abs(n-t),i=o-r;return{scrollVelocity:i>0?a/i:0,currentScrollTop:n,currentTime:o}}(n,e,o);t>5&&r(),e=a,o=i}};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a)}}},[t,r,e])}(a,t,i),E("div",{tabIndex:-1,...lb,ref:a,children:[w("div",{className:sb,ref:o}),e]})}),db=Object.freeze({message:""}),ub=xt({width:"100%"});function hb({conversationId:e,addMessage:t,blockSubmit:r,isMobile:n,scrollRef:o,setActiveKeyboard:a,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:ov({defaultValues:t??db,onSubmit:t=>{xm.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=d(null);return w("form",{className:ub,ref:c,onKeyDown:e=>function(e,t,r,n){if(!n&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!r)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,r,n),onSubmit:e=>{if(!r)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:w(s.AppField,{name:"message",children:e=>w(e.MessageAreaInput,{blockSubmit:r,scrollRef:o,setActiveKeyboard:a,ref:i})})})}function pb(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 gb(){const e=["conversations/messages"],t=["tasks"],r=["conversations"];return nn("mutation successful, invalidating messages queries"),Promise.all([fr.invalidateQueries({queryKey:e}),fr.invalidateQueries({queryKey:t}),fr.invalidateQueries({queryKey:r})]).catch(e=>on({error:e,severity:"error"}))}const mb=async({data:e,accessToken:t,environment:r})=>(async({data:e,accessToken:t,environment:r})=>ja({data:{data:e},accessToken:t,environment:r}))({data:[e],accessToken:t,environment:r}),vb=async({data:e,accessToken:t,environment:r})=>ja({data:{data:[e]},accessToken:t,environment:r}),bb=xt({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),fb=xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),yb=xt({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),Tb="Marked As Resolved";function xb({resolver:e}){const t=e?`${e} ${Tb}`:Tb;return E("div",{className:fb,children:[w("div",{className:bb}),w("div",{className:yb,children:t}),w("div",{className:bb})]})}const kb=Et({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 wb({width:e="md",height:t="md"}){return w(No,{styles:kb({width:e,height:t})})}const Cb=xt({display:"flex",flexDirection:"row-reverse"});function Eb(){return E(C,{children:[w(wb,{width:"lg",height:"lg"}),w("div",{className:Cb,children:w(wb,{width:"md",height:"lg"})}),w("div",{className:Cb,children:w(wb,{width:"lg",height:"xl"})}),w(wb,{width:"md",height:"lg"})]})}const Ib=xt({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function Sb({isConversationLoading:e,isFilling:t,message:r}){return e?w(ib,{children:w(ob,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:r})}):!e&&t?w(ib,{children:w(Eb,{})}):E("div",{className:Ib,children:[w(eo,{stylists:[Rt(null,xt({whiteSpace:"normal",textAlign:"center"}))],children:"Send your bookkeeper a message"}),w(Ji,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const Ab=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",padding:"0 15px 15px",flexDirection:"column",position:"relative"}));function Nb({conversationId:e,setConversationId:t,isResolved:r,isUnread:n,isMobile:o=!1,attachedEntityId:a,defaultValues:i}){const{userId:l}=p(Hl),{mutate:s}=function(){const{userId:e}=p(Hl);return Vs({mutationFn:Ei,onMutateFn:({data:t,accessToken:r,environment:n})=>async function({data:e,accessToken:t,environment:r,userId:n}){const o=sr(ki({id:e.conversationId}),t,r);await fr.cancelQueries({queryKey:o});const a=fr.getQueryData(o);return fr.setQueryData(o,t=>[pb(e,n),...t]),{oldMessages:a}}({data:t,accessToken:r,environment:n,userId:e}),onSettled:gb})}(),{query:{data:c},isFilling:u}=function(e){const t=ur(e);return xr({queryKey:ki({id:e??""}),queryFn:Ci,select:wi,enabled:t})}(e),{mutate:h,isPending:g,variables:v}=(I=t,S=a,Vs({mutationFn:vb,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(dr(e)||dr(t))return;I(t);const r=["conversations"],n=["banks/transactions",{}],o=["summaries",{}];let a=async()=>{},i=async()=>{};if(ur(S)){const e={id:S};Ti(S,yi.BANK_TRANSACTION)?a=async()=>{const t=pi(e);return await fr.invalidateQueries({queryKey:t})}:Ti(S,yi.FINANCIAL_SUMMARY)&&(i=async()=>await fr.invalidateQueries({queryKey:o}))}return nn("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([fr.invalidateQueries({queryKey:r}),fr.invalidateQueries({queryKey:n}),a(),i()]).catch(e=>on({error:e,severity:"error"}))}})),{mutate:f}=Vs({mutationFn:mb,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return nn("mutation successful, invalidating conversations queries"),Promise.all([fr.invalidateQueries({queryKey:e}),fr.invalidateQueries({queryKey:t})]).catch(e=>on({error:e,severity:"error"}))}}),[y,T]=m(!1),x=d(null),k=d(null);var I,S;b(()=>{r&&n&&e&&f({id:e,readStatus:"READ"})},[r,n,e,f]),b(()=>{km(k)},[c,k]);const A=dr(e)||dr(c)||u;return E(C,{children:[A?w(cb,{ref:k,inputRef:x,activeKeyboard:y,setActiveKeyboard:T,children:w(Sb,{isConversationLoading:g,isFilling:u,message:v?.message?.text})}):E(cb,{ref:k,activeKeyboard:y,setActiveKeyboard:T,inputRef:x,children:[r&&w(xb,{resolver:"Conversation"}),c.map((t,r)=>{const n=t[0].author.userId===l;return w(ib,{children:t.map(t=>w(ob,{conversationId:e,messageId:t.id,sentByCurrentUser:n,reactions:t.reactions,children:t.text},t.id))},r)})]}),w("div",{...Ab,children:w(hb,{scrollRef:k,inputRef:x,conversationId:e,blockSubmit:g,isMobile:o,addMessage:({value:t})=>{if(dr(e)){const e=(r=t.message,n=a,{subject:r.slice(0,40),status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...ur(n)&&{attachedEntityId:n},message:{text:r}});h(e)}else s({conversationId:e,text:t.message});var r,n},setActiveKeyboard:T,defaultValues:i})})]})}const Pb=Rt(St["drawer-header"],xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function Mb({children:e}){return E(C,{children:[w("div",{...Pb,children:e}),w(Ja,{alignment:"horizontal",color:"strong"})]})}function Db({conversationId:e,attachedEntityId:t}){const[r,n]=m(e),{query:{data:o}}=za(r),a="CLOSED"===o?.resolutionStatus;return E(_v,{children:[w(Mb,{}),w(Nb,{conversationId:r,setConversationId:n,isResolved:a,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})}const Rb=Rt(St["form-body"],xt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",width:"512px"}));function Ob({children:e}){return w("div",{...Rb,children:e})}const _b=Rt(null,xt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),Lb=Rt(null,xt({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),Fb=xt({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),Bb=e=>{Vg(e),zg(e)},Wb=({children:e,onSubmit:t,Header:r,initialTab:n,conversationId:o,transactionId:a})=>{const[i,l]=m(n??null);return w(Pv,{children:E("div",{..._b,children:[w(_v,{children:E("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:Bb,...Lb,children:[r,w(Ob,{children:e})]})}),null!==i&&w("div",{className:Fb}),"conversation"===i&&w(Db,{conversationId:o,attachedEntityId:a}),w(Dv,{children:w(Rv,{active:"conversation"===i,onClick:()=>l("conversation"===i?null:"conversation"),icon:Ts,ariaLabel:"conversation-tab"})})]})})},Hb=Rt(null,xt({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function Ub({transaction:e,bankAccount:t}){const r=e?e.description:"",n=dr(t)||dr(e)?"":((e,t)=>{const r="BANK_TRANSFER"===t.type,n=Dh(t.amount);return`${r?`${n} `:""}${Mh(e.apiAccountName,e.apiAccountNo)}`})(t,e);return E("div",{...Hb,children:[w(eo,{wrap:"wrap",children:r}),t&&w(ro,{children:n})]})}const Vb=Rt(null,xt({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"}}),da);function zb({Icon:e=vl}={}){return w("button",{...Vb,onClick:()=>ci(),type:"button",children:w(Qc,{Component:e,...Vb})})}const jb=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2768)"},c.createElement("path",{d:"M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z",fill:"currentColor"}),c.createElement("path",{d:"M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z",fill:"currentColor"}),c.createElement("path",{d:"M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z",fill:"currentColor"}))),"Dots");function Kb({children:e}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Rl,{popupTriggerProps:e,children:w(ga,{Component:jb})})}),w(El,{children:e})]})}const $b="ACTIVE",qb="INACTIVE";function Yb({transaction:e}){const{mutate:t}=Xu(),r=()=>t([e].map(e=>({id:e.id,status:qb})));return w(vu,{onClick:()=>{return e=r,void ic({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Delete",type:ac}]}).then(t=>{t===Js&&e()});var e},children:w(eo,{children:"Delete"})})}function Gb({transaction:e}){const{mutate:t}=Xu();return w(vu,{onClick:()=>{t([e].map(e=>({id:e.id,status:$b})))},children:w(eo,{children:"Restore"})})}const Qb=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),On);function Xb({children:e}){return w("div",{...Qb,children:e})}const Zb=av({defaultValues:mv,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:r}){return E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:t}),w(Kb,{children:E(pu,{children:[r?.status===$b&&w(Yb,{transaction:r}),r?.status===qb&&w(Gb,{transaction:r})]})})]}),w(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:w(e.SaveButton,{})})]})}});function Jb({transactionId:e}){const{query:{data:t,isFetching:r},isFilling:n}=bi({id:e});return{transaction:t,form:vv(t),bankAccount:Sc(t?.bankAccount.id),showBankAccountField:!dr(t)&&Lm(t),isLoading:n||r&&!t}}function ef({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Expense"}),s=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(Av,{form:n}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function tf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,isLoading:a}=Jb({transactionId:e});if(a)return null;const i=w(Zb,{form:n,transaction:r,title:"Bank Transfer"}),l=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:i,initialTab:t,conversationId:l,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"glAccount",children:e=>w(e.BankGlAccountField,{transaction:r})}),w(n.AppField,{name:"matchingBankTransaction",children:e=>w(e.MatchingBankTransferField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function rf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Income"}),s=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"glAccount",children:e=>w(e.GlAccountField,{})}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function nf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Tax Payment"}),s=r?.conversation?.id??null;return E(Wb,{Header:l,onSubmit:n.handleSubmit,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"tax.paymentInfo.region",children:e=>w(e.ButtonGroupField,{label:"Region",options:dv})}),w(n.AppField,{name:"tax.paymentInfo.quarter",children:e=>w(e.ButtonGroupField,{label:"Quarter",options:uv})}),w(n.AppField,{name:"tax.paymentInfo.year",children:e=>w(e.GenericSelectorField,{label:"Year",options:Xt({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function of({transactionId:e,initialTab:t}){const{query:{data:r},isFilling:n}=bi({id:e});if(b(()=>{!n&&dr(r)&&ci()},[r,n]),dr(r))return null;switch(r.type){case"EXPENSE":return w(ef,{transactionId:e,initialTab:t});case"BANK_TRANSFER":return w(tf,{transactionId:e,initialTab:t});case"REVENUE":return w(rf,{transactionId:e,initialTab:t});case"TAX_PAYMENT":return w(nf,{transactionId:e,initialTab:t})}}const af={transform(e){const{justify:t,gap:r,...n}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:r,flexDirection:"column",...n}},defaultValues:{gap:"10px"}},lf=(e={})=>{const t=ht(af,e);return af.transform(t,ut)},sf=e=>xt(lf(e));sf.raw=lf;const cf={transform(e){const{justify:t,gap:r,...n}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:r,flexDirection:"row",...n}},defaultValues:{gap:"10px"}},df=(e={})=>{const t=ht(cf,e);return cf.transform(t,ut)},uf=e=>xt(df(e));function hf({subject:e,children:t}){return E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:e})]}),w("div",{className:uf({alignItems:"center",gap:15}),children:t})]})}function pf({conversationId:e,defaultValues:t}){const[r,n]=m(e),{query:{data:o}}=za(r),a="CLOSED"===o?.resolutionStatus;return w(Pv,{children:E(_v,{children:[w(hf,{subject:o?.subject??"Conversation"}),w(Nb,{conversationId:r,setConversationId:n,isResolved:a,isUnread:"UNREAD"===o?.readStatus,defaultValues:t})]})})}uf.raw=df;const gf=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_18201_5557)"},c.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}),c.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_18201_5557"},c.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function mf({onClick:e,active:t}){return w(Ki,{type:"button",onClick:e,active:t,children:w(Qc,{Component:gf})})}const vf=xt({display:"flex",flexDirection:"column"});function bf({label:e,data:t,isFilling:r,shimmerWidth:n}){return E("div",{className:vf,children:[w(ro,{children:e}),r?w(wb,{width:n}):w(eo,{wrap:"wrap",children:t??""})]})}function ff({transactionId:e,isOpen:t}){const{query:{data:r},isFilling:n}=bi({id:e}),o=Sc(r?.bankAccount.id);if(dr(r))return null;const a=sf({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 E("div",{"data-open":t,className:a,children:[E("div",{className:uf({justifyContent:"space-between"}),children:[w(bf,{label:"Date",data:r?.date,isFilling:n,shimmerWidth:"md"}),w(bf,{label:"Amount",data:Qn(Xd(r.amount)),isFilling:n,shimmerWidth:"sm"})]}),w(bf,{label:"Bank Account",data:Mh(o?.apiAccountName,o?.apiAccountNo),isFilling:n,shimmerWidth:"lg"}),w(bf,{label:"Description",data:r?.description,isFilling:n,shimmerWidth:"lg"})]})}function yf({conversationId:e,transactionId:t}){const[r,n]=m(e),[o,a]=m(!0),{query:{data:i}}=za(r),l="CLOSED"===i?.resolutionStatus;return w(Pv,{children:E(_v,{children:[w(hf,{subject:i?.subject??"Conversation",children:ur(t)&&w(mf,{onClick:()=>a(!o),active:o},"infoButton")}),ur(t)&&w(ff,{transactionId:t,isOpen:o}),w(Nb,{conversationId:r,setConversationId:n,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}const Tf=xt({marginBottom:"20px"}),xf=xt({display:"flex",marginBlock:"20px",flexDirection:"column",gap:"15px"});function kf({title:e,children:t}){return E("div",{className:Tf,children:[w(ro,{children:e}),w("div",{className:xf,children:t}),w(Ja,{alignment:"horizontal"})]})}const wf=e=>["plaidInstitutionLogo",e??{}];function Cf(e){const t=mr(),r=Tr();return A({queryKey:wf({institutionId:e,accessToken:t,environment:r}),queryFn:async()=>await cc({institutionId:e,accessToken:t,environment:r}),staleTime:864e5}).data?.map.logo}const Ef=xt(Fi,{minWidth:"100%",padding:"10px"}),If=xt({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),Sf=xt({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),Af=xt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function Nf({plaidItem:e}){const{linkPlaid:t}=hc(e.id),r=Cf(e.apiInstitutionId);return w("button",{className:Ef,onClick:()=>t(),children:E("span",{className:If,children:[E("div",{className:Sf,children:[r?w("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):w(os,{Component:fh}),w(eo,{children:e.apiInstitutionName})]}),E("div",{className:Af,children:[w(ga,{Component:Gc}),w(Ji,{children:"Relink"})]})]})})}const Pf=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.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}),c.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),Mf=xt(Fi,{minWidth:"100%",justifyContent:"start",paddingBlock:"10px",marginBottom:"5px"}),Df=xt({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),Rf=xt({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",marginInline:"15px"});function Of(){const{linkPlaid:e}=hc();return w("button",{className:Mf,onClick:()=>e(),children:E("div",{className:Df,children:[w(Qc,{Component:Pf}),E("div",{className:Rf,children:[w(eo,{children:"Connect your bank"}),w(ro,{children:"Find your banking institution with Plaid"})]}),w(Qc,{Component:sa})]})})}const _f=xt({padding:"10px 20px",minWidth:"100%",height:"45px"}),Lf=xt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function Ff({bank:e}){const t=Cf(e.institutionName);return w("div",{className:_f,children:E("div",{className:Lf,children:[t?w("img",{src:t,alt:`${e.displayName} logo`,width:"25px",height:"25px"}):w(os,{Component:fh}),w(eo,{children:e.displayName})]})})}const Bf=xt({minWidth:"100%",height:"45px"});function Wf(){return E(C,{children:[w(No,{styles:Bf}),w(No,{styles:Bf}),w(No,{styles:Bf})]})}const Hf=xt({margin:"15px"});function Uf(){const{query:{data:e},isFilling:t}=Ks(),r=ur(e)&&e.length>0,n=Le(e=>e.drawerHistory).length>1,o=new Set(e?.map(e=>e.apiInstitutionName)??[]),a=sc.filter(e=>!o.has(e.displayName));return w(Pv,{children:E(_v,{children:[w(Mb,{children:E(Xb,{children:[w(zb,n?{Icon:la}:{}),w(eo,{children:"Add New Connection"})]})}),E("div",{className:Hf,children:[(t||r)&&w(kf,{title:"Already Connected",children:t?w(Wf,{}):e?.map(e=>w(Nf,{plaidItem:e},e.id))}),E(kf,{title:"Banks",children:[w(Of,{}),a.length>0&&E(C,{children:[w("div",{className:xt({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"}),children:a.map(e=>w(Ff,{bank:e},e.institutionName))}),w(eo,{children:"...and 12,000+"})]})]})]})]})})}function Vf(){return w(Mb,{children:E(Xb,{children:[w(zb,{}),w(eo,{children:"Financial Summary"})]})})}const zf=xt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),jf=Wt.raw({body:"default"}),Kf=xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},jf);function $f({summaryText:e}){return w("div",{className:zf,children:w("div",{className:Kf,children:e})})}const qf=xt({display:"flex",flexDirection:"column",overflow:"auto"});function Yf({summary:e}){return E("div",{className:qf,children:[w(Vf,{}),w($f,{summaryText:e})]})}const Gf=xt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function Qf({summaryId:e,conversationId:t}){const{query:{data:r}}=function({id:e}){return xr({queryKey:Ai({id:e}),queryFn:Pi})}({id:e});return w(Pv,{children:E("div",{className:Gf,children:[w(_v,{children:w(Yf,{summary:r?.summary})}),w(Ja,{}),w(Db,{conversationId:t??null,attachedEntityId:e})]})})}const Xf=xt({display:"flex",flexDirection:"column",gap:"16px"});function Zf({id:e,apiInstitutionName:t}){const{mutate:r}=qs(),n=gl(),{linkPlaid:o}=hc(e,()=>n?.setOpen(!1));return E(pu,{children:[w(vu,{onClick:()=>o(),children:w(eo,{children:"Add Account"})}),w(vu,{onClick:()=>(async()=>{const o=await(async e=>ic({title:"Remove Institution",body:w("div",{className:Xf,children:w(Ji,{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:Zs,label:"Cancel"},{key:Js,label:"Remove",type:ac}]}))(t);n?.setOpen(!1),o===Js&&r({id:String(e)})})(),children:w(eo,{children:"Remove Institution"})})]})}const Jf=xt({borderTop:"{colors.border.layout.strong} {borderWidths.md} solid"});function ey({children:e}){return w("div",{className:Jf,children:e})}const ty=xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"20px",paddingBottom:"14px",paddingLeft:"15px",paddingRight:"15px",backgroundColor:"surface.foreground"});function ry({children:e}){return w("div",{className:ty,children:e})}function ny({plaidItem:e}){const{alert:t,actions:r}=xc(e);return E(np,{type:"critical",onClick:()=>{kc(t,r)},children:[w(Qc,{Component:Hh}),w(ro,{children:"Fix Bank Error"}),w(ga,{Component:sa})]})}const oy=xt({display:"flex",flexDirection:"column",alignItems:"start",justifyContent:"flex-start",textAlign:"start",gap:"5px",maxWidth:"100%"});function ay({accountName:e,accountNo:t,syncText:r,active:n=!0}){return E("div",{className:oy,children:[r&&w(ro,{intent:n?"normal":"danger",children:r}),w(eo,{children:e}),t&&w(eo,{children:Ph(t)})]})}const iy=Et({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 ly({bankAccountId:e,apiAccountName:t,apiAccountNo:r,syncText:n,active:o}){const a=wt(iy({active:o}),da);return E("button",{className:a,onClick:()=>{si("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!o,children:[w(ay,{accountName:t,accountNo:r,syncText:n,active:o}),o&&w(Qc,{Component:sa})]})}const sy=xt({overflow:"hidden"}),cy=e=>{let t;return t=e.isSupported?e.lastApiSyncedDate?`Last synced ${lr(e.lastApiSyncedDate)}`:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function dy({plaidItem:e,plaidItemAccounts:t,itemIndex:r,numPlaidItems:n}){const o=1===n,{expanded:a,toggleExpanded:i}=function(e,t){const r=Le(e=>e.toggleExpandedPlaidItem),n=Le(e=>e.expandedPlaidItems);return{toggleExpanded:r,expanded:Le(e=>e.hasExpandedUpdated)?n.includes(e):t}}(e.id,o),l=r===n-1;return E(ey,{children:[E(ry,{children:[E(Xb,{children:[w(eo,{children:e.apiInstitutionName}),w(Kb,{children:w(Zf,{id:e.id,apiInstitutionName:e.apiInstitutionName})})]}),E(Xb,{children:[ur(e.apiErrorCode)&&w(ny,{plaidItem:e}),w(Rl,{active:!1,onClick:()=>i(e.id,o),children:w(ga,{Component:a?cp:dp})})]})]}),a&&w("div",{className:sy,children:t.map(e=>w(ly,{bankAccountId:e.id,apiAccountNo:e.apiAccountNo,apiAccountName:e.apiAccountName,syncText:cy(e),active:e.isSupported},e.id))}),!l&&w(Ja,{alignment:"horizontal",color:"strong"})]})}const uy=xt({overflow:"hidden"});function hy({manualBankAccounts:e}){return E(ey,{children:[w(ry,{children:w(Xb,{children:w(eo,{children:"Manually Tracked Accounts"})})}),w("div",{className:uy,children:e.map(e=>w(ly,{bankAccountId:e.id,apiAccountName:e.apiAccountName,apiAccountNo:e.apiAccountNo,active:"ACTIVE"===e.status},e.id))})]})}const py=Et({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function gy({width:e,children:t}){return w("div",{className:py({width:e}),children:t})}function my({options:e,handleClick:t,selected:r}){return w(gy,{width:"full",children:e.map(e=>w(Xm,{option:e,handleClick:t,selected:r,width:"full",backgroundColor:"foreground"},e.value))})}const vy=xt({display:"flex",flexDirection:"column",padding:"15px"});function by({task:e}){return w("div",{className:vy,children:w(Zp,{task:e})})}const fy=xt({display:"flex",flexDirection:"column",gap:"15px",position:"relative",marginTop:"15px"}),yy=xt({overflowY:"auto",position:"relative"}),Ty=Et({base:{paddingTop:"20px",paddingBottom:"20px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0},variants:{hasPlaidItems:{true:{borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}}}}),xy=[{label:"Connected Accounts",value:"connected"},{label:"Manually Tracked Banks",value:"manual"}];function ky(){const e=Ee(),{linkPlaid:t}=hc(),{query:{data:r}}=Ks(),{query:{data:n}}=Ic({select:e=>{return{plaidItemAccounts:(t=e?.data,t?.filter(e=>"PLAID"===e.apiName&&("ACTIVE"===e.status||!1===e.isSupported))),manualAccounts:Pc(e?.data)};var t}}),o=n?n.plaidItemAccounts:null,a=n?n.manualAccounts:null,i=r&&o&&((e,t)=>{const r=/* @__PURE__ */new Map;return e.forEach(e=>r.set(e.id,{...e,plaidItemAccounts:[]})),t.forEach(e=>{r.get(e.integrationId)?.plaidItemAccounts.push(e)}),[...r.values()]})(r,o),l=i?i.length:0,s=r?.find(e=>e.apiErrorCode),c=s&&Cc(s,!1),d=Le(e=>e.banksAndIntegrationsSelectedTab),u=Le(e=>e.setBanksAndIntegrationsSelectedTab),h="connected"===d.value,p=h?"Add New Connection":"Add New Account";return w(Pv,{children:E(_v,{children:[w(Mb,{children:E(Xb,{children:[w(zb,{}),w(eo,{children:"Banks & Integrations"})]})}),c&&w(by,{task:c}),w(my,{options:xy,handleClick:e=>u(e),selected:d}),w("div",{className:yy,children:w("div",{className:fy,children:h?i&&i.map((e,t)=>w(dy,{plaidItem:e,plaidItemAccounts:e.plaidItemAccounts,itemIndex:t,numPlaidItems:l},e.id)):a&&w(hy,{manualBankAccounts:a})})}),w("div",{className:Ty({hasPlaidItems:l>0}),children:E(Zg,{onClick:()=>{h?e?si("NewPlaidConnection"):t():si("BankAccountForm")},children:[w(Qc,{Component:Di}),w(eo,{children:p})]})})]})})}const wy=async({data:e,accessToken:t,environment:r})=>{const n={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:xn(r)};return await vn(n)},Cy=async({data:e,accessToken:t,environment:r})=>wy({data:e,accessToken:t,environment:r}),Ey=async({data:e,accessToken:t,environment:r})=>wy({data:e,accessToken:t,environment:r});function Iy(e){return Vs({onSuccess:async()=>{nn("mutation successful, invalidating bank account queries");try{return fr.invalidateQueries({queryKey:["banks/accounts"]})}catch(e){e instanceof Error&&on({error:e,severity:"error"})}},...e})}function Sy(){return Iy({mutationFn:Ey})}const Ay=s.object({id:s.string(),apiAccountName:s.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),apiAccountNo:s.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),apiAccountType:s.enum(["DEPOSITORY","CREDIT"],{message:"Required"})}),Ny=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.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}),c.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),c.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),c.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Merge"),Py={transform:"none",willChange:"auto"};function My({children:e}){return w(El,{style:Py,children:e})}const Dy=xt({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),Ry=Rt(null,Dy);function Oy({children:e,clickHandler:t}){const r=gl();return t||(t=()=>{r.setOpen(!1)}),w(ce,{lockScroll:!0,...Ry,onClick:t,children:e})}const _y=Rt(St["modal-popup"],xt({display:"flex",justifyContent:"center",flexDirection:"column",minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"15px",position:"relative"}));function Ly({children:e}){return w("div",{..._y,onClick:e=>{e.stopPropagation()},children:e})}const Fy=xt({display:"flex",gap:"10px",maxWidth:"100%"});function By({accountName:e,accountNo:t,institutionId:r,syncText:n,active:o=!0,showIcon:a=!0}){const i=Cf(r);return E("div",{className:Fy,children:[i&&a?w("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):w(os,{Component:fh}),w(ay,{accountName:e,accountNo:t,active:o,syncText:n})]})}const Wy="TRIGGER_ACCOUNT",Hy="FORM_SELECTABLE_ACCOUNT";function Uy({onClick:e,excludedAccountId:t}){const{query:{data:r},isFilling:n}=Ic(),o=r?.data?.filter(e=>e.glAccountId&&e.isSupported&&e.id!==t);return w(Bm,{bankAccounts:o,isFilling:n,onClick:e})}const Vy=xt({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function zy({selectedAccount:e,setSelectedAccount:t,mergeDestination:r,excludedAccountId:n}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>w(Ki,{...t,width:"fill-parent",children:w(fu,{children:e?Mh(e?.apiAccountName,e?.apiAccountNo):E("div",{className:Vy,children:[w(Ji,{children:r===Wy?"Select Duplicate Bank Account":"Select Destination Bank Account"}),w(ga,{Component:Di})]})})})}),w(Uy,{onClick:t,excludedAccountId:n})]})}const jy=[Rt(null,xt({"& path":{stroke:"icon.base"}}))];function Ky({showIcon:e=!0,textContent:t="Cancel",onClick:r}){return E(Ki,{type:"button",onClick:r,children:[e&&w(ga,{Component:vl,stylists:jy}),w(eo,{children:t})]})}const $y=xt({display:"flex",flexDirection:"column",gap:"16px"}),qy={mergeDestination:Hy,selectedAccount:null};const Yy=xt({display:"flex",flexDirection:"column",gap:"20px"}),Gy=xt({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),Qy=xt.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"space-between"}),Xy=xt(Qy,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),Zy=xt(Qy,{placeSelf:"center",alignItems:"center"}),Jy=xt(Qy,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),eT=xt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),tT=xt({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),rT=xt({width:"100%",display:"flex",justifyContent:"flex-start"}),nT=xt({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),oT=xt({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),aT=e=>{Vg(e),zg(e)};function iT({account:e}){const t=gl(),r=function(e,t){const{mutateAsync:r}=Sy();return ov({defaultValues:qy,onSubmit:async n=>{if(await(async()=>ic({title:"Merge Accounts",body:E("div",{className:$y,children:[w(Ji,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),w(Ji,{wrap:"wrap",children:"This action can't be undone."}),w(Ji,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Continue",type:ac}]}))()===Js&&ur(e)&&ur(n.value.selectedAccount)){const l=(o=e,a=n.value.mergeDestination,i=n.value.selectedAccount,a===Hy?{...Oh(i),duplicateBankAccountIds:[Rh(o.id)]}:{...Oh(o),duplicateBankAccountIds:[Rh(i.id)]});r(l).then(()=>{t.setOpen(!1),n.value.mergeDestination===Hy&&ci()}).catch(()=>{ic({title:"Merge Failed",body:w(Ji,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:Zs,label:"OK"}]})})}var o,a,i},onSubmitInvalid:()=>{}})}(e,t);return E("form",{className:Yy,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit()},onKeyDown:aT,children:[w(eo,{children:"Merge Accounts"}),w("div",{className:Gy,children:w(r.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>E(C,{children:[E("div",{className:Xy,children:[w("div",{className:rT,children:w(eo,{children:"Duplicate Account"})}),t===Hy?w(By,{accountName:e?.apiAccountName,accountNo:e?.apiAccountNo,institutionId:e?.apiInstitutionId}):w(r.AppField,{name:"selectedAccount",children:r=>w(zy,{selectedAccount:r.state.value,setSelectedAccount:r.handleChange,mergeDestination:t,excludedAccountId:e?.id})})]}),E("div",{className:Zy,children:[w("div",{className:nT,children:w(eo,{children:"Into"})}),w(r.AppField,{name:"mergeDestination",children:e=>w("div",{className:tT,children:w(Ki,{onClick:()=>e.handleChange(e.state.value===Hy?Wy:Hy),children:w(Qc,{Component:sa})})})})]}),E("div",{className:Jy,children:[w("div",{className:oT,children:w(eo,{children:"Destination Account"})}),t===Hy?w(r.AppField,{name:"selectedAccount",children:r=>w(zy,{selectedAccount:r.state.value,setSelectedAccount:r.handleChange,mergeDestination:t,excludedAccountId:e?.id})}):w(By,{accountName:e?.apiAccountName,accountNo:e?.apiAccountNo,institutionId:e?.apiInstitutionId})]})]})})}),E("div",{className:eT,children:[w(Ky,{showIcon:!1,onClick:()=>{t.setOpen(!1)}}),w(r.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>w(Dg,{disabled:dr(e),showIcon:!1,textContent:"Merge"})})]})]})}function lT({bankAccount:e}){return w(pu,{children:E(pl,{placement:"right-start",modal:!0,children:[w(ml,{children:e=>E(vu,{...e,children:[w(Qc,{Component:Ny}),w(eo,{children:"Merge Accounts"})]})}),w(My,{children:w(Oy,{children:w(Ly,{children:w(iT,{account:e})})})})]})})}const sT={id:"",apiAccountName:"",apiAccountNo:"",apiAccountType:void 0};const cT=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],dT=e=>{Vg(e),zg(e)};function uT({bankAccountId:e}){const t=Sc(e),[r,n]=m(t??sT),o=function(e,t){const{mutate:r}=Sy(),{mutateAsync:n}=Iy({mutationFn:Cy}),o=pr(String(e.id));return ov({defaultValues:e,validators:{onBlur:Ay},onSubmit:async e=>{if(o)r(Oh(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const r=await n((a=e.value,{apiAccountName:a.apiAccountName,apiAccountNo:a.apiAccountNo,apiAccountType:a.apiAccountType,duplicateBankAccountIds:[]}));t(r.dataObject||sT),e.formApi.reset(r.dataObject,{keepDefaultValues:!0})}var a},onSubmitInvalid:()=>{}})}(r,n),a="PLAID"===t?.apiName,i=Mh(r?.apiAccountName,r?.apiAccountNo),l=pr(i)?i:"New Bank Account",s=Le(e=>e.FEATUREFLAG_HAS_MERGE_ACCOUNTS);return w(Pv,{children:w(_v,{children:E("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:dT,children:[E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:l}),s&&w(Kb,{children:w(lT,{bankAccount:t})})]}),w(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:w(o.SaveButton,{})})]}),E(Ob,{children:[w(o.AppField,{name:"apiAccountName",children:e=>w(e.TextField,{label:"Name",disabled:a,placeholder:"Enter name..."})}),w(o.AppField,{name:"apiAccountNo",children:e=>w(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:a,placeholder:"0000",maxLength:4})}),w(o.AppField,{name:"apiAccountType",children:e=>w(e.GenericSelectorField,{label:"Account Type",options:cT,disabled:a})})]})]})})})}function hT(){return E(Ig,{children:[w(Sg,{name:"BankTransactionFormRouter",Component:of}),w(Sg,{name:"Conversation",Component:pf}),w(Sg,{name:"MobileConversation",Component:yf}),w(Sg,{name:"FinancialSummary",Component:Qf}),w(Sg,{name:"BanksAndIntegrations",Component:ky}),w(Sg,{name:"BankAccountForm",Component:uT}),w(Sg,{name:"NewPlaidConnection",Component:Uf})]})}const pT=({environment:e,children:t})=>w(yr.Provider,{value:e,children:t}),gT=async e=>{const t=e.queryKey,r={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await Ra(r)};function mT({children:e}){const{query:{data:t}}=xr({queryKey:["sdk/introspect"],queryFn:gT}),r={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?xi({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName};return w(Hl.Provider,{value:r,children:e})}const vT=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const bT="SSE connection failed with status";function fT({companyId:e,customerPartnerId:t,sseTypes:r,enabled:n=!1}){const o=Tr();b(()=>{if(!n||!t)return;const a=new AbortController,i=function(e,t,r,n){const o=new URL(`${a=e,Tn[a]}/sse/v1/subscribe`);var a;return o.searchParams.append("customerPartnerId",r),t.forEach(e=>o.searchParams.append("events",e)),n&&o.searchParams.append("companyId",n),o.toString()}(o,r,t,e);let l=0;return ke(i,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${bT} ${e.status}`)}(e),onmessage:n=>function({event:e,data:t,env:r,sseTypes:n,customerPartnerId:o,companyId:a}){switch(e){case vT.CONNECTED:return void nn("SSE connection established",{env:r,customerPartnerId:o,companyId:a,sseTypes:JSON.stringify(Array.from(n))});case vT.ERROR:throw on({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case vT.CACHE_BUST:return nn("cache bust event received",{sseTypes:JSON.stringify(Array.from(n))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{fr.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>on({error:e,severity:"error"}))},500*Math.random()),nn(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void on({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:n.event,data:n.data,env:o,sseTypes:r,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw on({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(bT))throw e;return 3e3*2**Math.min(t,3)}(e,l++),signal:a.signal}).catch(e=>on({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[o,t,e,r,n])}const yT=[vT.CACHE_BUST];function TT({children:e}){const{companyId:t,customerPartnerId:r}=p(Hl),n=Le(e=>e.FEATUREFLAG_SERVER_SIDE_EVENTS);return fT({companyId:t,customerPartnerId:r,sseTypes:yT,enabled:n}),e}function xT({children:e,environment:t,accessToken:r}){const n={activeToken:r,accountantToken:void 0};return b(()=>{var e,n;e=r,n=t,Zr.setProperties(tn),en=n,Jr=e},[r,t]),w(pT,{environment:t,children:w(Tg,{children:w(gr.Provider,{value:n,children:w(mT,{children:E(TT,{children:[w(he.ConfirmationRoot,{}),e,w(hT,{})]})})})})})}export{bg as BusinessOwnerDashboard,xT as Tight,Ke 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 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/A6S5HKIyonkINuCY1IDH08OwSHXZAk2nWJMpV0sOSRQfJ8Mxg4cY4w1gUfPh0YHlnHDTjsR8Kpsr4fNvjG6yQF/vQ8Y6310Ab3l1u3TH7XpfW/8s9vnt1z7KJfVAIqanfPAUwebQYRjeFVbTQJOIiOTNRg5VUUanuZrKZ99leleppUUgQvF+iRBLf1gHLhhl3m2rgy0rv2U6fbr8XWtDc4cfeqOycl+//5IDg5UZ9AOfyI5TJuDwWDeHMkxrBr4xZLTcLChtl5ijA0TPKpC/TheVjBi2dKftJF0+nEaeCnPeJyPYSXn/knZ5m7lNi7kywROBl2ThJzB65xxo0l83CA87lASak4By7zZBEP/gWV/uvNqB4hMqPU9jxE48LutYYsY9uEOpXLUbHaU7cNE775JyetWjq823/QzOQ5e/HQMOWjdYL3QVgdHkiM56yUvPTJGJ6DEa36gp4/m2PFHQ8+hqdmvihsUHS0q/+wEMhpXJibsdxMGD2q2qoQGNgFZK/smxZ5PVsqPJAcjKNDQY2iaKSpEESrfOCOyUSHQE9u6mnJ3CIfRBwLgaGkDSrPtcfCRhZcaKZN69KEb8hxHklH5Q27lQ19jkV+Tf77JzKuC4m4SwjKsgB2QeldLoqDMnUk9i7k6RdlZH3BaitDtMPoeI4gDatyd1DV6JqXazKnvRlUnk9uSgpCIAxlDjk1iS7SQCY7WEiLxxK2WxcWD6qdHQ05gkSRFKUUqKMTREcHZr4hhKujtlmyFalUdMu3sK19rOB32DUyyAjqITnrlXzhORXAwFNiJjy3TxSM5XldAt9PVW3z3nw6tRVwx7dBrnNBJdLd5Jr4TRGIyOSmUZQs9A0HJzuqM09qciUhOBqxg13mdWGboaGJGLzp8tW5imKOdNObNT4h2QAeEXLFDW81/K1VRJyQtgVWZ7jRpcwZxdUwaWIqplg6HDskROJUBgckrJmeIE8lqFpueEywoMKmttAu8C8FBMMOc9CuEA2ZcE5N+9byaWdxY3oCywBpniD7EaoCh1D0OxUNfGK4g6OlcZj4SBb0God4LMrL6ZKDgh/MpZ2bjJw5yo2PWj2jYpiWm5TSPh9eKXxPT8oE/1kIuRhw9ykGlOzhk06D4LeEVgy7tpyAm2QcZNZz3bBiIDDhxoc3xwuRQUekI6ozrPDCtNsS0yLByjJ/6lReJAae6SmCqONowiEhMqjpdeZewYioLo1Z9IFQXczLSZwYhgqgKwkECGq8cHLGjGHMS1k+OkxB4xmgBGHMYUEsEdMnzoSIxT8u7Tiy8lR8s20/cVi1SzKREj7CI9YxmXKamkcRrVoNg2cbTABjdxKDrNh9OOncVH9mcGws6epJ1s5z0arDhV8yDLwH+qrx9RjbnElrROrG8uOrcT0/2y8yGiTI9NaF5T7xSllcHZWllUBZX18pAc7YYExP9MjnBGD8gYk24MuAhVJKObVit1Zk64qClbx6bMnowhg6+xNJxI1uDYCqIhADtAiJ/OckBI+AiOeCcX1kt0wrill2byht+YXt5zfXbyr6r58rW+ekyM60EibeqpJxfXi2nzi6XYyfPlWeOnylPHFko3z9yqjx74lw5s7SqRPXLlD72q95EHFSY1JEALkxIdclS3ZiC0JRDkQQRbDcBnoNta124UHYyMcwHUt38mZvrhII0pvmMe64INN7+2h3l937txnLXzdvLhqnYZVj3Mg7nl5fLwaOny1efeKF88dGj5fHnTstPVRa+ZmvxRAw9n6XqjcU0lk71PrSaehs4Puf4xrf+xdrslmt9nQNjPJdpBAmCq8UJ8wSSy9zJ8qQehO8NJXwctb1eWVwelD3bpsufvveOcu9dexF24xXpT9O6Z3xJlfiVx4+VP/nHA+XU0qAmSZXtk4RhsMOHuACrrZrAS9lFevHYk6xBxrG8IZ2I8eRUGXg0dS05ngfdSYE9lpxbd28sH//De8q1O66Q4vieFYDLa92ETmkxuvmaTWVVier1WJh49AAnkxJVkknNmwASNVUM1aQU7se00rTyiV73QUi0W6uqJ5vBmWLZn+CQnCZV5TMp2YOpwim7tkyVv77/9U7OYCDCz6lRfAePL5RT51fKhlkuVXzMLrwbiMBoJCHd+MwNHR07rQGxUayXAgmoyq2SqoqDrmMnB1la7YdJgWaGL6+11dXywXe9uty8a2v5eSYHCwNliMV7RQY3dILG95GE4GO6a9fqhLFaW0s1Jo5s3BnJh1dJqqeurwGecupbteR4LCnd5GQiwV5cXiv33Ly13HvnXq0P//fLKh0e7ynGp188I8fD825i0ifXj3zRX2veZymGHpc6vThdfhOsA69BjtmGIvepAABVYuMWCq3mwDq0rLC1wWp55xv26NY9qauZ1xyRJLBZD4bzsNbzGpKWR90caCOED8FlrCf5tdXy7PPnSl9rUbtw7S+CETgK5jHvJMToTWZ9m7YmVtxnAVazEx7Kfcq20mvX5nF3sopLNBMWoNIV0Ja5iXLnTVeVCSWejV4uktigdeeYYlP49SeO6bI55URsmdtQdl25qey9aq5ctWU2lHQcqATw58z55XLk5KI3j2k/e2xkdaAYIaHnEaRhu4BUCSpMMOpdjPOZ8UsAmVRUn5Vk1EpPZ7JHgcTBXlFGdmyecWCZEOuuc8Dnc4vL5Y8++d/lX793vKx5qxzP6Gwot2oBvumajeVNt1xdfvUXd5bb9m31bvuF0+fLC9pITkyyjIZTnFTHITtBgZUjTkqlm1TpQ3Z4l/JKELqjjxqISIGXXtkyOVBcOWwMLcMaprtfdYXXF35fKCcHelbYNj/lnTHV9EqN6vnBkZfLQ98/UTZt3xwBicZFguqCkv0/RxfLV599unzsSwfLa/deUX73TdcpMf1yVuvc5GzIZcVIlciGJrvDSgebv3HXPE95TVoFwQhdqiCUAYCYZ8AOEI2a5WsAJiAHXQd4LIQTE9CEd4kMDaS068q5ct018+XQwkqZ1ZplNGHQT+hhaHZyuszOTvtS/cbxxfL1zzxWtm2aLv2ZqXRckmoRBCOUfchXNMx8gh14+AnNrepZhQDUkGVdjJcyVSCSY7EQ8lEHSJUciiQSI9HDi0R64N00d7EBj8SXaCzAO7ZsLB97353ljl1z5ezSitcjgg0bCaDLTtU7s1HJ2iK5CSVIc8eD//5IVr2TUntj4CsfsektA79+uBL4GIMi0Mn1WFeSX96jY8W8skRwxaBEq0CW0bQm2TpZYZFEgLnz9soLp5fKWW3iGt9A6x9W9HD62uuuLJ/+wN3lI+++tdyxZ66saId8Tg+lYnEt+8NlnL64mKtfoGbgzQ8JQHNSEKiymZTEpLecZEMX0VhGmHujiL4BRMngTTO9jgBQw0AAxhmoRN9OxXLjtcQx3WGOvHC2bNNifSFoyHWPJGl2eqq8957ryrtev7d865mX9EB6rHz5RyfK4ZcXVRX9Mq2nfbc0lAAKkgpwMuRDxuBkSCZPkpOouflg1Msf/nitR3In4jY/qig9KSSoE1eNQwvZmolqPDdfycPZ03rOePjAkXLbdXHXyVheqWd3rO2TtwZ337S98DlxZql85Ynj5e+/ebQ8cnjBvk3He1BXVfqZyQE/aelvN2HeUYnQkiT55Kdvba4wfVEpHa4gl9iYASvVfGQC6NOJ4ENglH0pU1pAP/e1I+VFvc/x9W3ByztwYqkoPptnp8pv/tKe8nd/cGf55O+8qty1e86Xnt8s6kTQOEH2SWP8sm/10oGfNKok1s3Q6/IkpGxwK6avY3UTW2+598OTG7eC4vhGqkeCgLeESMQLeTWKjpMGYE0OyWY/wmV2fGGpLJ47X950+464BNqpwbVLN8QJatWXQq/cfPWm8huv2VHmp/vlG8+eLPzCKe9SToIDizicJPsnfyTXNW0esuK3BZ0xpP6Ee5I0WDhRJrbd8tYPTyhBMEeSY2kwAMnEdIxjtBpx9SAHTcKRUFWRbtnfPvhSmemtlrtvvUZM/0nq0s1BAdhpJIobwC/rLeQN2zaUh596qSwqg95SyL5Pnv0OxZYU3IbeSQqJMU34PsmW0QRVX1eq4oUXI0GTs1QQzKrUGYcy2gAFH7ZlbdCTmCNkw5WveV8L78MHjpWzZ86V1998VTyb8exxGc2xAtX5oEaibrp6vuzWXujff3iCRSuExMsKRw7FqBDdlWpCYh5JcYJshLjAqJZq7wraeut9usS2tOANXMEyOchnctIwX9DZc3vBUCWJIBtEEqc5On3NJ6any3/+6MXyX489V3ZvmynX79jkS/CVNpHVVdDX/VCNNypJzy8slm8fOV14gWYfkeZP/kUy8Kf6qs5JkF+8ZIuYhrTkZaJWuMS2tksMVxAO8DYWWFwyMACO3uUKw7arTFaPiMPkItMrMzPT5bmF5fJPXz9cHn3qeS++u66c9XtpFnHuYD9t4130ns3T5V8OvFgWpc7lZ3+UEC7/8DViwnc/QkmEsQPVMWJLmejh4vPg9Iv1i0MI2awcigGqsbLWrlfJOXjktRXHEMduhYVRmbEldcIElseFtdkNZf8zZ8r+H32zvPqaufLOu3aVt75mZ7nhmisst6Q71+Xmiiv12ivny+v2zpeHDp7SY4kePeRNC1oz+8fl023VL0gR1zA+aPGmAZyJugbNbYMeATmYCC7PQPSdM8KZwgvOEgny2UIfy+iKap9qZVVMJ1bjKW34JlVRx84Pyn/oG4rPPfLj8s0nXyhT0rlWrzc26PsxfS12WW1Ctp/TVuKrzy6UKQDsC37gouZ2RJm0azrA9yXH3QpfqXZO8vATwtpmaJH2N6tRB+EPShmIexSNO6RbkhdccX1VRXWSA4ueA3rg4YebHRmON+gut0H7JRVN2X/4TPnSU98rd+58pvzxO28p9+j1BtV0qQb2Hj3LeSeNLSnE2whGynKtchhOCJc/MpbjoJF5GrcWdsEmxY08jGRIdZCSiQW1Jikit15s2DQELXAbDMiL+gJQ78J85qxgUZIWWKiwdmzU5Te/ZVN59ORKed+nvlO+cuBomeah8RKN+DaqIlN0EKUrf2RUuHbGVcWbR24k7KV1cvVTeVxGvK9LSbcSWeLbkfqpVeZXOPah60t1XtLNvSjDzEDtxe1WCDK2Kr1zSszbbruyfOjXbyz7tkyXs3opdl6ZilLmLNez2CwApmC1cz4/NVU+/chz5nBiXukT6iQb2/UhU0HjR9y6dbcSMOcoaKITvJLhpPhuxnoD338RAhM1v3J16cGsiYGVKTBPwtj3xhAk152McoZsHiaG1dtRTfVW/VU7N5X3vfkGPXzuKQ89frx84bvHyqP6Cpkv+np64cXXx6whblWXQPQ4VjbrlWvlBP8iR8zxiiSeBxEKX+njZZ4iYTlAEJ7+czLkN0mNeUZLNBaLgVScIJecRMcbQKbqEKAoAyEjHJ0MjapqysObVMB7t885fXO6fH777n3lt163uxx8/nT5mnbAX3vmZPmBvrZ5/vRyOae1Rt8QGXdK18qvXLu5vP/N1/nVLdSLNZ9QGWORDnUcDt/wAb8iMVwokZgunbHnPuMEwawGQ6ePnov1H5kEWAT3iFaaxSuvZgWNMmD3SvjwUFRCkI1E9sqcfq2xc+us7kZxifBuh3bD1VeUW3ZuLr//xrVy8px+nLBwvhw7tVReOrvitWj35g3lVr1dZOPHw+orNS49RB47dlYbUu5K+oIABVcM8eERcUmonli569b2RDEd0mrKIHDF6C426oRniYKQkyNq/GYuEsLlIOfaesjUJnAnHgW2zk2V7XoUSHpl+0cMy7oekJvRY8gNV03pIZT3OSHBgr6iy3M8OeM4SHNyjp86X779kzO6xWsRrrEEemxWI5Q4+eiQGGNVewIxjvE42DMPTI8XZhKORS4YFgvkSki0mGIA54ylknHuEDFNv+/RJmbXlg1lXgsuibygsfCKSAXwBeDyBQJjhBFfhjzuXPv1CHP4jN5l64QI0Xckx6Kxq7u6Pqyuqi9MxzCEUw46E9AkE1/7pA5EM2rs0FNJZycBg+Q0IaGWQpEjvmbed+VGb/jWy0/o/GxHtgY/OXm2fOqRo2ViJs6zlvw40S05+IXfUU0ahKc14eMJyfjsmVTRlpkILqBEiWnIAOQ5h/hw53JNcE10qwe+DUMv5Xr9KCr3JgYb90ZE45gZB+Zdmsc1mI6Y1yr2Vx/50tPl4Dn9eEF3xNjH1KrAR7tDddffUwvHCah46Q60/AxtSFltWEERU/Dl1ahPWBoSrRr6IR8ZrOPoyB1vAjlzkxPasut7Mi6ndURHEpIgTkydWK+OCYS73LJe6P/5vzxZvnDwdNmoX6ax7+BExzIR2lk16JhSg+omJu3RewuTBMkSIrq+zUMPIAWi6BiPt1FKnalLUQxzXwOZF2V/9fknyrf0fPWuu/eUV+/bXuZ0GSwrSSy+3aDH7aw3xwY/t6MiDzx3qvzlQ0+Xh4+eV3K0VxIzkiPT2h2TjExOJjrjcVXhoP5okVANPA/i8ChtTVqCrJHRegJA6OoqNgrJCwd01Mpcb2zmRYKRV7ErkrODqfKZ7z5fPqfN4W0758q9t+0od99yVblxx3y5Ym7aL+a9SAuKp/JMmi0RtD6xk1grZxZXyvcOv1w++92j5fM/OFnO9CfLnJLDbRR5V4UG+Gk/AsRjQjEfLzM+ZCkE/ed4kEFQLfsctwR1GTANJsAEh0YLugZWwJNozbgYOMqLsvlNsxZ77MRK+db+Q2Xmy8+WnVdwW5/Xr8Pmy/VXzetLw1lfjvyAk531qhb4c/pG5KUzy+XwS+fKgaML5Tv6LeKTLy+VJe2NNs7NlFmu4fhryYl59ZdE1GSk//gXiUxd9bURytD/SpQ8tJYgDNBSzRuuIKUtzyL8kApQUbxn5G4BPRHU23IpGzZMlhntpsE8qnI5/OOz5d+eWRBf361LbFoLKV8x89ihH9RpH6R1RrIrnGUlZUr601fo5RoLLvjcUX1B0wvGdscWY9N1UMMv+8haJV20siDgNQwGNDFJZizSpgQHYgQpImPLVp6cbZmWoGWDIjmyHToGBrMzt4OVRJVMKuiZ/pRuoXH7BRdnVtCTnUnRp9SD4RTUm0SOgY6kSNNy4Q9O2BYCahlLd12NlAKt/5oN7HQadIzrzxXkwDt8A8sYwXZb0EWxwhizK6gxDtB89B2sJjVxhZH4fuVq4QyQs0yLXS92+aRZsC3R6ENbiWlfhTCaHPkjHTfwGOYcoub2O56izKsbxapkzTiEg6FkzQ6vO8RIaHcwMKq/dFYbF6s054DtODZuK1iZELgkioA40gceNjBkH2wzfEjsNa2DDlhSkdzgk5TUSR+bDiIVl94VlMzsm8PYb03nTAo26B7G0AFmlP36unBHG7bSOThhG88cSnUydCyLjD/VRvoSIqlVZ0LRZdJNTmNkcsTvJs2+dDEZS3a4SDcEAg1n/P9AaAxQnDsmEZh0o3FW6yRJ6yZJzAwUxZSJtSTskYFm2+iSIiDkbSf4ZmFMPN4D2X76UHvLoFcHKWP8iml/wFHLV7YhDzEKotZqx7DF67wq44gNVB5dGq6hmeNANOr62OSqU5kAFMBME9C5lMIOE334M5iZmuIuxDhdaNDSRtyp8D10k2472K944z18Xh2nvDElixweYbK1cKhNO4OO+piOne5IMo+ANarrzyg7LObmcMjTRmD8kQSzSog/KSj7+J3Vg88WS7vKY0aVyUnZlhxg0asfoO2z5nlnZCPqS6y750EwDVqJuT6cs/FmYyZSjpVPf6HoiCr4yGTKPa9KQasAknMA0ibgCG7Ul0iMBaqN0E1siG2M2fSTNaiOnRgEsYd8NU9Pzerfz7lYi1IOBalWxWYk1QR8AS156/TcosOR6hAywrYdO40hJOir0TpGM7litpb2UR+vnoZr7LCT8hGbYMRjzAee+b2100rQ2qFmRQPcaq0Ctrm0DcJl0BzXUFMooRvHplMHGEzjySNQWutxzBRhJNHzcNpD0e2D+gyE+QivTunMg19l0gf7mxhUk5YClgMvCZQNvqz1D/UV64MAOWNDHEhuBtKoOVHpF+sSB35LFcnpKGQakhS8TpSVMY4V86F2FxMVB18zgSyflEkt00RHLMboJTc9arwH+ytryw/oFjq+DFkyXWZiiC4Bmo1Y9Gc7JK4rE6gAJjhfUizSjMWPUEKBAGktEXVuog7tpNrRzhwBQQY+E+zRq1M1EZgsDXrL/Qf6hz77oceF9Ilgh5LHDT056/UVdYyFaoQ0xrjINIKu69K6Mq55cxI3k5PzDLDNJc0YufTSvYOHEZ/E0cy0ptMrnzj0obc/juXyBP9m11rZn2A2Us8a/GiimpHzS/cjxi8iHjJdYMZZ0BlaVb7Ap4uAdsgjWwkqSS0TFWKaVTOO3zJr+3+4tPBB+E4Q/1bXgRcW36Evhj/Ov7xU5UO/HYdAjfT/Mugms8V22Z6ManfOucLTmxi+G//4DxdPv6O85/bhP/LWRb/tA/98u3ak9yt39+ndyT49GM77uaZdm5KmbMm0aFklyGCca7iNkckPdE9Dx1dw8kRHzrTcWEqeHxJ4DfJY59IbRt5kVlwcl55tggG9lkP6F5iSgS5+2/t4jHT/tOI9JOwHy2r/gSfffe3IPxP4vzL3JrQKxzmrAAAAAElFTkSuQmCC","Stripe"),jk=Hk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAABGNJREFUeAHtnD1sEzEUx58vd72UpmUBJhYqZtQFIYG6ICiUsXxIwARDEUJiABZWQGIBBgZAlWBjKpQBUEVbIaEWWBFiRGJgLAP0K7nch/n7koaUJvWdk1zTnF0lufN7tt/7xXc5u/ZjJEm2be91AxoyiE6SwfYR5z0owiXF2lXMiLFlCvjXgOilZdCU4zjfNzKW1ROaZnaQDH6VMTYEnb56els8f4FzPkUBe+h5hdlavtQClLNs+y4RG0WBrlqFOjCviItizHWcm/Btqdq/NYBylNvp2O5zwDlarZSeYz5tO9b5JVqaX/W5GlCvZWcnIDiyKkzp54zrFEbg+6LwP7MKwbK77+H47Op5ij/7M6aVC3xvUjAIe5Bpdh9iGf4e52m558i+/yL32WHPy3/ErzdShq7hXcMJYYRvXWUm6EHZ7B6L0xdkd+pP+T+34x0tuIwGDMPnwxpOTXJ9go2Ba+x0TbHOJMGGmXZ2HnfqHZrHegIYT/0yymOr9VKdg4dr3mOCg+rA08ct/gX59C5g7DfqqX7obAe83OB8O36NjsPDUzCo8swXwzjOzC57GQPSbTEKCVUXOC67hcLTmOU2Rd3KZi8C0hM0bsUxAAPZldJzUJxSQpfTxFaBI8yFrc+EzeI4blIF9DZuQ5utH1DwRsUGJUC456yZElBpOPkymWWVNpUAoaF2uyFH8V3JZlVAUQzqCB0NSPI1akAakISARKx7kAYkISAR6x4kASQGq0mlbrMrex1PUAfRoNIzCcpx/H3yioX7OM4nYXhigADnBmN0q2GnGA2jLgZItxuuK0IFyV1ijAYj2BNNpZl1SVpMDhBh5qh5qZl1bWhVkoA2NKRdhRqQ5JvRgDQgCQGJWPcgDUhCQCLWPUgDkhCQiHUP0oAkBCRi3YM0IAkBiVj3oDYCpLK6op75zayrXhthfnI9iNPshpbEEXKai6PeiG5iM4qYAbyHmUDehCnXz+Up10b8jlw2MUCwKA/H7kS2rE0Uk7vE2sThuGZoQBJiGpAGJCEgEesepAFJCEjEuge1CJDq4nOJOS0VK9ms1IOwgj3XUldaUrkvtrPHTkqAMFw4EbulTS5gkKFksyqgESzvv7DJPkduPrSVITCCQlLdqyGa8rBWZxwvbGYJ/uBcdc2PgtmRimAzi9EHq47hdQYlYo87xV4NAWgFm1m6IzWZMiUAyhthLIuUOR7ZXcT5MBDo41vkAmlTBBsDUVDG0+Z3VH8FG70tvD6t0rZwKhR+YB50pr5eOiUhE7ApPQf59AAYECJGpzKBIlZUCialja5B4P1EQI9dOD9QVkj5B3vkufkxAaHy/yVEO5nLmOZ+5PWnnI4Ij3MJDMIrqnqosWg75jksZp9OLyARYEkwKMUOEhwqPUicFKm4Evj+q4yZQaATNvC/XOh0aEJv4Y8RomsUDEQMgEpaA6icWwSkSYOZH4jxXgxDdiPfrpTorAMR5O01grxd8VxH7KsPL6tqF6UDzLSHCfwLHN4iAPR6ZXwAAAAASUVORK5CYII=","Square"),zk=Hk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAD6NJREFUaAXVW1mMW9UZ/ryPPWtmD7NlGSaBBshWIILSUngBJChCBYkuAgQt6gNVpb5XfarEQxEVLwVa1IpWqIIiUKlYqlIgbA1RIXsCyWQm49ltj33ta/v62u73H9szHvte2zOZCPiTY1+fe+455zv/f/7tnnGgBuXz+UHevovlDpbtLJextLB8lSjOyUyznGV5jeUVh8Mxxe/GiUAvY3mGxWT5upHMWeYuzKkiR2UNG97JuudZWivvfc1+a5zvD8ntV8vnvQowwT7Gm0+wOMsbXcw1+0TaiCGUPI8l/QJyjhx6AmPobRuD07Fhw9hNMccbvyDo35UaLAMucvZl3tiwWaQMDZORQ/g0+AIiqQtwuxxwuTzIpYHrtj6Cka4D8Lmb4XE1leZzKb4F9N0lTivABCvyfoplw8R4SQ/i8OTzmEq8D6+rHZs8o+hoGkEocQ4XYh/D7fChv/0b6GoeRH/rbgxu2ncpgYt47yTo6RLgZ1jxMMuG0IL2Bd794klo2XEMth3A7s33o7t1K07OvI7jcy9jidzOcd2luJxOOJxZbOu4GTeM/owcv2RG4FkCfsRJ7orpeXBDkLITLTWPjyf+gJg5jq3tt+LA8E8V2M8u/B0fTT6NiD6JLW03oc0zjHw+h+uHf4ItnTdhIv4Ovph/B7l8dqOmUtnPg4JV9qvYWVfl3XX9poL67MJLWNRPoD+wH9dueQDNTd0E8i6OzP0N2ZyBfYMP4Kaxn2OwYw98TS7uaSeuHXoI3f4rcGT6RYTj59c1dAMPCca7BLA4FRtCwehJTGkfweNox/7hH6DJ3QbDjBPISzChYVff3dgzdC+8bj/a/X3wOH3c0+fRxutdvd9H1hnHudC7iCcXscj6BW1t/kMDIO5ws5F4UBdNhpnC+dB7MBDF7v4fY1NgBA6anZnoMe7l82h2juCawXtYVzAMfm8nueuFkUmqsZt9/I1mnF54E7PaKcxFPoemdeL2qx/DzqGrL3p+xQ62C2BLj2StI8xEj2NCe4/aeAzber9FZeRBOqNhPPIhRTmDfVvuh9/bsdyt2+kHuF3n46fw1snHoRnj0BILyCOHtBlFysxicj6KP779OO657iFct+O7y89exMVlAvii1WImm0Iw+gnFNo7R7u8g4OlQnNRSC+TwEbT7tmNz2y41z1D8HKaWPsO5xYOIJ2LI5iPQMjMQvmezWQKm9uZCmNk8UkYO0XQQL374eyUt12y9jtuhaVlKVIdr+2gRwBdNejpMcf4AHk87elt3cEIFHbiUCiKTXUKHbwgnZl7DdOwYluhxmXmdezulzJIgzWYIVJAKCXJe53N55Ak6azqwGJvHn/79W3S19CDga0FTUws6Wzqxf/u3ccXQXrUY6tkGPjYE8Hz8DHJuDb2+vQh4u5GiKIf181RA71A8M5gMHUIwdpgcNAnEqcR2GaCAs5koMfMehZwc19MxJFiUCuBHwO9nfzlcPnA1HRavTQ/V1RsCOEixNdIZgs7hSPBFTEb/h7A2Tm7l1KQEUZbiWaDSd/VkSjWyALIgNNOK4VIvToqQ3BPQ6VQGEXI+y9XwFARK3a/3sW7Asm+11BzNxzlMRz5FJm3gXPIgfAn6ymRNjhORyRU+6k2j+r4AFg5bkeI6+1/Sw9znOpo8VIAN0poAG6aO+cTnmA5/hjntOOLGDPfkPBnpoG6VlXcgnTbXDbJ8zoVFK68pu+ZCiDjH9CWWEDqau8pu1r5sGHA4PoFDk39GOH2G5iPEmIqj5h0EK4ZEros4+b0RRIVdmyjWeVcOIW0ewz1jtduW3W0YcJCmZFY7ShGKqf0kGnS94lo2vu2l2sMcQikpi1ZcapouE6HYnMVd+6qGAWvpBaVlRdSWNax9v1yL4j5mMEDjwpZkiTI5IgJOBv9uOJ0uVkllNSklJU2tb6sHcjkTi9olACxRTSq9xGlnqmdWUSOLYTLCdzjy8Ls7aDe70OzrhdcZYBjoRIb2N5lZQjQ5peyxpZSwD1FY0pcdh2VYk3Ifji3Ub1g2x4Y4bJgJ6JkwJyB8U2wq62LlMseFyeczDOavwWjPLehv24FA0yb4PW3kqEdxM5c3YWR1RPVpvHPmKSzETytur/RSYGpWJImVdgxWEkTAIXI4acTh9zWWu2gIcCoTp9tIJ7+GLGcpXl5GP3u3PIixzTejvanfcrouhxd+pxdpT5xeWKqgBypQicZXW6d8FSqvlRRQ8owElhLhhgE3lL9KGmFkJBFlQ8K1JnLxwOij2DNyD8FuZssKFBXPToQPIZaaoshaT4FWp7AYFc+V/xQJMPkvklgsr655bT1axSO6EaFHk6SIyRCrSYyS5Ke+ueVH2DVwO9zkcj2SrEYwcpSLmLIF3GjiQ3zyxdhsvSGX7zcIeIlxa4I+bdG/W35clIuJke4DuPKy26r2YlmzVZfioS1o3Lt5++HN6qFW9SE/JMAwjDQicSquBqmhPZygwsowPVOgMi5zTzcxI7ln6B76s6s5KwsxGTpMpXSOmllnci6A9sAAM5U7Ma+dQYxhn5MxsxXJCBIw1NLQ8px4dplsBqHonFKopeSCVZ+luoYApzIx9l4EWoY3S428uXUUnc3MbpSns6mtjwX/gUPn/0oTtEApyJH7zkK6tnlYJQSccNuKs+ycXA0FWZq8fOdosGPJJWpqnSawufyW5XVdwCY5mzYJ2GL/SoDQI28QnKu70U0Nx4P/hG4sEigTdcJJAjBYP8vIykGw4nTYkaypxe6xbC46RKemjhN0I4DtN1Gx+0xGR9ahr3C4fFiKVIe3X4Eqr3ay3l0UcdHC4k3JtyyMi0qtFlhZV2Gu7M9GSFqlmShsdB/XBWxkk8xN6UosKycge0YScZUk2cq9I/ehjbZ4Ze9Xtqr9uxEOC9g8RVpPE7AENA3Qalm0eMCk6ZAVzEmwUEEyWIr3OGzFHaZCe26Ei/7yJxMv0AQdJsf9SslUNbSoyDMKE1+a61mXxPtLpum5JSJ120qDuhxO8oVYhiUn6ZkKYCKmc7GTTMQxBragLd3X4/Zdv8JVA3fzSclbNWBr2E/NWLh8HKXYqKk5fjg+X37H9rou4LS5BJOpGquoxs03gUFmO0KMlUV5WFHAtwk3jj2q3kIUzEa1NFQ+JziEw42S7HctGWEwUT+4qQlYxCVlRDmuXbrGqYKKQ+N/oVmwFymvK4D9zEvvGb6P0lBjUssiLEFIo3ClXZ6amrlsaut6VBNwlv6zTg5LqGdH4jxMhD/Awc+fZsgnLp51WzFP+4bv5TulveQEg4YapDjMbhrZw9KN2PlEOqH2co1u1a2agE1GQLoZIQSObo2jYHL4kuTk3Bt4+9QTCCcm2bF1Yy9fhV418D0CkVStdRuZlaR31sJhcT60ZIxOzkVyWJx7PbWoUilEZkuyN90M+SbCH+L1Y7/GFJN81nvagZ7WMb4E38o9ai/aWQuLYDe4LJz4+ElyWNPFQapNNTmco5eVMJjpoIaupEIyYIVLotQ8ND0L9JM/Pv8cbWO48hH1W5LmLb4+7mXrLJ2sqyishjksU+CCi26IJevb4pqA03T6k5y42NtyERSwAk5SODn5V2ZuPDyzMRs7waDhrKUZEmmwCxpkRWiCOXm5WgMV20tcXE9T1wQsgX82zyipYrnFGRnYtBu3XvFLXNl/O3yuZpXHEmUkWQxxJl2gB2axDfL0v41swupWASEnr9I7awSdJVNCDBPTpn2iQgaw97QIUkyS8vsznHkZaNGevS2XY3PHVcxf7cFw536cnT/I90njXOE0X5fegL72ywmqej3FVY2lZuh/W4eGMqkygZGfDZHohAidD4OAm/nCzY5sAUtWImEscHus9gAkNepjDNzdup2BAKMeTnyU74O3E6SejlC8TbQ29XK8avbKtpiTWJgZS5fT+qiSMFY8rbVSJsMcdXReZUVrPVvNgmJrmVw8HaJ4rVYushBt/kF0MJiX3HKJhJvNTMm2NvWxqhqstBORPzXzphIWK8+t1Jd667AGzKJTVFysRxgmiqNkT7aAlTE3CFiNvtKBKB1xSCRoaNQ3LjydJ9i3MMWDavUOokmktAa8xckVNLVkMGuRLWA5caMTsLzOKCcX7W0kOYH3Tj+Fswvvc8/UN/bS15nZt/HR+HNkvgxpLQEyjtxdzx6WZ8X2yxtFSUzY0YpMVrTIULkk+WI7z2xavsK1lLBvllHSv07+BmN9t3AP34wOinnA28owMLDckyTcxR6fmHkDR6deLmjwGpkO9SC5y+Md6yIxkZLBVCklm5NYAlgC2iq1JseNcqXUrIV8uelAyGGVo1Ov4szcf6iVd2CTfxuBb4ZTzlMycokmgzzmcBTzsVNUUt7amY4iRBlK9uR6yDSZo9YKgG2ejwvgaZaq941xvjxzujmwmCQbrSlnOTw8cyV2WTKUk/iv2nsFhcRn+d9BjoqT0iiJTRDAYvrWRnkI4PnoLBkh23B1FrXY17QAPstSBVher8gBM7eDhtxrFJSIYCD4crPBKu47F7m6kpQTDV9LCxcHr/4qrNG6RFqEQnxqyXxIysfvtcxgnhXAcmz+tsrRR3u/jaFN+xnvLjBfNIkwbedSYoJKIYgkQ8a8M82J8VyHCgIKuk9JotKw4oqS1Edlz7V/yyPrkmhnQSTEsYkyv9XVKuaxil4TwK+wPMmywiL5Qaci4GtXpbtllDUFEv86kV4k8AmEeFA0kriARGqWJ/DidBnj6k2eTFoyl0KyG1Q+jKpXAZGbNuKqqtlIgod65BSA8r8IVLaBn2c9Oju6lLdl8byowlfctKtTbPwcfzxs0aiqSt4g+NzDTL4PY1vxrkHxjzOMjPLMhxyNiCanef5jjrmmBL21EEPMMPWB5Kcdan+Kryzip8yPLIBQcREErJTKPawAUpDUN5vLthIXsr2li4qykyfsBzDUsw0D3Vsx2l84BKf6Xfl4TrAWF3XjD4hn6FPLGwuDRaNEiP8cT0/zrHSQR4iDiCVm4PZy97udavJZk2k+LkIqlceJMwYVD7WAAJT7rHdkHejq6MNIzyg2d44weNmG7vY+enzdaA20qxN6K9iqrlYfEJfb5PKd/HqZpbAhpXKDSd7+i30vbYsYwcfSF7AYn+QL8ilKxQKdnRxOnE7Bnfejr2sAW/uuxFDXNgWyq6WPW4wn8bx+2nv74KNi2rJBVv8JQKkBQT/G6ydYLhno0lilb7HlUuSVjuI+jwzruosAt/GoYa/6GwkPwUlaaB0kYK3/yKPUWZHTz/N3Y2cISg9+9b5FjKv+jKdq2bixX2XDnSzPsqzTyeOTXx7JnGXu8kcdgmUVFXXjqrrlH+T2IH/cxXIHy3YWOVtd5Yay7sukNf0p3v8B6wxHdmdLODAAAAAASUVORK5CYII=","Shopify"),Kk=Hk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAEigAwAEAAAAAQAAAEgAAAAAYwsr7AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KGV7hBwAAG5JJREFUeAHdXAmYVMW1PnXv7dvd0zPTszCA7NsIiAsMKEhCgLgQeBokkTGKMdEkkvgiT32KyXu+MGrMe4pLPhQN+qL5jNE4EJFoIIpxWAK44AAq64jsyDB7z/R2b99b7z/VCzPAxBkZ88T66OnbdatOVf11zqlTp05B9E9IkkhIiU9ZmSbLZ+r4rXeyWcF1VF2mwbRAs5M0PlPxz60RKaWg0lKNaDH/c9EQxtQ2VWzalNf70KECb6Qp34yFs1HARwmM3DBilu5tsfKzGg+eMbJu8qiBjW1rKmKCZhLozyQqL3eFYMy6PnU5QAqY2bONxU8+6ZYSOekuL9uxI2f0xg0jfLVHL9BbQmO0WHiYFov2ITteoDsJrwf46dwbDJMr2WAQRzfi0uNtkD7/AfJnb7cDOe/FunV/570xF26dPmxYc5p2Obhr5o03arRoUaKrgepSgGR5mUmlZcwt4AOilRs3Bs95960JZn315Xqo/iJvtHmwNxElikeIrDg5jkM2A4KPEJqbZgGFk3Q1BsyDj65DIk0vkTeL4oafLH/Objev4G+xwh6vVE6esmZacXGI20N9gyCCoqzM4t9dkbgvp5xkebm+d26pZ+BeijGxj5YtG5Jf9cE1ntoj38mONA0XUfQ/0kzhhCOFblrSMBQi+KORlBAT1idpeNLdUV2DthEu3rko54pEgqRjmQED0GXlkPTnUktWcLtT2OOF2hGjny+eNm03194ziXwDbiq3RWlphoPTVDv7fcoAVS1Y4C2eMyfODW+vqBjQ8+3Vc4yag9dlR0OF1FxPYct2yeO1SPcwGGAI6CZoWU7HQ6IyT/In00mBqqyfhbDJAV07ZgZMU6OcAmr259Y5RX2erR514aPDpkzZw2Ra9+0kZDuUlWm7Q6VbF4ISrpozzSx+dEWcuaD+sflzPXuqbssO1xW5LY0UdYVFHhOD0TwC4sKgdBSQ1s2c7Fl1msGCWIK5bLIt4dekqWXnUUugoCbev/iRbnPm3s/cVzV1qrd4Bfr4GdNnAqgcIjWztBSsQO6BpUsvyN209onco/tLHAATd6UtDS9jwcB8PktLq8HyAAAUt2cLxxJeQR4dQIWK+m0KlUz4cd8ZM97BSw26iaCbIK6dS50GCLaMgYaUEq5Z+Mjt/l1b5gfqD1HYxeKjwcQRQge3dJpu57rdTmle6qV0yHW0gC60SH4vig0beXvhT255iGvICvR9crLv7VA4IbtTA9laVmaO4BVCSrNx/j2/C+7ffnW09gi5Hj8Ak2z8dYreCb3pugwwjXB0O2r4CntSU//hL+Td8YvvY/Ksqptv9hY/+miHRa7DA5ILbvaKOY/G395+sHDY4sdeyT2w7cJIuMV2DZ8hpAM6HSbVdTB8GiVNhyaMOlnZ2Z5Q37M2VF51/TcnDx1amx7Lp1Xn9x0a1Z6yMt/AsrJYZWVlr8Ev/2Fl7oGtZ4XjTpwMjxfsDCodItOR/nRxGWYkiL1jxwOm7gv1HbFt9xWzLikpKTncUU761JFB55hseK2prCw6b+lzFQBnRMSWUanDYoO4dxDjLh54Z8ixitYhcIlIliGyQv3O3lY568aJipM6oJPYSGs3pRSyNUlK33mvli/NPbh9RNh2TyNweGjgAXA5JjQrkpAR5v6SF5/5M+tRVtgY4z/EoF0O4orpZbHh/rLn8nZvnhVpaY5iCfeBc1Cv3artAv7/+yLJSZSwY4Esv6+pePQLeXPnXcO5DGF7fWsfvRSydU/8+ta8g7tmRUINljT93tMTHB4+wwCVoHu8kZYWO7hv+9UY279zLhuTnQKogm0dbDj3L1syxr/r/Ydj1QdIenN04dgAFG9O24S+g/sx0Xqs7gh5d2x+kA1dtrR5W3KyYWHXeFyCkTdZCAitFMG773jSX7OPwv5cS7gJ3jccV/h0/IkxwJB0YLsFGg4bicq1v8FYxxQLEedN9/Eb3BNETM6ZY2LYsv7xX9+Re2TvqLDUbGwZAM6XLUk97Eg3WLN/VO2CB+7k0e19vNRz/CjbACQrKgwBK3Pz5s29PR9v+7nVVAeZNQx4Go6v92X4LbD8u7x/NPdV3brjtdcGDlxFMSxOzCCZ1AYgmjxZ+Yr7r/zz3Oym6jxbN5Wond56JzPWEx+wb4xJsnPC9UU9Nm24WRXAhlZ5RVOlMwBB/kxIZ3zH6tUD9UN7r7NjERjImdcnEv8y5PCmWjclu2d0+LCqli8fDAwSBJdxenjHECgtVRq46J011+dEG/MsKeACVd6+dNkv67eHfVc5cPB12/7eNTxI9qenuUgBtHHRInb9xst37w56aj65kmJhmE/aF3MfwVytPmo+T3nS2GelHHvwfuo11Vcvr6rKVYcN6kSGHUlIwZdfVt8TX3/1695w4/CoZaMTuso75R50GQGsowyMgYXGgB7VMlJwSi0oPye8nmHLctl/XlLx2teSBHFchaTxlmLIihXqFMBbVz3NtCMQLB2/lX8nWfaL8Bd+OIq1kNy1jOS2l0kerQJgXcFFAl5uuIQ9PosPF3x11Zer4eIsLzUlai8i169fXyBCDRMIyhkbO/bMtQML8nnZz3xS5bi8ymtV72R5imq6LNNpVZ7fZeqk2uA8DZzTUkdixDgy568l72Nvk/H9u4j4tIS3DyodR4fzTqB1kjKqGPL5UAEnL1pj/UV8hgfoFXMZtGoVk6IBOzeP0CLNZ8YsMI+Zhek6CTFuUAdrww2Umb0ExDGBOpzHA+EyNjvs0ASfZbFYMHAqj1vCexYPFhUu48AZ6TADc5fwjumod8jiweP8jGnI0AHS+wwkc9xX8QJZ+QWUWPwECdOfFLk49Ca3w3TSfW9Ni2lzP7m/J3Ae3uHEhY+lTJzd8QEniLxFd5cJBghvcSZX11CSLW0RFhoo4ACuTUIRHqgHsh+qI3lkHWYvVaDHMBLdBoHldyPvCMoESRQVo0GYUAe3QvVXE/n7qTKqY0wHMy9rPkQZDD6I+sEeSWI6zleZTjXqccrOIdH7QnTOh/YNkETXeKB8ohEGIO+vI9kTQPv6kCgYlOyfC5BYR3H7R3YQ1e1KHtUiS/S8gCivZ3JSGPwMUApUWEVmHAebXj79Retv0VlbBW9KURKTGm05D+dMeNDxW/L0JhN3iGcUHCD3rCBx/g/JuHI2aUU9SNo2uVs3k7PmJdInlZLIKyAZjZJbuYZZlvQrbiHhz8LsN5G7aW1yBlFH9D+LtEu/A8w1cj85SPLDDYoz5ScfknbxDaSf+9+qTXloPzmvLyZ5GAM1ABJzR2pQWjBI+hz44nnSkO1WriNqwGQE8khWV6m+65d8j7ShI0j4/OQ21KPMBnLXLSJxBkD352BM4KgUPY6uUAeaUDF6uHm0IlC6OMUpYC/trluGkgWAcMyrCnMJBofZlGccomDes5I8F04g4UVeOk35F0pMm0Farz6k5eaSxOlnZM4mEtlB8v3gJogAvLLoXHTnZszmYZKN+0mfcQP5Sq9VFOwPtlD8739SgzR/8XsyvzoxTVl9O1Onk1X+LDnPzc0Mhvul9xtA/ptuy5SNzK8j9zC4JQY9Mu5y8n53Nsr0z7znBzn9Skpsupqshb/EpNWSyO2WAQkjZfoaMwKYZbj6CdzB70SVa9fmaVYcgQQsXZo6ZFLgMKviHJ3B8ZU9Qeaki9uCw5WRjGHgCICjErM46wCld6BfOAE0RY+feTXCmXwm8cyt20HGrDtPAIfL6N17kHklwOSu8YSdJMGoAzeC7tZK0i++ivxzy04Ah6shaoQ8548j370LMYEFmHjEP/C5fyYJjeMFRCzat2LTnjxkS6VrgocP50vbKrR5cDhPUuVZ4XKJQ+vIc9dLZJx1NvDEe+Q7+/eSs2e3Eh99+AjScgBO6p2qpP6wOKR+ZWT9JL/5HRYjY9T5marxN1aQs3EDeb/3YxJZCFh4eiH6hddpOvh2Du4nG+XIA/EHOO6OShKTvkXea24gwWKHJGNRSmz7EFzbQFrf/mQUn4l+gvvwbP70LorfcRGJgRclJ4xp44SYgymEHc/v88nmQpBoVAB5oqEgnGGBBM8QzAI1UxoUZugoiZFXkWfseNUgg2OtqSDrXsxo6DACElB82o/Jd9s80ntA+XU4ncgJklcrTuA8kZ1L7sv3UvTN35E4ZwrRPij0vL48gGQZ/HUxaPtGAHgufuRByYeqyTNvKWlY3Ti5oRDFHnuA3D/eB2WPDKgbz7w/kfeyGeq9MXIM2V/5EWyq9VgoUF+tbvDtowkOxzEbIsxBSUvak4gH4Evl9rkHx6a++TBp54xJcgheOIcPkfXgrZDdviTGXI0Zu5bki78haxkidNKdV9/MOscGgx9InJdOrZ5RXkDiE2/+NfkSDGyO+woFVkXIvPMpkns/wMj8WMmC6crqm7lEK70Ui8ZVJIonE/UqIX1wcaaMtXI5uU/dR2LclSRKZqGNKWSXfZsSH0FPIbG4aSUXYqV7F+wLjkv1n8NwwBpkOnGGNQmQhCdeZxYD73BmMuEx0QJ7A4oslZwD+5AXJSroRdTcgFmJkbjgqyQ/2kZuM+SZUxqoNoAw2VakWz/zcjvkPHKWL6TYH5+FvkvqJ155zIumUNZTfyExdDTRfnBRSuyT7SBuIQSzItwE7oHCDRTgo8ZEEracW7WNxGhwPttZjUfBJRgHFkIX6iGdFLexbkuLLh65lyzNWGx42UwC1FpNcWYyATCIGUGO00nLxSzaLQqYtEEna2GzBAvbKm9UZScbK0+VWK2xgckzxcs1K9R04jJWM5b+sZRY9FOKlt1OvLKlgdYKCsl70+1EvAaoBSBVkesxLUXThMkRAzA8WozXNNXEytqNSVAReKUMVcyhCCrJUeVYRyURUD/b/klZgkoTIzIpzvoH/5KaOT3D/h7kfrxT2TtcW4eS0y//N5JrV5Bs+ITkx2BP6ALPN6YfA4hnmQEI1WPgEHwkEQioZV/uX4mgnQ9JFBapfP4jI2FwJZRZ4xESZ04hd8MLFDt3JEXun0dufZ0qxyuZNvU/QbMxU0/ZZtXvQARXk2w6AhNiO7lHoBdTyXPJNNhEMGCrlisOkyuXQCR/RsaIc9JFyN21HdIwBO0DWMVFSa878zDmGDYP8Oc/tuENW8jikDesU8lpZ2WZ14vct/5MzkfXkoHVSoALfD/8KVn9BpIDA5GNQOPrU8kzsiQ542lWhe0kd7yJAdYrpcni4rnqemIXrjbkbPKMGcvNquRiNaIaDPDsb5Bv7r3kHMDqNPwJcl9fSO70q4g5iJOAVe3u363sLNYfvBIZNy6CfoIuwnP8oq9TYtVfyQP9JbB0G4OGkO/RV8h+/VU42GtJL72JTNhs3GdOzsED5Lz5RxLdobd4C4K+K3iwceX4SEsPQFTSAPlzm7BBDRtCBCwlF4wUZNdkcTDIev4p0u78JWnZ2WrZ9V4xk+TUb6K2oTrDhDJyDDZk41DWH6bE22vJGIwZQvKMHE36/bBiYWSml2G3rpacVX8h6tGffHfeR/oZvUiHwWkUDwUQ8wEO9AaSjMewjG/B1gW6Dlyi98HWBW37rvvRsXbf+BvFv3sRWdCJXuYeJAbJmH0LJCCu+qQy8YeN2fhzTwElcA7vC1N7QdYMYBKRQPBoPBiEkk1JYFOvXg3SY9Z5kkqQLT0kFGfC3QeRu3E5xRbOJ6fmaPIVv+WBpowstpRlBGKiEhgQukIMGk+JJVjh1q1J5aMx2EsMnpqtaITizz9Dch84Efs5h9k9pWOYa/TuPRUIXDm+bAnJ/e+retbSF9UAeXIyk4Iy+qBi0iZcSvYjt1H89eXJMlwZw1Bt8jMSmwexJx4mt+JZtDs4Aw6wYXouew6hX+sP9e4NHZFU2LTo6aftn69+41vecENfGEo2yijRU5WwCoiC3iQ/qCDn3XfhK4KihdJlBSebQ5TY+DZZry4hY+T52PPgVBqzbb+2TFngwhsAGy/BphzKnsWO92kAM7FzG1nPPI5OPofNKHQCFKyzuAwTikUAIiNjcTUQZ98espb8gZwX52MwZ0I8guS+j34chWWZA2WLvZSLSbM3rCXryfkYLPqaU0TOqw+TUw2lDe5gbpEtLYrz7HfWk7XoQaiNP5HoO0oxgEKQkVBICscrpB7r1nvHsFnXP5rKVW+p4Z6fPZN3YPv3w5FIDCsORppURQokLmJCdkM1sBv+js4Nw4YPxgvk1v3fl8jz28fJd8NPFCHucPTmUgWIWmHQaXnwHSIofFHQT3VKHsUqlQ1bqmhgckVkpQ5ulAcqFcuLbkOSk1BTBZrgxt7nJRUpt8A7/updyIamgNdARqC468BdBWerpV4pb57AT7ZBzVYTdTsXE5etjF5qwB6xCPqPzZR4FMR4jMwyyb8Sh4cBQ/M2Dhr5+/y77rsOb9kzpnSz42blbFY6p6VZRyeQnQ6jSxIgCwSxfxGDL1ODkDuWKkvaeORXZJZ+VzXCf9gQkwdXw3aZnuwEOEIMnAAgUB8iy+450W88N538zYqdw2gg2KL/+UnAuBycDCx6qk+861YJ3YJuFGcgn8uApvDlEA26BJVBh/N4RQLgovfZeB6aoSdyoM8KoTe5nAKHCabGhieAA+UDvYv4Ric7F/YBUvlMiNKkSYKdZvHC/MqWvR4ypOtBd1EyLWZ4YmMuJ5/khnIybvkNNo/XkItVgGBv6P0HHtNF8NHYi5+B3+VCxe7KsGNFCC7imVccxQ2zrmHXSqaD6CjnsTeB9aAvwKXQawDCeZmEcpyngAbXscuCf3MbXJ8Hzx/eKPOE8MbYCyucU7ocv8u0q97wS3xwBQQx2ByoztH86s22ETjWmTRJPe8dOnIrArN3+DBoVAAiqcSE2dBqwL5s3EwyZ3wHq1mO2sHzKpFW1DIep/hvH4Nv5w0YdbBzGFSV0GFO/JuB4s9JO5kspgaaLpehkXrX+itNj7+5jwxMm5QCqjUtLncCOFwJZRF7DfEScUTx81UHRWpemTr3Us7p8ePH17u5wbXkAxhOAvzWqkHMqgzDnO8zBDIPx3nafYFZY8Wb2Lmdov/zX+S8siCp/NiuOI0S7ndgl2o7lJVLTm7B3/geCEPOuBkcJKXiYxACEu/Wc0X8yL4faW7IdHWWNJxsMFDwsoluA8jdvIqit71F+gVwE3SHooO8u3s/Inft7yEW2G4MGIeyYZ6N0wgejJID0u2IVxb0IKugxyuq87hJJBaTo5bzpiuucGnFCnr/0sveHLtnx/aclrrhYddhoYYQI/GAAYYI5CvZdl79NZxNtRBbvMseDK45Xy3PygHF+67TKPFUYt9oB0yPtxn3Pj44f9zaZPdn4mvxMYFkTYPC8boH7rm3YPeWu8ItIRerAdfnz7HU+qSAc1muWZGyojzNwFGD4ih9O24H8gvN+kFnzyu8/Rf3lGNJmcmXZxCYfmy6y8tZg1HN2IlPN/uDjTCY+B2r/LaJwcD5UeYTxZaFtyWnIzjJkdl8z6MFl2Eais97nrP47ln63lkGIERWWcxFwyZO3OP0HvCswcpaaf22+ChxY5Fr/TmOyY6r8cX9yVcXEnHBl2ASuCk0ZPr0j4CBwRfz0p3OAKQyKirU2rzvKxc/0Bzs0eRxLB12CbhIMVe6zpfnG5aPTxOelkBhzZGxExeogZWXZbiHf7cBSEyenOAI9JHjxx+yBp31KxOOMJxI4JqjKvZlQ0nCNhN8M8geWPzw8MmT9+4ZQD5R2va2YlsFzJBxUBGLD8SrqeyOjbm7N5WEdRzsu47JCunEClzpdEs811oiQAkjNPCcyuDdD2GnjXiojgRxoqBEGDDbP7KpZNzsSFF/HKSFTOyMET3+JWAi1qu4v8E3gcLwUoRGTfgJg8NhwMdHuPK0t8sQchKMyFWUqHn8kdu6bX/3oXDNIZu82QZWLNRpt9oXnJUUOLwPTAQKuhu1Z429o+hfb32w6mbcSuSbkydJbXRQm/eTypREFd1068MNvYufDwTzPSAMDxr/vwCnY0qBk8DNn+xsg++QMTjI1YoXLG93b9QuQLwFQXCVsqS/dWfZD0JnDF0f8CHMAleLYJqffghhU4AbP9GAV/c29Rn+lrpgh1EsLi9nndvupKutRnujBUgJjhuG0RTbUll5xXlL7Qp148eCrwJ3HrDpPw3ETXEO3xmLZXk0P98Z21l682UAxcLYDOidjM1zMhw+lRUAksU39L5WUlKze8a1l4b6DN8a8HrwX0jAv6EZWPLaBf9k7f1T81TfdA+fasUCpuEP9RuxlS/UjR3ep46vlzIDfFqHOqxt96RuHaqLda+8+HLu4Z3jw00NUNw5Gu5xsGJipDpM79M6dqrvuSNq5Y03O1m5+Wao97B1Wy4vncET3eVXMtOdTROehAt2L91/92/zD+26JoqbQC5fduH7HP/IEZYm8rl/49gJOhJ60tJhnvh69KXGPmf+YcbceT9cBVWRnuiOdqPTM650Et98RmITIKvqg4ey+EaQRGSsgbMYNxlz1NEOdHk53holbCeAE5wobLjomefehmvhj3A7rfve0XY7DVCqIXa08b5N8p2y3PfeejJ4dO8oPjlV9zvUKqe8AZ+Jfkc736oca2L+XxjI41q6mVtIoZ4DNjWNGndjv+lXKgc8wOE+f6rOaUVTPX7mAaBBjVZhYwdjkrcntbg+ZX687T9ymqqDCXggYQvAn4RofRWQDs/kyTwDx/emM795O4SFGyupC67VTbhnPPBA8CY7gX1kwU234DCNgwmxO4fJAnDYrut0+swApVuqwMxMTnHT5vXre/df98ZcA5dhsqNNeRz4zVH7KjAdJ0zQDmxX4YNDlhRgrNn/UUp3kI9lAAgX5y2Pw35z3h/6TZyW4BSk2Z/XyG6afZd884GRI0ce4sLom46+dZprWvcn3X7rvM4/g4OqcBEv/T8a8I2hordX3+Cp/eTbZrhpuNfGEQx81RyD7XCYMUfSqmNrPuOBPCr3+AkrIIebMCCYeZwOcOyg6+iIi/X4cNbGhwuWJ4tiWXk7Et3PWFxzwdeeYV8Wd17CIyEWLEA8RvsGYEcH2TUApVrjC3l85wxE1b5mJS7HnMv3P2qPTNVamiaIcGgYYrGTZ2LsmUTQKMdFcuiNOlrBQa0ixQsRQEMwBal4AY5D5EAKmF8tAierOJ5yg7l/jxeesXw1/Oilgwc3cT2g6SX4tNhtk+rSKX91KUDp3vDdM/z/ZSwUmQ3gelx14Gh+DljXEZMtYpGhHFmLyItCbAFUCKCKcgMRB4Bh04czFU8YkSB1ruk9KH1ZOx1/9hY+4OQzPD6myrTHwMBlzF7RdF5XfX8uAKU7x9es+CYRX5ZBQywuxxJiszn8mCNsOYiU4yQ1hALy0ihg+nLMko2wHI48KZkwoRGZYL1jCcTER1OnmnwiM2b27DbvjpU69afPFaB099SKx95LHHHjw4f+yrWbft/Rb4Ci4yRYpE6DP/PK1NH2uNz/AU/GB4oj4BlWAAAAAElFTkSuQmCC","Gusto"),Yk=Hk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAACQNJREFUeAHtXA1snGUd/713vY+2d21v7daOjiluDHCuMHDDoTJs2MgkhpBpENQoc8aNaDB+xGQawGk0LItRIwHJIpmEEAUlokQcWNBliEOELYyvfZdttOu6Xtu73ved/99zfddbe733fXvvdVvv/Wd37/O+z9Pn4/f+v5/bo2EcBTbvXyyP1gPaag2YD00LjGsys25zuUgO6AZyO2Rh2yL3XLqvcIGCwSjdt88bcPt/jhw2ahpc+uNquuZyyELDg5FM/Nu4b3GSa88DpMDx/U2D1llNgEy21hxyXZFMYg1BUpxCznHAGYOLWChpIgfldY5rb7WK1RgsZ5eUuCHbQQ5a74BzNji8G8VkvQCkrZ5Y7TzJI6CtdilT7uBRFAFi45rxfk7RpZt8KD6gsmImm1dlMwcgg9fuAOQAZICAQbXDQQ5ABggYVDsc5AA0hoDEV0hl5MsCVQ0HpbI5eN3ArR8OMM4yTTMeIHLNSDKHecEa/G5tK76yNIh4yjwXzViAKEkjqaxwjYaNyxvRta4dN19Wj+7BNISZTFON6ZbneUOuOSsrT2byadKLG2vwmcsbsO7qBnS0ec/M/shA6kzZTOG8BKjwBevqQn9GkdHBICfo3FDn0dDe6ME1F/mwZlEdVi2oQ2tAlM44OiQAWdFB5xygtKwwJW9d8sCokeRL/pNflb543omkwC0KgSIT9LjQVOvCXNErlzR58JFWr/pcPtuLJv/kWmNEdM/+UykZYxxqJW7PCUBceCItVkVGXzAr/9avbPOpxbYG3agXALidQJOckcZ84x5Bp7ZGUx+/cEvA6wK5xgqdGEorHeRiFswkTTtAMXmLIXn7ty8J4PaOIJa1+xD0WXilJhdWrNl/jycQjmfhE6DN0rQBlM5ySjnc0RHAdz8RwhIRi0rQcJJbW1AcNr7/Fw/HYNFPxLQARHFqE9HZsroFtwnnVIpe6o6jJ5LGmkvrJwwxmMhiZ3dM6bAJlSUeVByguICzZI4Xj6ydg45WX4mpTL3q4OkUHnx5EC31bnxzRSNqi+gmgndYLBiNgBWqKEDknKWifJ/4fBvmN9k/1Ft9STy8ewjPHoji7hVN2CAO4WT0xBsRiN9oyYKxL/tnPTpDWqAPCCiPfq7VVnB6IhnsPBrD7/dGBJgRxZ3bP9uK5e3+ybABfZ9n94/AR1/BIlUEIJrxWjHVD98yB4uaPRanNNacin0glsFBWeArxxL415EYdh+Po/t0GnQHNnfOwsZrRaQMrNL2/w3jZDRj2S3gTCoCEEVr0/Uh3HBJ7dhqDUp04vadTGJPTwIH+lN4XzilO5zCexI79Uo5ElfeJOaFPPj+ypCKr8ihRnRMfJ9H9wxbMu2FfRqPUNjaRDkhorV8nh93X9dkojUU+z8u4vLUm1G8259EVMy0Hk4wptDERZrld+OjEjrcekU91i4OoL3B/LR/LcqbAapVp1KfvPmR9L8wuJLb7/lUSLzh0vJOlv/Vv8N45LUhnAjnI0y/V0NznRshAaRN4qhFLR5ce7Ff6ZfF4jdZVSGvnkhg26tD8BuIYKkl2QoQTfrNo4FiqUGfeiuKTTv68baIU4OY5s6Ftej8UJ1wng8LRIQC4lnPEm/bqkkuHFOJ+XP9GBb/x4rnXNgHy7YCxBDqGx9rxGSuBsOMTc/34xcvhTFbgPnWJ0P4wpVBLJ3rU4Ho+MmVc7911wC6DsWK+kRW+rUNoKTonuvm+3H9B+uKjn98OI07/9iLFw/HsWFZI77z8SYsLMPCFR1k9OEz70SxZWe4LNHS+7cNoIyY5Dsk+CQXjSc6dGsf71Hm+Pk7LxIQzVu38X0Z3TMg3fB0nziF+fSJUXujelsAot/DWOumhRO55/X3E7jtD71YJXrmpzc2o6GCkfte0WlffLIXJ0cyU3IKi4FlC0AUrxVibeZJmrOQ3uhN4ut/7sOmlU348lUNhVW2l3cfi+NLIsJHwmnbwOEkz17RFKdNv4UpzkLDfkgCyB91ncaWm5qx0oLDOJUp/FV0zl1/6UOvuA5TCSdKjVk2QASHYkMO0umUsPhvdg/i3s6QpEIrE8FzLJryrbvCuH/nAJi6tRscjlE2QJzYZS1elTplhwwZ/vRmBF8TS1UpK8VxXhFl/ENxGWjK6QiW4zOxv8nIBoCgEubMwVBZM5ZaJcqayfRK0FHRMQ/8ZxC/FQ+Z2cNiuR87xy0bIIrYVXPz6VPGUQslCU8n0G5691QS218fxmN7IjguASi943I8ZLPzKxsg7jgwPCBxpyFoo8rpE12262gcT0qy67lDI+in+ZY9m0pzTSF4ZQHEXcwrRP8sG01WWdmQK5yEXh6IZVXkTZPN3M/Lcn1PRIr5fu6H1RXzQvU/rtB1ygCJ64OgRN8P3TIbjRJYPv12VO5daJCNO17rpI6LovKk+ad+okKPieWJSgAZTmQkGZbDsaEUDshm3n5xC5hbpvhE5McGJP4aw1tGJK46KfNrSgBx+hlB6P5Pt6j4696ufmx+YUBt+BEUj/TqFWA8UuZuKIm6ipuAoqaQFJCYN+KHIQoBZIDrli+2n04RUpMr8TUlgBiVf/XqINZd04C9PUmxKkOoF67hIlOCRFL+p1WUm8l5RiA88pHK/D8FCL+U32K/Pi+xXOtVlgFiWMGdip/JHhcB+Mk/T4N7TnpeWNY99uMA3ig6U9AfXDDXIrH35HOnHvGL2Gxd06wSWv8Qy/LMOyO2pBUmH/Xc1lgCKCMs8z3ZNl4p6Qoq3F9KypRphQuXP4zBNw0Q06l3ycbcD24IqV65U/mCJL+mw1kzXkblWpjWQXRB/i4bdR2vDcuuglu4Z1D9PGWmA6QFf3zwjK0xeg8009y+9Yi54h9Z+SGSUd/na71pDuICdD/lfF1MJeZlWgdVYvALoU8HIIO35ADkAGSAgEG1w0EOQAYIGFQ7HGQIkJyfY9CmeqsFG5d4xN3Vi0DplRMbETF18lLpllVbm9tBHbRNshjMiztUgMAoJttc6swuOZaqoM4pEgEe1SXnmSkrxjO7eCyVg0wegfwRXXKOmZACiGd18cwuUUoPVLO4ce3EQD+/jABNyJY6xwSefUzg/wE1Aw9b7HP6YgAAAABJRU5ErkJggg==","Freshbooks"),_k={GUSTO:Kk,FRESHBOOKS:Yk,FRESHBOOKS2:Yk,SHOPIFY:zk,STRIPE:qk,SQUARE:jk,UBER:Hk("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAABlNJREFUeAHtnN0vH0sYx586nL5qvFRflHoXOYSkTSsu3IpWpHdSDeGCK3Evxx9xQuqllaC3biTSlpIjlbghLuQkTuIlNKVatKmEaqOYPt9frO4P+/vtzL5Q9knmt7uz88zM89mZ3dln5rdEByWTo/7hMMFhjYM44QE2wlbYDNsN5U8+84TDNoeTDsXIPtgOBmDhJ4j4l4OR4mmLBws/SKB22iAEsxdM6AwH9Lv/OIRw8OQXgR3ezf6Df/7mkPcr3tvbJYDGs4kf3MH/2o30Nv4E/gcgPOYu+cd7R7sE1gEINytPDAh4N2YDMFq0B0gjYbD1ABmA0aJDtR23t1FRUZSamkrp6emUkJBAMTExdOHCBV81vn79Sp8+faK3b9/S1NQUzczM0JcvX9yuoq88VwHdunWL7t+/Tw8ePKA7d+5QbGwsnTmD54SxCCHo/fv3NDY2Rq9evaLe3l5aWFgwVnDgTLAht+Xzd+/eFe3t7YJbBdtrTVZWVkRbW5u4ffu25XoxSzN5mEpkJqMDaVJSUnxgvn//bo3KIdobGxvi2bNnIjEx8UC5Jg03q+cMoOrqavHx48dDTLM3irufqKysNGusSjp7AV2+fFl0dHTYS8FEbk+fPhUXL15UARBMxz5AN27cEG/evDFhjjNJ+vv7xdWrV4MZLHveHkCAMzo66ozlErkODw8LHjLIQgiU3jogdKuhoSEJM5xNipZkY3ezBojHMaKzs9NZixVyb21tDdQqZM5ZA1RVVaVQfXdUysrKZEAYpVUHlJSUJDBwO66yuLgo4uLijAw3G68O6Dh2rf0Xq6WlxSwIo3RqgDDUd2KEvN9Aq8f84iuysrKMjA8ar+zuqK2tpbNnzzrwamhvlvAQ1NTUWMo0KMX97zbo1+x+sHpxXdNfXl4W165dk7YTdiu5O4qKiigiIkL5qqytrRG/p0np80CULl1Sm1uAr6mwsJCeP38uVaaWWJpsT0+P8tVfXV0Vubm54vz581IhPz9fMFjlcru6uqTtZEDQkbtJR0ZGCjw+VWVyclKEhYVJVxZA5+bmVIsV7J0U4eHh0uVK36TT0tKI+7PW+qS38CCGhsr3bOgE8z4GqszNmzcpOTk5UJJDz0kDyszMpJAQabW9wrkl7O27uQPAuLiyIn0pl5aWiP09suXspYf+9jaW4bgvmByQFWlAcJwj/I5y5coV6Wqr9xXpoo5eQZtWkqnJqQIkA0ZLe6oA8UyIZrfprfQ9qLi4mB4/fkw8IDFdiD4hRtB1dXW0ubmpj3ZlH7O1siINKDo6mh49eiRbzl76+fl5qq+v3zt2cwdT2bIi3cUmJiZoZwfL99SEXSRqiha1tra2aHp6WjoXaUAo5MOHD9IFaQromj9+/NAOTW9VdPSZYz5/dnZWH2VqX7qL8cumbyEBhu4qcv36dcrLy6Px8XEp9Xv37pHKOEYrZGRkhNbX17VD01tpQMj5xYsX9PDhQ9OF6BPyFBH19fUR+7L10QH38Q7GE4J07ty5gOkCnUSdVUX6DZeXrYjPnz8rv1m7rYg1AqqTidL3IFwFdndQd3e36gVxXY99QVItdn8FpVsQZyBycnLEt2/f3G4M0uXxfUdkZGQo2Qg7AUtZGQuZjrs0NjYq22cZEC+pc2UNkOpF4EGpwKIKK43AUgtCwRUVFar1d1SPB7OipKTEKhzoq3cxTRdL4Y6b2NC1NLjWAfF0jBgYGDg2jHjM45sx0S6gxa11QKgAxhlYvHTUMjg4KHgNtnb17djaA0iD9Pr16yNjhJZjMxx77kH6JoyVXVhR4bY0NDTY2a30Lc++FqQHVV5eLvCYdVowIVhaWqo3yO59ZwABVnx8vGhubhYYzdotmIbGk4q9CnYD2Z+fc4C0FpWdnS2ampoE+5Esc8K0N8DwBOZ+Qxw5dvUfh1ihUVBQ4PszC/w7vIwm6DQ0HGVw0/ISY3r58iXxcIIw+eiWuApIbxT8Qpgrx1+iMOMJZ5g2b6X/OxT+CgVPoIqzS1+e6v6RAVKtsNt6Sv4gtyt5lOV5gILQ9wCZACTv6g+S6Qk6vY4W9O4EGWS3Ke8AqN/uXE9Qfv14zHufxzn8ivo+j6OdesI7jgzVf+N8wWRPvE90+TeQA5/oAilAAjWssDytrQm2g4Hf98v42E9wT8In87zPBDKEn02Y0wmZAdg6AAAAAElFTkSuQmCC","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};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|