1import{a as e,n as t}from"./standalone-app-Bj-IdwrG.js";import{E as n,_ as r,x as i}from"./institution-DyFDvNu6.js";import{t as a}from"./page-B8YwBOEr.js";import{_r as o,o as s,sn as c,vr as l}from"./main-5Sl8yySz.js";import"./jha-card-DC-UH8vN.js";import"./jha-card-header-D2XWRnD9.js";import{a as u,t as d}from"./banno-styles-B3iGgKv1.js";import"./jha-list-UCQUTbOQ.js";import"./bannoweb-page-container-G_uPsQAr.js";import{t as f}from"./observable-models-lit-Conecq5s.js";import{t as p}from"./generic-dialogs-8zuEpB8Y.js";import"./jha-badge-B1EhriAo.js";import{n as m}from"./positive-pay-ach-exceptions-AXZuzPPV.js";import{n as h,r as g,t as _}from"./positive-pay-ach-exceptions-Cc47NDlC.js";import{t as v}from"./positive-pay-controller-BawhNixs.js";import{t as y}from"./positive-pay-4tsacyOB.js";import{t as b}from"./bannoweb-positive-pay-card-u1SdA5H2.js";var x=3*1e3,S=l(p(f(r)),`fadeinup`);window.BannowebPositivePayDashboardLitElement=class extends S{static get is(){return`bannoweb-positive-pay-dashboard`}static get properties(){return{fileUploads:{type:Object},checkExceptions:{type:Object},achExceptions:{type:Object},accounts:{type:Object},isEverythingStillLoading:{type:Boolean},positivePayEntitlementsLoading:{type:Boolean},isRefreshing:{type:Boolean},refreshInterval:{type:Function},positivePayController:{type:Object},isManageACHFiltersUI:{type:Boolean}}}constructor(){super(),e(()=>import(`./icon-plus-CGq-1aop.js`).then(e=>e.t),[]),e(()=>import(`./icon-shield-dollar-sign-M3Exl2Aw.js`),[]),e(()=>import(`./icon-money-checks-d_f0Iy7b.js`).then(e=>e.t),[]),e(()=>import(`./icon-arrow-up-from-bracket-D0OfQLDy.js`).then(e=>e.t),[]),e(()=>import(`./icon-list-ul-BrCaUD18.js`),[]),this.fileUploads=g,this.checkExceptions=h,this.achExceptions=_,this.accounts=s.store.accounts,this.positivePayEntitlementsLoading=!1,this.isEverythingStillLoading=!1,this.isRefreshing=!1,this.refreshInterval=null,this.positivePayController=v,this.isManageACHFiltersUI=!1,c.evaluate(`manage-ach-filters-ui`).then(e=>{this.isManageACHFiltersUI=e})}connectedCallback(){super.connectedCallback(),this.loadPosPayData()}async loadPosPayData(e){this.isEverythingStillLoading=!0,this.positivePayEntitlementsLoading=!0;try{await this.positivePayController.getPositivePayUploads(),await s.accountsController.ensureAccountEntitlementsLoaded(),await this.positivePayController.loadPositivePayEntitlements(),this.positivePayEntitlementsLoading=!1,this.loadCheckExceptions(),this.loadAchExceptions()}catch(e){t.console.error(e),this.showStandardErrorRetryDialog_({error:e,onClickRetry:()=>{this.dispatchEvent(new CustomEvent(`closeModal`,{bubbles:!0,composed:!0})),this.loadPosPayData()}})}finally{this.shouldRefreshFileUploads&&(this.refreshInterval=setInterval(()=>{this.refreshFileUploads()},x)),this.positivePayEntitlementsLoading=!1,this.isEverythingStillLoading=!1}}async refreshFileUploads(){this.isRefreshing=!0;try{await this.positivePayController.getPositivePayUploads(),this.shouldRefreshFileUploads||clearInterval(this.refreshInterval)}catch(e){t.console.error(e),this.showStandardErrorRetryDialog_({error:e,onClickRetry:()=>{this.dispatchEvent(new CustomEvent(`closeModal`,{bubbles:!0,composed:!0})),this.refreshFileUploads()}})}finally{this.isRefreshing=!1}}async loadCheckExceptions(){let e=y.getAllCheckExceptionsEntitledAccounts(this.positivePayController.positivePayAccounts,this.positivePayController.positivePayEntitlements);for await(let t of e)await this.positivePayController.getCheckExceptions(t.id)}async loadAchExceptions(){let e=y.getAllAchExceptionsEntitledAccounts(this.positivePayController.positivePayAccounts,this.positivePayController.positivePayEntitlements);for await(let t of e)this.achExceptions.items.some(e=>e.accountId===t.id)||await this.positivePayController.getAchExceptions(t.id)}get shouldRefreshFileUploads(){let e=this.fileUploads.items.sort((e,t)=>new Date(t.uploadedAt)-new Date(e.uploadedAt));return e[0]&&e[0].status&&[b.NEW,b.QUEUED,b.IN_PROGRESS].includes(e[0].status)}getUnworkedCheckExceptionCount(){let e=this.checkExceptions&&this.checkExceptions.items.filter(e=>e.resolvedFlag===!1).length;return e>0?e.toString():``}getUnworkedAchExceptionCount(){let e=this.achExceptions&&this.achExceptions.items.filter(e=>!e.decision||e.decision===m.UNDECIDED).length;return e>0?e.toString():``}async routeEnter(e,t,n,r){return a.setTitleAndTrack(`Positive pay`,o.getRouteUrlWithoutParams(r),n),await super.routeEnter(e,t,n,r)}static get styles(){return[d,u,n`:host{background-size:100%;flex:1 0 auto;display:block;position:relative}.columns{margin:42px 0;display:flex}.columns>div:first-child{flex:7 1 0;margin-right:16px}.columns>div{flex:5 0 0}.desktop{display:block}.mobile{display:none}@media (width<=1200px){.columns>div:first-child,.columns>div{flex:50%}}@media (width<=1024px){.columns{margin-top:18px}}@media (width<=768px){.desktop{display:none}.mobile{display:block}.columns{flex-direction:column;max-width:512px;margin:18px auto}.columns>div:first-child{order:2;margin:0}}jha-card#actions jha-list{flex-wrap:wrap;justify-content:flex-start;align-items:center}jha-card#actions jha-list-item{box-sizing:border-box;text-align:center;
1border-right:1px solid var(--divider-default-color);flex:68px;min-width:68px;padding:0 2px}jha-card#actions jha-list-item:last-of-type{border-right:none}jha-card#actions jha-list-item:focus-within{background-color:var(--jha-focus-highlight-color)}jha-card#actions jha-list-item:after{display:none}jha-card#actions jha-list-item a{text-align:left;align-items:center;gap:20px;padding:20px;font-weight:500;text-decoration:none;display:flex}a.upload-button jh-icon-plus,a.work-check-exceptions-button jh-icon-money-checks,a.work-ach-exceptions-button jh-icon-shield-dollar-sign{width:24px;height:24px;fill:var(--jha-text-theme)}a.upload-button span,a.work-check-exceptions-button span,a.work-ach-exceptions-button span{color:var(--jha-text-base);flex:1}div.loading{justify-content:center;padding:40px 0;display:flex}div.loading jha-progress{width:24px;height:24px;margin:0 auto}#additional-actions .header{color:var(--body-text-primary-color);font-size:16px;font-weight:500;line-height:24px}#additional-actions a{line-height:20px}`]}get renderCheckExceptionsBadge(){let e=this.getUnworkedCheckExceptionCount();return e>0?i`<jha-badge warning medium> ${e} </jha-badge>`:``}get renderAchExceptionsBadge(){let e=this.getUnworkedAchExceptionCount();return e>0?i`<jha-badge warning medium> ${e} </jha-badge>`:``}get maybeRenderAddChecksButton(){return this.positivePayController.uploadChecksEntitlement||this.positivePayController.manuallyAddChecksEntitlement?i`<jha-list-item> <a class="upload-button" href="${this.positivePayController.uploadChecksEntitlement?`/positive-pay/upload`:`/positive-pay/manual-entry`}"> <jh-icon-plus></jh-icon-plus> <span>${`Add checks`}</span> </a> </jha-list-item>`:``}get renderActionsList(){return i`<jha-list> ${this.maybeRenderAddChecksButton} ${this.positivePayController.workCheckExceptionEntitlement?i`<jha-list-item> <a class="work-check-exceptions-button" href="/positive-pay/work-exceptions"> <jh-icon-money-checks></jh-icon-money-checks> <span>${`Work check exceptions`}</span> ${this.isEverythingStillLoading?i`<jha-progress></jha-progress>`:this.renderCheckExceptionsBadge} </a> </jha-list-item>`:``} ${this.positivePayController.workAchExceptionEntitlement?i`<jha-list-item> <a class="work-ach-exceptions-button" href="/positive-pay/work-ach-exceptions"> <jh-icon-shield-dollar-sign></jh-icon-shield-dollar-sign> <span>${`Work ACH exceptions`}</span> ${this.isEverythingStillLoading?i`<jha-progress></jha-progress>`:this.renderAchExceptionsBadge} </a> </jha-list-item>`:``} </jha-list>`}get renderActionsListLoading(){return i`<div class="loading"> <jha-progress></jha-progress> </div>`}get hasAchFiltersAbility(){return!!s.store.institution.abilities.enablePospayAchFilters}get canViewAchFilters(){return this.isManageACHFiltersUI?this.hasAchFiltersAbility&&this.positivePayController.viewAchFilterEntitlement:this.positivePayController.viewAchExceptionFilterEntitlement}render(){return i`<bannoweb-page-container heading="Positive pay"> <div class="columns"> <div> <bannoweb-positive-pay-card .fileUploads="${this.fileUploads}" .isLoading="${this.isRefreshing}" @retry-load-uploads="${this.loadPosPayData}"></bannoweb-positive-pay-card> </div> <div> <jha-card id="actions"> ${this.positivePayEntitlementsLoading?this.renderActionsListLoading:this.renderActionsList} </jha-card> ${this.positivePayController.hasAdditionalEntitlements||this.canViewAchFilters?i`<jha-card id="additional-actions"> <jha-list> <jha-list-item> <span>${`Settings`}</span> </jha-list-item> <jha-list-item> <a class="edit-templates-button" href="/positive-pay/manage-templates"> <span>${`Manage templates`}</span> </a> </jha-list-item> ${this.canViewAchFilters?i`<jha-list-item> <a href="/positive-pay/ach-filter-rules"> <span>${this.isManageACHFiltersUI?`Manage ACH filter rules`:`View ACH f
1ilter rules`}</span> </a> </jha-list-item>`:``} </jha-list> </jha-card>`:``} </div> </div> </bannoweb-page-container>`}},customElements.define(window.BannowebPositivePayDashboardLitElement.is,window.BannowebPositivePayDashboardLitElement);var C=window.BannowebPositivePayDashboardLitElement;export{C as default};
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.