var __assign=this&&this.__assign||function(){__assign=Object.assign||function(a){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))a[n]=e[n]}return a};return __assign.apply(this,arguments)};var __spreadArrays=this&&this.__spreadArrays||function(){for(var a=0,e=0,t=arguments.length;e<t;e++)a+=arguments[e].length;for(var r=Array(a),n=0,e=0;e<t;e++)for(var l=arguments[e],o=0,s=l.length;o<s;o++,n++)r[n]=l[o];return r};import{l as luxon}from"./luxon-1be92a8e.js";var mockRewardData=function(a,e){if(a===void 0){a=4}if(e===void 0){e=undefined}var t=__spreadArrays(Array(a)).map((function(){return getMockData(e)}));return{data:t}};var units=["POINT","TICKET","GIFT"];var prettyValues=["Points","Tickets","Gifts"];var statuses=["AVAILABLE","PENDING","CANCELLED","EXPIRED","REDEEMED"];var pendingReasons=["US_TAX","SCHEDULED","UNHANDLED_ERROR"];var paypalStatuses=["PENDING","IN_PROGRESS","FAILED","UNCLAIMED","ONHOLD","REFUNDED","RETURNED","REVERSED","BLOCKED","DENIED"];function getPaypalStatus(a){if(a)return"SUCCESS";var e=Math.floor(Math.random()*10);var t=paypalStatuses[e];return t}var getPaypalMeta=function(){var a,e;var t=Math.floor(Math.random()*10)>=5?(a=luxon.DateTime.now())===null||a===void 0?void 0:a.minus({day:1}):null;var r=Math.floor(Math.random()*10)>=5?(e=luxon.DateTime.now())===null||e===void 0?void 0:e.minus({day:1}):null;var n=getPaypalStatus(t);var l=n==="DENIED"?"WARN":!!t?"SUCCESS":Math.floor(Math.random()*10)>=8?"ERROR":"SUCCESS";return{status:l,customMeta:{datePaidOut:t,dateLastAttempted:r,dateFirstAttempted:r,rawPayPalInfo:{transaction_status:n}}}};var getMockData=function(a){var e=false;var t=0;var r;var n;var l;var o;var s=luxon.DateTime.now();var d=Math.floor(Math.random()*3);var i=a||statuses[Math.floor(Math.random()*5)];var u=units[d];var E=prettyValues[d];var m=Math.floor(Math.random()*100)+2;if(i==="AVAILABLE"){t=Math.floor(Math.random()*m);o=Math.floor(Math.random()*10)<3?s.plus({days:7}).toMillis():null}else if(i==="EXPIRED"){e=true;t=Math.floor(Math.random()*m);o=s.minus({days:1}).toMillis()}else if(i==="PENDING"){var p=pendingReasons[Math.floor(Math.random()*3)];r=[p];if(p==="SCHEDULED"){n=s.plus({days:6}).toMillis()}}else if(i==="REDEEMED"){e=true}else{e=true;l=s.minus({days:2}).toMillis()}var v=Math.floor(Math.random()*3);return{id:"61f7878e096c9265de88b46f",type:"CREDIT",value:m,unit:u,name:null,dateGiven:s.minus({days:3}).toMillis(),dateExpires:o,dateCancelled:l,dateRedeemed:i==="REDEEMED"?s.plus({days:2}).toMillis():null,dateScheduledFor:n,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:m+" "+E,prettyValueNumber:""+m,prettyAvailableNumber:e?"0":""+(m-t),prettyRedeemedNumber:e&&!t?"0":""+t,programId:v===1?"program-id":null,program:{name:"My Program"},meta:__assign({},getPaypalMeta()),statuses:[i],pendingReasons:r,globalRewardKey:null,programRewardKey:null,rewardSource:v===1?"AUTOMATED":"MANUAL",prettyRedeemedCredit:t+" "+E,prettyAssignedCredit:m+" "+E,prettyAvailableValue:e?"0 "+E:m-t+" "+E,exchangedRewardRedemptionTransaction:v===2?{id:"61f7878e096c9265de88b414",creditRedeemed:50,prettyRedeemedCredit:"50 Tokens",unit:"TOKEN",dateRedeemed:1643612046258,exchangedRewards:[],redeemedRewards:[]}:null,referral:null,rewardRedemptionTransactions:{data:[]}}};export{getPaypalMeta as g,mockRewardData as m};