PageSourceSearch

https://next.saturation.io/assets/use-bank-panel-CFLLEeUS.js

js saturation.io collected 2026-09-25 05:01:10 UTC 25,014 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{$_ as t,$l as n,Bx as r,Cg as i,Dx as a,Et as o,Hx as s,Ol as c,Rb as l,Rl as u,Rt as d,Vv as f,Vx as p,_x as m,bo as h,ey as g,gl as _,hl as v,jt as ee,kt as y,m as b,sg as x,uo as te,ux as S,wt as C,xb as w,zt as ne}from"./user-provider-CQF6Me4W.js";import{$r as T,Fr as re,Gl as E,Hl as ie,Ir as ae,Lr as D,R as oe,Rl as O,S as k,Tl as se,_a as ce,aa as le,ba as ue,fa as de,lu as fe,mu as pe,pa as me,ra as he,sa as ge,ta as _e,va as ve,wl as ye}from"./merchant-avatar-BeakFeq8.js";import{Vt as be,qt as xe}from"./entity-avatar-v-ERAghU.js";import{n as A,t as Se}from"./jsx-runtime-B2Ixnf4W.js";import{i as j}from"./IconX-Bw-P0pPu.js";import{a as M}from"./trace-highlight-EneyRkZF.js";import{i as N}from"./createLucideIcon-2o2guQSJ.js";import{t as Ce}from"./button-BWe_s0P9.js";import{o as we}from"./hooks-C5y78fwr.js";import{a as P,r as F,t as I}from"./button-X9K5pjVC.js";import{i as Te}from"./routes-CxPJ725c.js";import{t as Ee}from"./enable-toggle-BuJ-DL-q.js";import{t as De}from"./disabled-with-reason-Drbrusa0.js";import{t as Oe}from"./integration-detail-hero-Dg0iLiQs.js";var L=j(`outline`,`arrows-up-down`,`ArrowsUpDown`,[[`path`,{d:`M7 3l0 18`,key:`svg-0`}],[`path`,{d:`M10 6l-3 -3l-3 3`,key:`svg-1`}],[`path`,{d:`M20 18l-3 3l-3 -3`,key:`svg-2`}],[`path`,{d:`M17 21l0 -18`,key:`svg-3`}]]),R=P(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),z=e(A(),1),B=Se();function V(e,t){e&&(t.current?.cancel(),t.current=e.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,easing:`linear`,iterations:1/0}))}function H(e,t){if(!e){t.current=null;return}let n=new DOMMatrix(getComputedStyle(e).transform),r=(Math.atan2(n.b,n.a)*180/Math.PI%360+360)%360,i=r<2?360:360-r;t.current?.cancel();let a=Math.max(500,i/360*1600),o=e.animate([{transform:`rotate(${r}deg)`},{transform:`rotate(${r+i}deg)`}],{duration:a,easing:`cubic-bezier(0, 0, 0.15, 1)`,fill:`forwards`});t.current=o,o.onfinish=()=>{t.current===o&&(o.cancel(),t.current=null)}}function ke({onSync:e,label:t,shortcut:n,syncing:r,className:i,disabled:a,size:o,variant:s=t?`secondary`:`ghost`,...c}){let[l,u]=z.useState(!1),d=z.useRef(null),f=z.useRef(null);z.useEffect(()=>{r!==void 0&&(r?(u(!0),V(d.current,f)):(u(!1),H(d.current,f)))},[r]);let p=r===void 0?l:r,m=z.useCallback(async()=>{if(!(!e||p)){u(!0),V(d.current,f);try{await e()}finally{u(!1),H(d.current,f)}}},[e,p]),h=!t;return(0,B.jsxs)(I,{variant:s,size:h?`icon`:o??`sm`,className:F(`transition-opacity duration-300`,h&&`h-8 w-8`,!h&&`gap-1.5 text-xs h-7`,p&&`opacity-50 pointer-events-none`,i),disabled:a||p,onClick:m,...c,children:[(0,B.jsx)(`span`,{ref:d,style:{display:`inline-flex`},children:(0,B.jsx)(R,{className:h?`size-4`:`size-[13px]`})}),t&&(0,B.jsx)(`span`,{children:t}),n&&(0,B.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,overflow:`hidden`,flexShrink:0,transition:`width 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms cubic-bezier(0.4,0,0.2,1), margin-left 300ms cubic-bezier(0.4,0,0.2,1)`,width:p?0:`1.25rem`,opacity:+!p,marginLeft:p?0:`0.125rem`},children:(0,B.jsx)(g,{className:`h-4 min-w-4 text-[10px] shrink-0`,children:n})})]})}function U({connectionId:e,onBeforeNavigate:t,onSyncActionsChange:n,onDisconnect:r,compact:a=!1,presentation:l,syncReviewPresentation:d=`dialog`,onSyncReviewOpenChange:p,headerIdentity:h,headerActions:g}){let{revision:_,refresh:v}=ee(),{workspace:b,api:x}=i(),{connections:S}=u(),[w,ne]=(0,z.useState)(null),[T,re]=(0,z.useState)(!1),E=(0,z.useCallback)(e=>{re(e),p?.(e)},[p]),[ie,ae]=(0,z.useState)(!1),[D,oe]=(0,z.useState)(!1),[O,k]=(0,z.useState)(null),[se,fe]=(0,z.useState)(!1),[pe,me]=(0,z.useState)(0),[ye,be]=(0,z.useState)(null),[A,Se]=(0,z.useState)(!1),j=(0,z.useRef)(null),M=(0,z.useCallback)(async()=>{if(b?.id)try{let t=await x.connections.accounting.getSummary(e);ne(t),ae(!1)}catch{ae(!0)}},[b?.id,x.connections.accounting,e]),N=(0,z.useCallback)(async()=>
1{if(b?.id)try{let t=await x.connections.accounting.getSyncProgress(e);k(t),fe(!1),(t.status===`completed`||t.status===`failed`||t.status===`reconnect`)&&oe(!1)}catch{fe(!0)}},[b?.id,x.connections.accounting,e]);(0,z.useEffect)(()=>{M(),N()},[M,N,_]);let Ce=O?.status===`queued`||O?.status===`running`||O?.status===`waiting`||O?.status===`throttled`;(0,z.useEffect)(()=>{if(!(!D&&!Ce))return j.current=setTimeout(()=>{Promise.all([N(),M()]).finally(()=>{me(e=>e+1)})},2e3),()=>{j.current&&clearTimeout(j.current)}},[D,Ce,O?.processedCount,pe,N,M]);let P=(w?.counts.uncategorized??0)+(w?.counts.failed??0)+(w?.counts.cantSync??0)+(w?.counts.diverged??0),F=we(),Oe=(0,z.useCallback)(()=>{b&&(t?.(),F(`${Te.workspace.transactions(b.alias)}?view=${c}&accountingState=needs_attention`))},[b,t,F]);(0,z.useEffect)(()=>{b?.id&&(async()=>{be(await x.connections.accounting.getHomeCurrency(e))})()},[b?.id,x,e]);let L=S.find(t=>t.id===e)??null,R=!!L&&L.status===`active`&&L.enabled,V=R?w?.settingsValid?w.settings?.treasuryAccount?w.settings?.uncategorizedAccount?null:`Set the fallback account in Sync settings first`:`Set the default payment account in Sync settings first`:`Review Sync settings before syncing`:`Connect ${C(w?.provider??``)} first`,H=w?.enableSync??!1,U=O?.status===`reconnect`,Ne=w?.companyName??null,Pe=w!==null,W=(0,z.useCallback)(async()=>{!b?.id||D||U||E(!0)},[b?.id,D,U,E]),G=(0,z.useCallback)(async()=>{if(!b?.id||A)return;Se(!0);let t=await x.connections.accounting.recheck(e);if(Se(!1),!t.ok){f.error(t.message);return}let n=t.truncated?` · checked the first batch`:``;f.success(t.diverged===0?`Checked ${t.checked} · all in sync${n}`:`${t.diverged} changed in ${C(w?.provider??``)}${n}`)},[b?.id,A,x.connections.accounting,e,w?.provider]);if((0,z.useEffect)(()=>{if(n)return n([{id:`sync`,label:`Sync to QuickBooks`,disabled:!Pe||!R||V!==null||D||U,run:()=>void W()},{id:`recheck`,label:`Re-check ${C(w?.provider??``)}`,disabled:!H||A,run:()=>void G()}]),()=>n(null)},[n,H,D,U,A,w?.provider,R,V,Pe,W,G]),!w){let e=(0,B.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:ie?(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Couldn't load sync activity.`}),(0,B.jsx)(I,{size:`sm`,variant:`secondary`,className:`h-6 text-xs`,onClick:()=>void M(),children:`Retry`})]}):(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading sync activity`})});return l===`header`?(0,B.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Accounting`}),(0,B.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-4 text-sm text-muted-foreground`,children:[h,e]})]}),(0,B.jsx)(`div`,{className:`flex items-center gap-3`,children:g})]}):e}let Fe=w.settings?.uncategorizedAccount??null,Ie=y(w.provider),K=C(w.provider);async function Le(t){if(!(!b?.id||!w)){if(!(await x.connections.accounting.updateSettings(e,{...t&&!w.enableSync?{enableSync:!0}:{},settings:{autoSync:t}})).ok){f.error(`Failed to update sync`);return}await M(),v()}}let q=w.enableSync&&w.settings?.autoSync!==!1;function Re(){Le(!q)}let J=w.lastPush,{counts:Y}=w,X=w.settings?.bookCloseDate??null,Z=ye?.outcome===`mismatch`?(0,B.jsx)(`p`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-2.5 py-2 text-xs leading-snug text-destructive`,children:ye.message}):null,Q=Fe?(0,B.jsx)(o,{open:T,onOpenChange:E,presentation:d,onBackLabel:`Back to Sync settings`,connectionId:e,providerName:K,uncategorizedAccount:Fe,syncEnabled:w.enableSync,existingSyncStartDate:w.syncStartDate??null,holdUnmappedLines:w.settings?.holdUnmappedLines??!1,onSettingsSaved:()=>{v(),M()},onEnabled:()=>{v(),oe(!0),Promise.all([M(),N()])}}):null,$=O||se?(0,B.jsx)(Ae,{progress:O,failed:se,providerName:K}):null,ze=(0,B.jsx)(Ee,{checked:q,disabled:!q&&V!==null,enabledLabel:`Sync on`,disabledLabel:`Sync off`,enabledTone:`positive`,disabledTone:`warning`,ariaLabel:`Sync transactions to ${K}`,onToggle:Re}),Be=(0,B.jsx)(je,{operationId:Ie,children:V?(0,B.jsx)(De,{reason:V,children:ze}):(0,B.jsxs)(ce,{children:[(0,B.jsx)(ue,{asChild:!0,children:(0,B.jsx)(`span`,{className:`inline-flex`,children:ze})}),(0,B.jsxs)(ve,{children:[`Push transactions to `,K]})]})});if(d===`inline`&&T)return Q;if(l===`header`)return(0,B.jsxs)(`div`,{className:`w-full`,children:[Q,(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Accounting`}),(0,B.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[h,w.companyName&&(0,B.jsxs)(`span`,{children:[`· `,w.companyName]})]}),(0,B.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,B.jsx)(`span`,{"aria-hidden":!0,
1className:`size-2 rounded-full ${w.enableSync&&w.settings?.autoSync!==!1?`bg-badge-green-text`:`bg-badge-amber-text`}`}),q?`Sync on`:`Sync off`]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[P>0&&(0,B.jsxs)(`button`,{type:`button`,onClick:Oe,className:`text-sm underline underline-offset-4`,children:[P.toLocaleString(),` need attention`]}),g]})]}),$,Z]});if(a){let e=[J?.summary&&`Last sync ${te(new Date(J.createdAt).getTime())}`,Y.pending>0&&`${Y.pending.toLocaleString()} pending`,X&&`following the ${Me(X)} closing date`].filter(Boolean).join(` · `);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Z,Q,(0,B.jsxs)(`div`,{className:`relative flex items-center gap-2 overflow-hidden rounded-lg border border-border p-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-sm font-medium`,children:Ne??K}),$??(e&&(0,B.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e}))]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[Be,(0,B.jsxs)(ce,{children:[(0,B.jsx)(ue,{asChild:!0,children:(0,B.jsx)(ke,{className:`size-7 text-muted-foreground`,syncing:D,disabled:!H||U,"aria-label":`Sync`,onSync:W})}),(0,B.jsx)(ve,{children:`Sync`})]}),(0,B.jsxs)(_e,{children:[(0,B.jsxs)(ce,{children:[(0,B.jsx)(ue,{asChild:!0,children:(0,B.jsx)(de,{asChild:!0,children:(0,B.jsx)(I,{variant:`ghost`,size:`icon`,className:`size-7 text-muted-foreground`,"aria-label":`More actions`,children:(0,B.jsx)(m,{className:`size-4`})})})}),(0,B.jsx)(ve,{children:`More actions`})]}),(0,B.jsxs)(he,{align:`end`,children:[(0,B.jsxs)(le,{disabled:!H||A,onSelect:()=>void G(),children:[`Re-check `,K]}),r&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ge,{}),(0,B.jsx)(le,{className:`text-destructive focus:text-destructive`,onSelect:r,children:`Disconnect`})]})]})]})]})]})]})}return(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[Z&&(0,B.jsx)(`div`,{className:`order-last w-full`,children:Z}),Q,(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1`,children:[Y.pending>0&&(0,B.jsxs)(xe,{variant:`muted`,children:[Y.pending.toLocaleString(),` pending`]}),P>0&&(0,B.jsxs)(`button`,{type:`button`,onClick:Oe,className:`inline-flex items-center gap-1 text-sm underline underline-offset-4`,children:[P.toLocaleString(),` `,P===1?`needs`:`need`,` attention`,(0,B.jsx)(s,{className:`size-3`,"aria-hidden":!0})]}),$,!$&&J?.summary&&(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Last sync `,te(new Date(J.createdAt).getTime())]})]}),(0,B.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full ${w.enableSync&&w.settings?.autoSync!==!1?`bg-badge-green-text`:`bg-badge-amber-text`}`}),q?`Sync on`:`Sync off`]})]})}function Ae({progress:e,failed:t,providerName:n}){if(t&&!e)return(0,B.jsx)(`span`,{className:`truncate text-xs text-destructive`,"aria-live":`polite`,children:`Sync status unavailable`});if(!e||e.status===`idle`||e.status===`completed`)return null;let r=e.totalCount===0?0:Math.min(100,Math.round(e.processedCount/e.totalCount*100)),i=e.status===`running`||e.status===`waiting`||e.status===`throttled`||e.status===`queued`,a=`${e.processedCount.toLocaleString()} of ${e.totalCount.toLocaleString()}`,o={queued:`Sync queued`,running:`Checking ${a}`,waiting:`Checking ${a} · waiting for next batch`,throttled:`Checking ${a} · waiting for ${n}`,reconnect:`Reconnect ${n} to continue`,completed:`Sync complete`,failed:`Sync stopped at ${a}`}[e.status],s=`${e.createdCount.toLocaleString()} created · ${e.updatedCount.toLocaleString()} updated · ${e.voidedCount.toLocaleString()} voided${e.recoveredCount>0?` · ${e.recoveredCount.toLocaleString()} recovered outcomes`:``}`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,"aria-live":`polite`,children:[o,` · `,s]}),i&&(0,B.jsx)(be,{className:`absolute inset-x-0 bottom-0 h-0.5 rounded-none`,value:r,"aria-label":`${o}: ${r}%`,"aria-valuenow":r,"aria-valuetext":`${r}% complete`})]})}function je({operationId:e,children:t}){return e?(0,B.jsx)(b,{operationId:e,treatment:`locked`,children:t}):t}function Me(e){let[t,n,r]=e.split(`-`).map(Number);return!t||!n||!r?e:new Date(t,n-1,r).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}var Ne={quickbooks:{description:`Automatically sync Saturation Pay and Credit transactions to QuickBooks Online`,badge:`Alpha`,syncs:[{type:`transactions`,direction:`out`},{type:`budget`,direction:`out`},{type:`contacts`,direction:`out`},{type:`purchase_orders`,direction:`out`}]},xero:{description:`Sync invoices, bills, and contacts`,syncs:[{type:`transactions`,direction:`out`},{type:`contacts`,direction:`out`},{type:`purchase_orders`,direction:`out`}]},netsuite:{description:`Export accounting entries to NetSuite`,syncs:[{type:`transactions`,direction:`out`},{type:`budget`,direction:`out`},{type:`contacts`,direction:`out`},{type:`purchase_orders`,direction:`out`}]},"google-sheets":{description:`Export transactions to a spreadsheet`,syncs:[{type:`budget`,direction:`out`},{type:`transactions`,direction:`out`}]}
1,"sage-intacct":{description:`Sync GL entries and vendor records`,syncs:[{type:`transactions`,direction:`out`},{type:`contacts`,direction:`out`},{type:`purchase_orders`,direction:`out`}]},freshbooks:{description:`Sync expenses and vendor payments`,syncs:[{type:`transactions`,direction:`out`},{type:`contacts`,direction:`out`}]},gmail:{description:`Import attachments from your inbox`,syncs:[{type:`documents`,direction:`in`}]},outlook:{description:`Import attachments from Outlook`,syncs:[{type:`documents`,direction:`in`}]},slack:{description:`Get budget alerts and approval notifications in Slack`}};function Pe(e){let n=t[e],r=Ne[e];return{key:n.provider,label:n.label,description:r.description,syncs:r.syncs??[],category:n.categories.length===0?`notifications`:n.categories.includes(`file`)?`email`:n.detail===`AccountingConnection`?`accounting`:`spreadsheet`,enabled:n.enabled,...r.badge?{badge:r.badge}:{}}}var W=[`quickbooks`,`netsuite`,`xero`,`google-sheets`,`sage-intacct`,`freshbooks`,`gmail`,`outlook`,`slack`].map(Pe),G=W.filter(e=>e.category===`accounting`),Fe=W.filter(e=>e.category===`email`),Ie=W.filter(e=>e.category===`notifications`),K=[{key:`cinapse`,label:`Cinapse`,description:`Import schedule elements as budget lines`,syncs:[{type:`budget`,direction:`in`},{type:`contacts`,direction:`in`}],category:`scheduling`,enabled:!0},{key:`movie-magic-scheduling`,label:`Movie Magic Scheduling`,description:`Import schedule elements as budget lines`,syncs:[{type:`budget`,direction:`in`}],category:`scheduling`,enabled:!0},{key:`wrapbook`,label:`Wrapbook`,description:`Import payroll exports as itemized timecards`,syncs:[{type:`transactions`,direction:`in`},{type:`contacts`,direction:`in`}],category:`payroll`,enabled:!0},{key:`greenslate`,label:`GreenSlate`,description:`Import production accounting data and cost reports`,syncs:[{type:`transactions`,direction:`in`},{type:`contacts`,direction:`in`}],category:`payroll`,enabled:!1},{key:`revolution-payroll`,label:`Revolution Payroll`,description:`Connect payroll runs and employer tax liabilities`,syncs:[{type:`transactions`,direction:`in`},{type:`contacts`,direction:`in`}],category:`payroll`,enabled:!1},{key:`cast-and-crew`,label:`Cast & Crew`,description:`Sync crew payroll and production costs`,syncs:[{type:`transactions`,direction:`in`},{type:`contacts`,direction:`in`}],category:`payroll`,enabled:!1}],Le=[...W,...K],q=K.filter(e=>e.category===`payroll`),Re=K.filter(e=>e.category===`scheduling`),J=Object.fromEntries(Le.map(e=>[e.key,e.label])),Y=[{type:`transactions`,direction:`in`},{type:`balances`,direction:`in`}],X=[{key:`chase`,name:`Chase`,domain:`chase.com`,matchTerms:[`chase`,`jpmorgan`],routingNumber:`021000021`,poweredBy:`plaid`},{key:`bofa`,name:`Bank of America`,domain:`bankofamerica.com`,matchTerms:[`bank of america`,`bofa`],routingNumber:`026009593`,poweredBy:`plaid`},{key:`wells-fargo`,name:`Wells Fargo`,domain:`wellsfargo.com`,matchTerms:[`wells fargo`],routingNumber:`121000248`,poweredBy:`plaid`},{key:`ramp`,name:`Ramp`,domain:`ramp.com`,matchTerms:[`ramp`],poweredBy:`plaid`},{key:`amex`,name:`American Express`,domain:`americanexpress.com`,matchTerms:[`american express`,`amex`],poweredBy:`plaid`},{key:`capital-one`,name:`Capital One`,domain:`capitalone.com`,matchTerms:[`capital one`],routingNumber:`051405515`,poweredBy:`plaid`}];function Z(e){return{key:e.key,name:e.name,matchTerms:e.matchTerms,domain:e.domain,routingNumber:e.routingNumber}}function Q(e){let t=e.toLowerCase();return X.find(e=>e.matchTerms.some(e=>t.includes(e)))}function $(e,t){let n=Q(e);return n?Z(n):{key:`inst-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}`,name:e,matchTerms:[e.toLowerCase()]}}var ze={transactions:{label:`Transactions`,Icon:a},budget:{label:`Budget`,Icon:l},contacts:{label:`Contacts`,Icon:w},purchase_orders:{label:`Purchase orders`,Icon:E},documents:{label:`Documents`,Icon:S},balances:{label:`Balances`,Icon:fe}},Be={in:{Icon:pe,label:`Imported into Saturation`},out:{Icon:p,label:`Exported to this connection`},both:{Icon:L,label:`Two-way sync`}};function Ve({syncs:e,showDirection:t=!1,className:n}){return e.length===0?null:(0,B.jsx)(`div`,{className:N(`flex flex-wrap items-center gap-x-3 gap-y-1`,n),children:e.map(({type:e,direction:n})=>{let{label:r,Icon:i}=ze[e],a=Be[n];return(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`${r} - ${a.label}`,children:[(0,B.jsx)(i,{size:13,className:`shrink-0 text-muted-foreground
1/70`}),r,t&&(0,B.jsx)(a.Icon,{size:11,className:`shrink-0 text-muted-foreground/50`})]},e)})})}function He(e){if(e.length===0)return`-`;let t=e.some(e=>e.direction===`in`||e.direction===`both`),n=e.some(e=>e.direction===`out`||e.direction===`both`);return t&&n?`Two-way`:n?`Outbound`:`Inbound`}function Ue(e){return J[e]||e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var We={plaid:{bg:`#0A2540`,fg:`#ffffff`},quickbooks:{bg:`#2CA01C`,fg:`#ffffff`},xero:{bg:`#13B5EA`,fg:`#ffffff`},netsuite:{bg:`#F26B26`,fg:`#ffffff`},"google-sheets":{bg:`#0F9D58`,fg:`#ffffff`},"sage-intacct":{bg:`#1B3A6B`,fg:`#ffffff`},freshbooks:{bg:`#29B462`,fg:`#ffffff`},gmail:{bg:`#EA4335`,fg:`#ffffff`},outlook:{bg:`#0072C6`,fg:`#ffffff`},wrapbook:{bg:`#6654FF`,fg:`#ffffff`},greenslate:{bg:`#2D6A4F`,fg:`#ffffff`},"revolution-payroll":{bg:`#B91C1C`,fg:`#ffffff`},"cast-and-crew":{bg:`#003A6B`,fg:`#ffffff`},slack:{bg:`#611f69`,fg:`#ffffff`},zapier:{bg:`#FF4F00`,fg:`#ffffff`},"movie-magic":{bg:`#3FAE49`,fg:`#ffffff`},showbiz:{bg:`#20304F`,fg:`#ffffff`},"hot-budget":{bg:`#8B1A1A`,fg:`#ffffff`},"movie-magic-scheduling":{bg:`#1375D4`,fg:`#ffffff`},cinapse:{bg:`#ffffff`,fg:`#1d1d1d`},chase:{bg:`#117ACA`,fg:`#ffffff`},bofa:{bg:`#E31837`,fg:`#ffffff`},"wells-fargo":{bg:`#D71E28`,fg:`#ffffff`},ramp:{bg:`#E1F548`,fg:`#1d1d1d`},amex:{bg:`#016FD0`,fg:`#ffffff`},"capital-one":{bg:`#D03027`,fg:`#ffffff`}};function Ge({providerKey:e,logoUrl:t,logoNode:i,name:a,category:o,description:s,statusLabel:c,statusConnected:l=!1,onConnect:u,connectOperationId:d,connectLabel:f=`Connect`,isConnecting:p=!1,syncs:m=[],connectionsContent:g,connectionsLabel:_=`Connections`,connectionsOpenByDefault:v=!1}){let{closePanel:ee}=x(),y=(0,z.useRef)(null),b=ae(y),te=He(m),S=We[e],C=!!u&&!l;return(0,B.jsx)(`div`,{className:`flex flex-col h-full relative`,children:(0,B.jsxs)(`div`,{ref:y,className:`flex-1 overflow-y-auto`,children:[(0,B.jsx)(re,{title:`Integration`,compact:{name:a},compactOn:b,onClose:ee}),(0,B.jsx)(h,{scrollContainerRef:y,headerHeight:184,compactHeaderHeight:0,children:(0,B.jsx)(Oe,{logo:i??(0,B.jsx)(n,{providerKey:e,logoUrl:t}),name:a,category:o,statusLabel:c,statusConnected:l,brandBg:S?.bg})}),(0,B.jsxs)(`div`,{className:`px-4 pt-3`,children:[(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground leading-relaxed`,children:s}),C?(0,B.jsx)(Ke,{operationId:d,children:(0,B.jsxs)(I,{size:`sm`,className:F(`mt-3 w-full font-semibold`,S&&`transition-all hover:brightness-110`),style:S?{backgroundColor:S.bg,color:S.fg,borderColor:S.bg}:void 0,onClick:u,disabled:p,children:[p&&(0,B.jsx)(M,{className:`size-4 animate-spin mr-1.5`}),f]})}):null]}),(0,B.jsx)(`div`,{className:`px-4 pb-4 pt-3`,children:(0,B.jsxs)(me,{type:`multiple`,defaultValue:l||v?[`connections`,`what-syncs`,`details`]:[`what-syncs`,`details`],children:[m.length>0&&(0,B.jsx)(D,{value:`what-syncs`,icon:(0,B.jsx)(r,{size:14}),label:`What syncs`,count:m.length,children:(0,B.jsx)(Ve,{syncs:m,showDirection:!0,className:`gap-x-4 pt-1`})}),(0,B.jsx)(D,{value:`details`,icon:(0,B.jsx)(O,{size:14}),label:`Details`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,B.jsx)(k,{icon:(0,B.jsx)(ie,{size:13}),label:`Category`,children:(0,B.jsx)(T,{children:o.charAt(0).toUpperCase()+o.slice(1)})}),(0,B.jsx)(k,{icon:(0,B.jsx)(r,{size:13}),label:`Data direction`,children:(0,B.jsx)(T,{children:te})}),(0,B.jsx)(k,{icon:(0,B.jsx)(se,{size:13}),label:`Provider`,children:(0,B.jsx)(T,{children:Ue(e)})})]})}),(0,B.jsx)(D,{value:`connections`,icon:(0,B.jsx)(se,{size:14}),label:_,children:g})]})})]})})}function Ke({operationId:e,children:t}){return e?(0,B.jsx)(b,{operationId:e,treatment:`locked`,children:t}):t}function qe(){let{sources:e}=_(),{connectNew:t,isLinking:n}=ne(),r=e.length,i=r>0?`${r} connected`:void 0;return(0,B.jsx)(Ge,{providerKey:`plaid`,name:`Plaid`,category:`Banking`,description:`Connect bank accounts to automatically import transactions into Saturation.`,syncs:[{type:`transactions`,direction:`in`},{type:`balances`,direction:`in`}],statusLabel:i,statusConnected:r>0,onConnect:r===0?()=>
1t():void 0,connectLabel:`Connect bank`,isConnecting:n,connectionsContent:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(d,{hideHeader:!0,noScroll:!0,hideFooter:!0}),r>0&&(0,B.jsx)(`div`,{className:`pb-4`,children:(0,B.jsxs)(Ce,{variant:`secondary`,size:`sm`,className:`w-full gap-1.5`,onClick:()=>t(),disabled:n,children:[n?(0,B.jsx)(M,{className:`size-4 animate-spin`}):(0,B.jsx)(ye,{className:`size-4`}),`Connect another bank`]})})]})})}function Je({name:e,domain:t,plaidLogo:n,primaryColor:r}){return(0,B.jsx)(oe,{name:e,logo:n,domain:t,bgColor:r??void 0,fill:!0,className:`h-10 w-10 rounded-lg shadow-none`})}function Ye({target:e}){let{sources:t,refetch:n}=_(),r=t.filter(t=>e.matchTerms.some(e=>t.institutionName?.toLowerCase().includes(e))),i=r.filter(v),a=i.length>0,o=r.length>0&&i.length===0,s=i.flatMap(e=>e.accounts).length,c=r[0],{connectNew:l,isLinking:u}=ne({onSuccess:()=>{f.success(`Bank account connected`),n()},onError:e=>{f.error(`Failed to connect bank`,{description:e})},onDuplicate:()=>{f.info(`This account is already connected`)}}),p=a?`${s} account${s===1?``:`s`} connected`:o?`Reconnect needed`:void 0;return(0,B.jsx)(Ge,{providerKey:e.key,logoNode:(0,B.jsx)(Je,{name:e.name,domain:e.domain,plaidLogo:c?.logo,primaryColor:c?.primaryColor}),name:e.name,category:`Banking`,description:`Connect your ${e.name} accounts to automatically import transactions into Saturation.`,syncs:Y,statusLabel:p,statusConnected:a,onConnect:a?void 0:()=>l(e.routingNumber),connectLabel:`Connect ${e.name}`,isConnecting:u,connectionsContent:(0,B.jsx)(d,{matchTerms:e.matchTerms,hideHeader:!0,noScroll:!0,hideFooter:!0})})}function Xe(){let{openPanel:e}=x();return(0,z.useCallback)(t=>{e((0,B.jsx)(Ye,{target:t}),{panelKey:`integration-bank-${t.key}`,width:`detail`,withCloseButton:!1})},[e])}export{G as a,Ie as c,Z as d,Q as f,Ge as i,q as l,U as m,Je as n,Fe as o,$ as p,qe as r,X as s,Xe as t,Re as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.