PageSourceSearch

https://www.aljazirasupermarkets.com/_next/static/chunks/pages/user/loyalty/history-99e2c5f32a6bf2cb.js

js aljazirasupermarkets.com collected 2026-09-24 13:34:55 UTC 7,426 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:wave-grocery-web":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d8c7be05-ca77-4724-9215-5e20e6937c51",e._sentryDebugIdIdentifier="sentry-dbid-d8c7be05-ca77-4724-9215-5e20e6937c51")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1107],{19596:(e,t,r)=>{"use strict";r.d(t,{q:()=>s});var n=r(13478),a=r(61482),o=class extends n.${constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:(0,a.PL)()},t)}getOptimisticResult(e){return e.behavior=(0,a.PL)(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:r}=e,n=super.createResult(e,t),{isFetching:o,isRefetching:i}=n,s=o&&r.fetchMeta?.fetchMore?.direction==="forward",l=o&&r.fetchMeta?.fetchMore?.direction==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,a.rB)(t,r.data),hasPreviousPage:(0,a.RQ)(t,r.data),isFetchingNextPage:s,isFetchingPreviousPage:l,isRefetching:i&&!s&&!l}}},i=r(56805);function s(e,t){return(0,i.t)(e,o,t)}},36347:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/loyalty/history",function(){return r(67877)}])},67877:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSG:()=>C,default:()=>T});var n=r(37876),a=r(14232),o=r(77328),i=r.n(o),s=r(40123),l=r.n(s),d=r(89099),u=r(50525),c=r(19596),y=r(56557),m=r.n(y),f=r(23261),h=r(97272),g=r(43820);async function p(){try{return{data:(await g.dp.get("/loyalty/users/me/summary")).data}}catch(t){var e;return{error:null==t||null==(e=t.response)?void 0:e.data}}}async function _(e){let{pageNumber:t,pageSize:r}=e;try{return g.dp.get("/loyalty/users/me/transactions",{params:{pageSize:r,pageNumber:t}})}catch(e){var n;return{error:null==e||null==(n=e.response)?void 0:n.data}}}var v=r(47961),b=r(89368),P=r(93779),x=r(45893),w=r(97077),L=r.n(w);function S(e){let{user:t,image:r}=e,o=(0,b.useTranslations)("user_loyalty"),i=(0,d.useRouter)(),{token:s}=t,l=(0,a.useRef)(),{formatter:u,currency:y}=(0,a.useContext)(v.d),[g,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{!async function(){await p()}()},[]);let S=async e=>{let{pageParam:t}=e;return await _({pageNumber:t.toString(),pageSize:15})},{data:E,isLoading:M,isFetchingNextPage:C,fetchNextPage:T}=(0,c.q)({queryKey:["user/loyalty/history/",i.locale],queryFn:S,enabled:!!s,getNextPageParam:(e,t,r)=>{var n;if((null==e||null==(n=e.data)?void 0:n.length)!==0)return r+1},getPreviousPageParam:(e,t,r)=>{if(!(r<=1))return r-1},initialPageParam:0,staleTime:0,select:e=>e.pages.flatMap(e=>e.data.map(A))}),A=e=>({orderId:e.receiptNumber,orderDate:e.transactionDate,orderTime:e.transactionDate,amountSpent:e.amountSpent,collectedPoints:e.pointsCollected,redeemPoints:e.pointsRedeemed,discountAmount:e.discountAmount,source:e.source}),N=(0,a.useCallback)(e=>{e&&(M||C||(l.current&&l.current.disconnect(),l.current=new IntersectionObserver(e=>{e[0].isIntersecting&&T()}),l.current.observe(e)))},[M,C,T]);return(0,a.useEffect)(()=>{t&&(x.A.addEvent("LOAD_USER_LOYALTY_SUMMARY"),(0,P.Ig)(s).then(e=>{w(e)}).catch(e=>{console.error("Error fetching user summary:",e)}).finally(()=>{x.A.removeEvent("LOAD_USER_LOYALTY_SUMMARY")}))},[t]),(0,n.jsxs)("div",{className:L().loyaltyContainer,children:[(0,n.jsx)(f.TitleAndBack,{wording:o("loyalty_transaction_history"),onBack:()=>void h.HP.open()}),!M&&((null==E?void 0:E.length)===0||!E)&&(0,n.jsxs)("div",{className:L().emptyListContainer,children:[(0,n.jsx)(f.Image,{size:f.ImageSizeEnum.NoAddresses,imgSrc:r,imgTitle:o("no_loyalty_transactions")}),(0,n.jsx)(f.Heading,{classOption:L().notFoundWording,type:f.HeadingEnum.HeadingS,color:f.TextColorEnum.OnSurfaceHighEmphasis,bold:f.BoldEnum.Bold,children:o("no_loyalty_transactions")}),(0,n.jsx)(f.Text,{type:f.TextEnum.Assistive,color:f.TextColorEnum.OnSurfaceLowEmphasis,children:o("no_loyalty_transactions_subtext")})]}),!M&&E&&(null==E?void 0:E.length)>0&&(0,n.jsx)("div",{className:L().redemptionSummaryCardContainer,children:(0,n.jsx)(f.CouponsRedemptionCard,{pointsValue:null==g?void 0:g.totalLoyaltyPoints,postfix:o("redemptionCardSummary.postfix"),orders:null==g?void 0:g.totalTransactions,redeemedPoints:null==g?void 0:g.totalRedeemedPoints,savings:null==g?void 0:g.totalSavings,currencyFormatter:u,currentBalanceLabel:o("currentBalanceLabel"),totalOrdersLabel:o("totalOrdersLabel"),totalRedeemedPointsLabel:o("totalRedeemedPointsLabel"),totalSavingsLabel:o("totalSavingsLabel")})}),!M&&(null==E?void 0:E.map((e,t)=>{let r=t===E.length-1;return(0,n.jsx)("div",{ref:r?N:null,children:(0,n.jsx)(f.LoyaltyRedemptionCard,{orderId:e.orderId,orderDate:m()(e.orderDate).format("MMM D, YYYY"),orderTime:m()(e.orderTime).format("HH:mm"),amountWording:o("amount_spent"),collectWording:o("amount_collected"),redeemWording:o("amount_redeemed"),amount:u.format(e.amountSpent/100),collectedPoints:e.collectedPoints,redeemPoints:"".concat(0!==e.redeemPoints?"-":"").concat(e.redeemPoints),labelText:"".concat(new Intl.NumberFormat(i.locale,{style:"currency",currency:y,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:2}).format(e.discountAmount/100)," ").concat(o("discount"))})},e.orderId)}))]})}var E=r(20653),M=r(3308),C=!0;function T(e){let{responsiveLogo:t,image:r}=e,[o,s]=(0,a.useState)(),[c,y]=(0,a.useState)(),[m,f]=(0,a.useState)(!1),h=(0,d.useRouter)();return((0,a.useEffect)(()=>{let e=u.A.subscribe(e=>{if(l()(e))return void h.replace("/login");s(e)});return()=>e.unsubscribe()},[]),(0,a.useEffect)(()=>{!async function(){var e,t,r;let n=await (0,M.q)();if(y(n),f(null==n||null==(t=n.loyalty)||null==(e=t.digitalWallet)?void 0:e.enabled),!(null==n||null==(r=n.loyalty)?void 0:r.enabled))h.replace("/")}()},[]),null==o?void 0:o._id)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i(),{children:[(0,n.jsx)("title",{children:"Al Jazira"}),(0,n.jsx)("meta",{name:"description",content:"App for ".concat("Al Jazira"," by Wave Grocery")}),(0,n.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,n.jsx)("link",{rel:"icon",href:t})]}),(0,n.jsx)(S,{user:o,image:r,showLoyaltyCardButton:m})]}):null}T.getLayout=function(e){return(0,n.jsx)(E.A,{isUserLayout:!0,userSelectedMenu:"loyalty",children:e})}},97077:e=>{e.exports={loyaltyContainer:"LoyaltyTransactionsHistory_loyaltyContainer__wJefc",redemptionSummaryCardContainer:"LoyaltyTransactionsHistory_redemptionSummaryCardContainer__khIQd",emptyListContainer:"LoyaltyTransactionsHistory_emptyListContainer__B8XjP",notFoundWording:"LoyaltyTransactionsHistory_n
1otFoundWording__gOeuF"}}},e=>{e.O(0,[2968,8200,3562,8922,1286,653,636,6593,8792],()=>e(e.s=36347)),_N_E=e.O()}]);
2//# sourceMappingURL=history-99e2c5f32a6bf2cb.js.map

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.