1import{a as v,b as C}from"/build/_shared/chunk-5Z5IJJIE.js";import{a as j}from"/build/_shared/chunk-MQJDYMCS.js";import{a as q}from"/build/_shared/chunk-QFXWV5ET.js";import{k as O,w as R}from"/build/_shared/chunk-RBFCHJWR.js";import{a as M}from"/build/_shared/chunk-JUM7J4TY.js";import{a as H}from"/build/_shared/chunk-RW7BUM27.js";import{e as i}from"/build/_shared/chunk-ADMCF34Z.js";var z=i(j()),G=i(q());var e=i(M());var p=i(H());var W=(0,e.forwardRef)(function({loading:f,setLoading:u,startDate:d,endDate:g,bonusType:h,refresh:x,noResultsText:A},L){let t=R(),c=O(),[S,y]=(0,e.useState)(-1),[n,I]=(0,e.useState)([]),[U,Z]=(0,e.useState)(0),[K,k]=(0,e.useState)(null),[P,T]=(0,e.useState)(0),B=10,w=(0,e.useCallback)(({itemsToFetch:r,itemsFetched:s,startDate:o,endDate:a,bonusType:l})=>{t.load(`/components/_bonusHistory?startDate=${o==null?void 0:o.toString()}&endDate=${a==null?void 0:a.toString()}&type=${l.toString().trim()}&take=${r}&skip=${s}`),u(!0)},[]);(0,e.useEffect)(()=>{c.forEach((r,s)=>{r.formAction==="/actions/optOut"&&y(s)})},[c]),(0,e.useEffect)(()=>{var r,s,o,a,l,D,b,E,F;if(t.state==="idle"&&(t==null?void 0:t.data)!==void 0){let $=!1;if(k(null),!t.data.isSuccessfulResponse){u(!1),k((o=(s=(r=t.data)==null?void 0:r.message)==null?void 0:s.errors)==null?void 0:o.error_description);return}c[S]&&(y(-1),(l=(a=c[S])==null?void 0:a.data)!=null&&l.isSuccessfulResponse&&($=!0));let m=C($?[]:n,(b=(D=t.data)==null?void 0:D.message)==null?void 0:b.items);I(m),Z((F=(E=t.data)==null?void 0:E.message)==null?void 0:F.totalItems),T(m==null?void 0:m.length),u(!1)}},[t.state,t==null?void 0:t.data]),(0,e.useImperativeHandle)(L,()=>({onScroll:()=>{_()}}));let _=()=>{let r=document.getElementById("bonusHistoryContainer");r.scrollHeight-r.scrollTop-r.clientHeight<1&&!f&&P<U&&w({itemsToFetch:B,itemsFetched:P,startDate:d,endDate:g,bonusType:h})};return(0,e.useEffect)(()=>{T(0),I([]),w({itemsToFetch:B,itemsFetched:0,startDate:d,endDate:g,bonusType:h})},[x]),n.length===0&&!f?(0,p.jsx)("div",{children:A}):(0,p.jsx)(v,{bonuses:n!=null?n:[]})});export{W as a};
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.