1import{Controller}from"@hotwired/stimulus";import{Objects}from"lib/objects";import{Users}from"components/server/users";import{FormMessage}from"components/form_message";const objects=new Objects,users=new Users,formMessage=new FormMessage;let notify;export default class extends Controller{static targets=["showDetails","showConfirm","showExchanges","showSellExchange","sellExchangeCount","showBuyExchange","buyExchangeCount"];connect(){const requestingControllers={cardNotificationsLight:!1,commsLight:!1};this.dispatch("notify"),this.fetchUser(),this.global={requestingControllers:requestingControllers}}fetchUser(){users.currentUser(httpResponse=>this.userSuccessFn(httpResponse),response=>notify.danger(response.message))}userSuccessFn(user){this.user?objects.writeBack(this.user,user):this.user=user,this.global.sendAfterUser?(delete this.global.sendAfterUser,this.sendUser()):this.mustRefreshView&&(delete this.mustRefreshView,this.cardNotificationsLight.fetchAndDisplay(),this.commsLight.display())}listener({detail:dataObj}){const fromController=dataObj.from,requestingControllers=this.global.requestingControllers;requestingControllers[fromController]=!0,this[fromController]=dataObj.controller,Object.values(requestingControllers).includes(!1)||(this.user?this.sendUser():this.global.sendAfterUser=!0)}receiveNotify({detail:dataObj}){this.notifyAssigned||(this.notifyAssigned=!0,notify=dataObj.notify)}sendUser(){this.dispatch("sendUser",{detail:{user:this.user,cancelAccountController:this,notify:notify,formMessage:formMessage}}),this.displayExchangeCounts()}displayExchangeCounts(){const user=this.user;let buyCount,sellCount;for(const userNumber of user.user_numbers)"sell_exchange_sent"===userNumber.data?sellCount=userNumber.count:"buy_exchange_paid"===userNumber.data&&(buyCount=userNumber.count);(buyCount||sellCount)&&(this.showExchangesTarget.hidden=!1,sellCount&&(this.sellExchangeCountTarget.innerHTML=`View ${sellCount} sell orders`,this.showSellExchangeTarget.hidden=!1),buyCount&&(this.buyExchangeCountTarget.innerHTML=`View ${buyCount} buy orders`,this.showBuyExchangeTarget.hidden=!1))}nextToConfirm(){this.openClosePages(!0)}backToComms(){this.openClosePages(!1)}
1openClosePages(isAdvance){this.showDetailsTarget.hidden=isAdvance,this.showConfirmTarget.hidden=!isAdvance}backDetect(){setTimeout(()=>{this.areBack()},1500)}areBack(){this.mustRefreshView=!0,this.fetchUser()}}
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.