1import{E as e,_ as t}from"./institution-DyFDvNu6.js";import{t as n}from"./paths-BjKNBopk.js";import{t as r}from"./page-B8YwBOEr.js";import{_r as i,o as a,vr as o}from"./main-5Sl8yySz.js";import{i as s,n as c,t as l}from"./ach-current-user-Tgr43UaV.js";import{n as u}from"./problem-BVr8cfRd.js";import{i as d}from"./batches-DWCL5hLB.js";import"./card-ZABq8UrK.js";import{i as f}from"./banno-styles-B3iGgKv1.js";import"./bannoweb-page-container-G_uPsQAr.js";import{t as p}from"./generic-dialogs-8zuEpB8Y.js";function m(e){return e===`draft`}var h=o(p(t),`fadeinup`),g=class extends h{static get properties(){return{batchId:{attribute:`batchid`,type:String},achCurrentUser:{type:Object},entitled:{type:Boolean},batchStatus:{type:String}}}static get styles(){return[f,e` 2 :host { 3 display: block; 4 flex: 1 0 auto; 5 position: relative; 6 } 7 `]}constructor(){super(),this.batchId=null,this.achCurrentUser=null,this.entitled=!1,this.batchStatus=null,this.statusToken_=0,s(this),this.addEventListener(u,e=>{i.go(e.detail.href)})}connectedCallback(){super.connectedCallback(),this.achCurrentUser=l(a.store.user),this.checkEntitlement()}get requiredEntitlement(){return`viewBatchDetails`}get loadsBatchStatus(){return this.requiresEditableBatch}get requiresEditableBatch(){return!1}updated(e){super.updated(e),(e.has(`entitled`)||e.has(`batchId`)||e.has(`achCurrentUser`))&&this.loadBatchStatus_(),this.requiresEditableBatch&&e.has(`batchStatus`)&&this.batchStatus!==null&&!m(this.batchStatus)&&i.go(c.batchRecipients(this.batchId))}async loadBatchStatus_(){if(!this.loadsBatchStatus||!this.entitled||!this.batchId||!this.achCurrentUser)return;let e=++this.statusToken_;try{let t=await d(this.batchId,{institutionId:this.achCurrentUser.institutionId});if(e!==this.statusToken_)return;this.batchStatus=t.data&&t.data.status||null}catch{e===this.statusToken_&&(this.batchStatus=null)}}async checkEntitlement(){try{if(await a.achBatchController.ensureAchEntitlementsLoaded(),this.achCurrentUser=l(a.store.user),!a.store.user?.achEntitlements?.entitlements?.[this.requiredEntitlement]){i.go(n.BANNOWEB_ACH_PAYMENTS);return}this.entitled=!0}catch(e){this.showStandardErrorRetryDialog_({error:e,onClickRetry:e=>{this.dispatchEvent(new CustomEvent(`closeModal`,{bubbles:!0})),this.checkEntitlement()},onClickCancel:e=>{this.dispatchEvent(new CustomEvent(`closeModal`,{bubbles:!0})),i.go(n.BANNOWEB_ACH_PAYMENTS)}})}}trackPage(e,t,n){r.setTitleAndTrack(e,i.getRouteUrlWithoutParams(n),t)}};export{m as n,g as t};
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.