PageSourceSearch

https://hardingtest.com/_next/static/chunks/pages/admin/orders-496168b4bece2b8f.js

js hardingtest.com collected 2026-10-02 05:03:41 UTC 13,124 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1426,4854],{82479:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/orders",function(){return t(11284)}])},24854:function(e,r,t){"use strict";t.r(r),t.d(r,{generateInvoicePdf:function(){return c}});var n=t(47568),s=t(70655),a=t(85893),i=(t(67294),t(9669)),o=t.n(i),c=function(){var e=(0,n.Z)((function(e,r){var t,n,a,i,c,u,l=arguments;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:t=l.length>2&&void 0!==l[2]?l[2]:[],s.label=1;case 1:return s.trys.push([1,7,,8]),n="https://us-central1-harding-test.cloudfunctions.net/generateInvoicePdf",[4,o().post(n,{data:{invoiceData:e,userDetails:r,filesInfo:t}})];case 2:return a=s.sent(),(i=a.data)&&i.result&&i.result.success?[4,fetch(i.result.url)]:[3,5];case 3:return[4,s.sent().blob()];case 4:return[2,s.sent()];case 5:throw new Error((null===(c=i.result)||void 0===c?void 0:c.error)||"Failed to generate invoice");case 6:return[3,8];case 7:throw u=s.sent(),console.error("Error in generateInvoicePdf:",u),u;case 8:return[2]}}
1))}));return function(r,t){return e.apply(this,arguments)}}();r.default=function(e){e.userDetails;var r=e.invoiceData;return(0,a.jsx)("div",{children:(null===r||void 0===r?void 0:r.invoiceUrl)&&(0,a.jsx)("a",{href:r.invoiceUrl,target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)("img",{src:"/img/group.svg",alt:"View Invoice",style:{cursor:"pointer"},title:"View Invoice"})})})}},11284:function(e,r,t){"use strict";t.r(r);var n=t(2236),s=t(47568),a=t(14924),i=t(26042),o=t(69396),c=t(70655),u=t(85893),l=t(67294),d=t(11163),h=t(30381),f=t.n(h),p=t(50471),m=t(42001),v=t(14592),g=t(34682),x=t(54268),y=t(42287),j=t(19755),b=t.n(j),N=t(32935),I=t(9580),_=t(46185),w=t(57421),Z=t(99800),S=t(24854);r.default=(0,p.Z)((function(){var e=function(e){var r,n=[];if(e.length&&e.forEach((function(e){e.empty||e.forEach((function(e){return n.push((0,i.Z)({id:e.id},e.data()))}))})),null===(r=h.current)||void 0===r?void 0:r.value){fe(n);var s=[];if(n&&n.length)for(var a=0;a<n.length;a++){var o=n[a].userId;s.push(o)}s&&s.length?(s=s.filter((function(e,r,t){return t.indexOf(e)===r})),t((0,I.qg)(s)),X(!1)):X(!1)}else fe(me)},r=!1,t=((0,d.useRouter)(),(0,N.T)()),h=(0,l.useRef)(null),p=(0,l.useRef)(null),j=(0,N.C)((function(e){var r=e.admin;return{loadingOrders:r.loading,orders:r.orders,videos:r.videos}})),D=j.loadingOrders,O=j.orders,E=j.videos,T=(0,l.useState)([]),k=T[0],C=T[1],A=(0,l.useState)(!1),F=A[0],P=A[1];function L(){return(L=(0,s.Z)((function(){var e,r,t;return(0,c.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),P(!0),[4,_.qm.collection("paymentHistory").get()];case 1:return(e=n.sent()).empty||(r=e.docs.map((function(e){return(0,i.Z)({id:e.id},e.data())})),C(r)),P(!1),[3,3];case 2:return t=n.sent(),console.error("Error fetching payment history:",t),P(!1),[3,3];case 3:return[2]}}
1))}))).apply(this,arguments)}(0,l.useEffect)((function(){t((0,I.m5)(ue,ge)),t((0,I.oc)()),function(){L.apply(this,arguments)}()}),[]),(0,l.useEffect)((function(){"undefined"!==typeof b()&&(b()(document).off().on("click","tr.toggleTr",(function(e){e.preventDefault(),b()(this).hasClass("active")?(b()(this).removeClass("active"),b()(this).parents(".fileTable").find(".hiddenFile").fadeOut()):(b()(this).addClass("active"),b()(this).parents(".fileTable").find(".hiddenFile").fadeIn())})),b()(document).on("click",".fileDownload",(function(e){e.stopPropagation()})))}),[O]);var M=(0,l.useState)(!1),V=M[0],q=M[1],R=(0,l.useState)(!1),B=R[0],U=R[1],Y=(0,l.useState)(!1),H=Y[0],X=Y[1],G=(0,l.useState)(!1),J=G[0],W=G[1],$=(0,l.useState)({}),z=$[0],K=$[1],Q=(0,l.useState)(),ee=Q[0],re=Q[1],te=(0,l.useState)(""),ne=te[0],se=te[1],ae=(0,l.useState)(""),ie=ae[0],oe=ae[1],ce=(0,l.useState)(),ue=ce[0],le=ce[1],de=(0,l.useState)([]),he=de[0],fe=de[1],pe=(0,l.useState)([]),me=pe[0],ve=pe[1],ge=function(e){return le(e)};function xe(){return xe=(0,s.Z)((function(e){var r,t,a,i,o,u,l,d,h,f,p,m,v;return(0,c.__generator)(this,(function(g){switch(g.label){case 0:if(!e||!e.length)return[2,[]];for(r=[],t=0;t<e.length;t+=10)r.push(e.slice(t,t+10));a=[],W(!0),i=!1,o=!1,g.label=1;case 1:g.trys.push([1,6,7,12]),l=(0,n.Z)(r.map(function(){var e=(0,s.Z)((function(e){return(0,c.__generator)(this,(function(r){return[2,_.qm.collection("users").where("userId","in",e).get()]}))}));return function(r){return e.apply(this,arguments)}}())),g.label=2;case 2:return[4,l.next()];case 3:if(!(i=!(d=g.sent()).done))return[3,5];h=d.value,f=h,a.push(f),g.label=4;case 4:return i=!1,[3,2];case 5:return[3,12];case 6:return p=g.sent(),o=!0,u=p,[3,12];case 7:return g.trys.push([7,,10,11]),i&&null!=l.return?[4,l.return()]:[3,9];case 8:g.sent(),g.label=9;case 9:return[3,11];case 10:if(o)throw u;return[7];case 11:return[7];case 12:return[4,Promise.all(a)];case 13:return m=g.sent(),v=m.flatMap((function(e){return e.docs})).map((function(e){return e.data()})),fe(v),ve(v),W(!1),[2]}}))})),xe.apply(this,arguments)}function ye(e,r){return je.apply(this,arguments)}function je(){return(je=(0,s.Z)((function(e,r){var t;return(0,c.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,_.qm.collection("users").where("".concat(e),">=",r).where("".concat(e),"<=",r+"\uf8ff").get()];case 1:return[2,n.sent()];case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}
1))}))).apply(this,arguments)}function be(){return be=(0,s.Z)((function(r){var t;return(0,c.__generator)(this,(function(n){return t=r.target.value,se(t),ee&&(clearTimeout(ee),re(void 0)),""===t&&Me(),re(setTimeout((0,s.Z)((function(){var r,n,s,a,i,o,u,l,d,f;return(0,c.__generator)(this,(function(c){switch(c.label){case 0:X(!0),c.label=1;case 1:return c.trys.push([1,8,,9]),(null===(r=h.current)||void 0===r?void 0:r.value)?(n=t[0].toUpperCase()+t.substr(1),[4,ye("email",t)]):[2];case 2:return s=c.sent(),[4,ye("email",n)];case 3:return a=c.sent(),[4,ye("firstName",t)];case 4:return i=c.sent(),[4,ye("firstName",n)];case 5:return o=c.sent(),[4,ye("companyName",t)];case 6:return u=c.sent(),[4,ye("companyName",n)];case 7:return l=c.sent(),d=[],s&&d.push(s),a&&d.push(a),i&&d.push(i),o&&d.push(o),u&&d.push(u),l&&d.push(l),e(d),[3,9];case 8:return f=c.sent(),console.error(f),[3,9];case 9:return[2]}}))})),2e3)),[2]}))})),be.apply(this,arguments)}function Ne(e,r){return Ie.apply(this,arguments)}function Ie(){return(Ie=(0,s.Z)((function(e,r){var t;return(0,c.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,_.qm.collection("orders").where("".concat(e),"==",r).get()];case 1:return[2,n.sent()];case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}
1))}))).apply(this,arguments)}function _e(e){return we.apply(this,arguments)}function we(){return we=(0,s.Z)((function(e){var r,n;return(0,c.__generator)(this,(function(s){return n=[],e.length&&e.forEach((function(e){e.empty||e.forEach((function(e){return n.push((0,i.Z)({id:e.id},e.data()))}))})),(null===(r=p.current)||void 0===r?void 0:r.value)?(t((0,I.q8)(n)),X(!1)):t((0,I.m5)(ue,ge)),[2]}))})),we.apply(this,arguments)}function Ze(){return Ze=(0,s.Z)((function(e){var r;return(0,c.__generator)(this,(function(t){return r=e.target.value,oe(r),ee&&(clearTimeout(ee),re(void 0)),""===r?(Me(),[2]):(re(setTimeout((0,s.Z)((function(){var e,t,n,s;return(0,c.__generator)(this,(function(a){switch(a.label){case 0:X(!0),a.label=1;case 1:return a.trys.push([1,3,,4]),(null===(e=p.current)||void 0===e?void 0:e.value)?[4,Ne("orderId",parseFloat(r))]:[2];case 2:return t=a.sent(),n=[],t&&n.push(t),_e(n),[3,4];case 3:return s=a.sent(),console.error(s),[3,4];case 4:return[2]}}))})),2e3)),[2])}))})),Ze.apply(this,arguments)}function Se(){return(Se=(0,s.Z)((function(e){var r;return(0,c.__generator)(this,(function(t){return r=z[e],K(r?function(r){return(0,o.Z)((0,i.Z)({},r),(0,a.Z)({},e,!1))}:function(r){return(0,o.Z)((0,i.Z)({},r),(0,a.Z)({},e,!0))}),[2]}))}))).apply(this,arguments)}(0,l.useEffect)((function(){var e=new Array;O&&Object.keys(O).length&&Object.keys(O).forEach((function(r){var t=O[r];t.userId&&e.push(t.userId)})),e&&e.length&&function(e){xe.apply(this,arguments)}(e)}),[O]);var De=(0,l.useState)(0),Oe=De[0],Ee=De[1],Te=(0,l.useState)(""),ke=Te[0],Ce=Te[1],Ae=(0,l.useState)(!1),Fe=Ae[0],Pe=Ae[1],Le=function(e,r){Ee(e),Ce(r),Pe(!Fe)},Me=function(){se(""),oe(""),fe([]),t((0,I.m5)(!1,ge,!0))},Ve=function(e){q(e),se("")},qe=function(e){U(e),oe("")};return(0,u.jsx)(m.Z,{bodyClass:"account-pg",title:"Orders",isAdmin:!0,children:(0,u.jsxs)("div",{className:"orders-pg admin-orders-pg",children:[(0,u.jsx)("div",{className:"pageTitle",children:"Tests"}),(0,u.jsxs)("div",{className:"pageContent",children:[(0,u.jsx)("div",{className:"searchForm",children:(0,u.jsxs)("div",{className:"form-floating clearfix",children:[(0,u.jsxs)("div",{className:"pos-relative",children:[ne?(0,u.jsx)("a",{href:"javascript:void(0)",onClick:Me,tabIndex:-1,className:"form-btn form-btn-clear js-btn-clear",style:{opacity:1,visibility:"visible"}}):"",(0,u.jsx)("input",{id:"search",name:"search",className:"form-control",type:"text",onChange:function(e){return be.apply(this,arguments)},value:ne,placeholder:"Search..",ref:h,disabled:V,onFocus:function(){return qe(!0)},onBlur:function(){return qe(!1)}})]}),(0,u.jsx)("input",{id:"id-search",name:"id-search",className:"form-search-id",type:"text",placeholder:"Search by Order ID..",value:ie,ref:p,onChange:function(e){return Ze.apply(this,arguments)},disabled:B,onFocus:function(){return Ve(!0)},onBlur:function(){return Ve(!1)}})]})}),H?"":(0,u.jsx)("table",{id:"ordersTable",children:function(e){var t=new Array,n=new Array;return e&&Object.keys(e).length&&Object.keys(e).forEach((function(s){var a=e[s],o=f()(a.orderDate).format("DD-MM-YYYY"),c=a.analysis_standard,l=a.videoIds&&a.videoIds.length?a.videoIds:[],d=(0,w.tF)(E,l),h={};if(a.userId&&he&&(h=he.filter((function(e){return e.userId===a.userId}))),Object.keys(h).length&&!n.includes(a.orderId)){r=!0;var p=z[a.orderId];n.push(a.orderId);var m,v=(m=a.orderId,k&&k.length&&k.find((function(e){return e.orderNumber===m.toString()||e.orderId&&e.orderId.toString()===m.toString()}))||null);v&&"HT".concat(function(e,r){var t="000000"+e;return t.substr(t.length-r)}(a.orderId,6));t.push((0,u.jsx)("tr",{children:(0,u.jsx)("td",{children:(0,u.jsx)("div",{className:"tableWrap",children:(0,u.jsxs)("table",{className:"fileTable",children:[(0,u.jsxs)("tr",{className:"fileInfo toggleTr",onClick:function(){return function(e){return Se.apply(this,arguments)}(a.orderId)},children:[(0,u.jsx)("td",{className:"itemData",children:(0,u.jsx)(g.Z,{done:d})}),(0,u.jsxs)("td",{className:"itemData",children:[(0,u.jsx)("div",{className:"itemLabel",children:"ID"}),(0,u.jsx)("div",{className:"itemValue",children:a.clientId?a.clientId:"NA"})]}),(0,u.jsxs)("td",{className:"itemData item-emailData",children:[(0,u.jsx)("div",{className:"itemLabel",children:"Email"}),(0,u.jsx)("div",{className:"itemValue",children:h&&h[0]?h[0].email:""})]}),(0,u.jsxs)("td",{className:"itemData",children:[(0,u.jsx)("div",{className:"itemLabel",children:"Order"}),(0,u.jsx)("div",{className:"itemValue",children:a.orderId})]}),(0,u.jsxs)("td",{className:"itemData",children:[(0,u.jsx)("div",{className:"itemLabel",children:"Date"}),(0,u.jsx)("div",{className:"itemValue",children:o})]}),(0,u.jsxs)("td",{className:"fileDownload",children:[(0,u.jsx)(x.Z,{className:"centerTooltip",message:"Download Invoice",position:"top",children:(0,u.jsx)("span",{onClick:function(e){return e.stopPropagation()},children:(0,u.jsx)(S.default,{invoiceData:(0,i.Z)({orderId:a.orderId,orderNumber:a.orderId.toString(),amount:a.amount||"$0.00",dateAndTime:a.orderDate||(new Date).toISOString(),type:"Order Payment",paymentMethod:a.paymentMethod||"card"},v||{}),userDetails:h[0]||{}})})}),"as_nab2006"===c?(0,u.jsx)("span",{className:"fileAlgo",children:(0,u.jsx)(x.Z,{message:"Tested using the Japanese/NAB 2006 algorithms",position:"bottom",children:"NAB"})}):""]}),(0,u.jsx)("td",{className:"itemData",children:(0,u.jsx)("a",{href:"#",className:"toggleList",children:(0,u.jsx)("img",{src:"/img/dashboard/arrow-down.svg"})})})]}),"fetch"==p?(0,u.jsx)("tr",{children:(0,u.jsx)("td",{className:"text-left",children:"Loading.."})}):"",p&&"fetch"!=p&&E&&E.length&&l&&l.length?(0,u.jsx)(y.Z,{adminView:!0,orderId:a.orderId,orderStatus:a.orderStatus,orderVideos:l,videos:E,toggleModal:Le}):""]})})})}))}})),t}(O)}),r||D||J||H?"":(0,u.jsx)("p",{children:"No Orders Found."})]}),D||J||F?(0,u.jsx)("div",{className:"mt-2 text-center error-msg",children:"Loading..."}):"",H?(0,u.jsx)("div",{className:"mt-2 text-center error-msg",children:"Searching..."}):"",ue&&!ie&&!ne&&!J&&!D&&(0,u.jsx)(v.Gp,{style:{margin:"25px auto 0",color:"#333",borderColor:"#333"},text:"LOAD MORE",onClick:function(){return t((0,I.m5)(ue,ge))}}),(0,u.jsx)(Z.Z,{closeRequestModal:function(){return Pe(!1)},isOpen:Fe,videoId:ke,orderId:Oe,orders:O,videos:E,currentUser:null})]})})}))}},function(e){e.O(0,[571,4885,5245,1190,8515,2175,4231,9023,3616,2001,3296,9774,2888,179],(function(){return r=82479,e(e.s=r);var r}));var r=e.O();_N_E=r}]);

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.