1/*! For license information please see 2887.0292f7d110b6293a70eb.js.LICENSE.txt */ 2(self.webpackChunkchargehound_api=self.webpackChunkchargehound_api||[]).push([[2887],{56080:(t,i,e)=>{"use strict";e.r(i),e.d(i,{default:()=>n.qO});var n=e(95011)},85015:(t,i,e)=>{var n=e(72552),s=e(56449),o=e(40346);t.exports=function(t){return"string"==typeof t||!s(t)&&o(t)&&"[object String]"==n(t)}},95011:(t,i,e)=>{"use strict";e.d(i,{DS:()=>u,Sn:()=>l,qO:()=>f,te:()=>m});var n=e(42203),s=e(8435),o=e(74716),r=e(95093),a=e.n(r),c=e(47186),p=e(96540),h=e(79608);function d(){return d=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},d.apply(null,arguments)}function g(t,i,e){return(i=function(t){var i=function(t,i){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,i||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:i+""}(i))in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function l(t,i){const e=(0,h.A)({config:i,name:"invoice",params:[t.id]});t.url=e;const n=a().unix(t.periodStart).utc(),s=a().unix(t.periodEnd).utc(),o=a().unix(t.date).utc();return t.formattedStart=n.format("MMM Do, YYYY"),t.formattedEnd=s.format("MMM Do, YYYY"),t.formattedDate=o.format("MMM Do, YYYY"),t}function u(t,i){return t.forEach((t=>l(t,i))),t}class f extends p.Component{constructor(t){super(t),g(this,"setSaving",(t=>{this.setState({saving:t})})),g(this,"setLoading",(t=>{this.setState((i=>!1===i.loading?{reloading:t}:{loading:t}))})),g(this,"markAsPaid",(()=>{this.setSaving(!0);const t=(0,h.A)({config:this.props.config,name:"adminInvoiceJson",params:["logged_in_as_cus",this.props.match.params.invoiceId]});return(0,n.bE)(t,{paid:!0}).then((()=>{this.setState((t=>(t.invoice.paid=!0,t)),(()=>{this.props.successAlert("The invoice was marked as paid."),this.setSaving(!1)}))})).catch((t=>this.props.handleError(t,(()=>this.setSaving(!1)))))})),this.state={loading:!0,reloading:!1,saving:!1,invoice:null,items:[],subscriptionItems:[]}}componentDidMount(){this.loadInvoice(this.props.match.params.invoiceId,this.props.location.search)}componentDidUpdate(t){t.location.key!==this.props.location.key&&this.loadInvoice(this.props.match.params.invoiceId,this.props.location.search)}loadInvoice(t,i){this.setLoading(!0);const e=c.parse(i.slice(1)),s={};e.starting_after?s.starting_after=e.starting_after:e.ending_before&&(s.ending_before=e.ending_before),e.filter&&(s.filter=e.filter);const o=(0,h.A)({config:this.props.config,name:"invoiceJson",params:[t],queryParams:s});(0,n.Ay)(o).then((t=>{this.setState({invoice:l(t.invoice,this.props.config),organization:t.organization,items:t.items,subscriptionItems:t.subscriptionItems,startsAt:t.startsAt,endsAt:t.endsAt},(()=>{this.setLoading(!1)}))})).catch((t=>this.props.handleError(t,(()=>this.setLoading(!1)))))}render(){return p.createElement(s.Ay,d({markAsPaid:this.markAsPaid},this.props,this.state))}}class m extends p.Component{constructor(t){super(t),g(this,"setLoading",(t=>{this.setState({loading:t})})),this.setLoading=this.setLoading.bind(this),this.state={loading:!0,invoices:[]}}componentDidMount(){this.loadInvoices(this.props.location.search)}componentDidUpdate(t){t.location.key!==this.props.location.key&&this.loadInvoices(this.props.location.search)}loadInvoices(t){this.setLoading(!0);const i=c.parse(t.slice(1)),e={};i.starting_after?e.starting_after=i.starting_after:i.ending_before&&(e.ending_before=i.ending_before),i.filter&&(e.filter=i.filter);const s=(0,h.A)({config:this.props.config,name:"invoicesJson",queryParams:e});(0,n.Ay)(s).then((t=>{this.setState({invoices:u(t.invoices,this.props.config),organization:t.organization,startsAt:t.startsAt,endsAt:t.endsAt},(()=>{this.setLoading(!1)}))})).catch((t=>this.props.handleError(t,(()=>this.setLoading(!1)))))}render(){return p.createElement(o.Ay,d({},this.props,this.state))}}}}]);
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.