PageSourceSearch

https://web.whispahealth.com/_next/static/chunks/pages/store/products/create/order-c5af5b05123e7ea8.js

js whispahealth.com collected 2026-10-01 15:33:12 UTC 15,785 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4960],{71617:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/store/products/create/order",function(){return r(82863)}])},45373:function(e,t,r){"use strict";var l=r(85893),s=r(67294),a=r(11163),n=r(38294),i=r(4559);t.Z=()=>{let[e,t]=(0,s.useState)(!1),r=(0,a.useRouter)();return(0,l.jsxs)(l.Fragment,{children:[e?(0,l.jsx)("div",{className:"z-[2000000]",children:(0,l.jsx)(i.Mx,{})}):null,(0,l.jsxs)("div",{onClick:()=>{t(!0),r.back()},className:"flex cursor-pointer justify-center items-center border-b border-b-grey-2 w-[6rem]  pb-4 text-2xl ",children:[(0,l.jsx)(n.And,{className:"mr-2"}),(0,l.jsx)("button",{children:"back"})]})]})}},94425:function(e,t,r){"use strict";var l=r(85893);r(67294);var s=r(41664),a=r.n(s),n=r(11163);t.Z=e=>((0,n.useRouter)(),(0,l.jsxs)("footer",{className:"flex text-grey-5 bg-[#8195a21b] gap-4 sm:gap-8 text-2xl w-full items-center absolute bottom-0 justify-center py-6",children:[(0,l.jsx)(a(),{href:"https://bit.ly/whispawhatsapp",children:(0,l.jsx)("p",{children:"Contact us"})}),(0,l.jsx)(a(),{href:"https://whispahealth.com/privacy-policy/",children:(0,l.jsx)("p",{children:"Privacy Policy"})})]}))},15259:function(e,t,r){"use strict";var l=r(85893),s=r(44088),a=r(62469);t.Z=e=>{var t;return(0,l.jsxs)(s.fC,{value:e.value,onValueChange:e.filterFunction,children:[(0,l.jsxs)(s.xz,{className:" ".concat(e.classname||"text-[#000] shadow-sm bg-grey-2 rounded-2xl"," flex font-semibold text-[1.5rem]  py-[2.3rem] w-full items-center justify-between  px-[15px]  leading-none h-[35px] gap-[5px]  hover:bg-mauve3   outline-none"),children:[(0,l.jsx)(s.B4,{className:" mr-auto",placeholder:e.placeholder}),(0,l.jsx)(s.JO,{className:"text-violet11",children:(0,l.jsx)(a.v4q,{})})]}),(0,l.jsx)(s.h_,{children:(0,l.jsxs)(s.VY,{className:"overflow-hidden bg-white rounded-md shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",children:[(0,l.jsx)(s.u_,{className:"flex items-center justify-center h-[25px] bg-white text-violet11 cursor-default"}),(0,l.jsxs)(s.l_,{className:"p-[5px]",children:[(0,l.jsx)(s.ZA,{children:null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,l.jsx)(s.ck,{className:"px-4 text-2xl py-4 cursor-pointer font-medium",value:e.value,textValue:e.label,children:(0,l.jsx)(s.eT,{children:e.label})},e.value))}),(0,l.jsx)(s.Z0,{className:"h-[1px] bg-violet6 m-[5px]"})]}),(0,l.jsx)(s.$G,{className:"flex items-center justify-center h-[25px] bg-white text-violet11 cursor-default"})]})})]})}},16072:function(e,t,r){"use strict";var l=r(85893),s=r(67294),a=r(30548);t.Z=e=>{let{type:t,placeholder:r,field:n,form:i,onChange:d,onBlur:o,name:u,onFocus:m,label:c,onKeyDown:x,onPaste:v,value:h,readOnly:p,className:f,input2:b,emptyValue:j,id:g,pattern:N,hideLabel:y=!1,testId:w,onWheel:_,inputClass:S,disabled:k,labelClass:C,wrapperWidth:q,required:Z,passwordInput
1:E}=e,[R,I]=(0,s.useState)(!1),O=i&&i.touched[n.name]&&i&&i.errors[n.name],P=O&&""!==n.value,T=()=>{j(n.name,"")};return(0,l.jsxs)("div",{className:"".concat(q),children:[(0,l.jsxs)("div",{className:f,children:[(0,l.jsxs)("div",{className:"flex",children:[b&&(0,l.jsx)("label",{className:C,children:c}),Z?(0,l.jsx)("p",{className:"font-medium text-2xl ml-1 text-error-1",children:"*"}):null]}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("input",{type:"password"!==t||R?"password"===t||R?void 0:t:"password",onFocus:n&&n.onFocus||m,onWheel:n&&n.onWheel||_,onChange:n&&n.onChange||d,onBlur:n&&n.onBlur||o,value:n&&n.value||h||"",name:n&&n.name||u,id:n&&n.name||g,placeholder:r,onKeyDown:x,onPaste:v,pattern:N,autoComplete:"off",className:"".concat(S||"bg-white","   outline-none py-6 px-4 rounded-md"),readOnly:p,"data-testid":w,disabled:k}),(0,l.jsx)("div",{onClick:()=>I(!R),className:"absolute right-9 text-3xl text-grey-4 cursor-pointer top-[50%] -translate-y-[50%]",children:E&&R?(0,l.jsx)(a.tgn,{}):E&&!R?(0,l.jsx)(a.dSq,{}):null})]}),P&&"password"!==t&&(0,l.jsx)("div",{className:b?"cancel-error2":"cancel-error",onClick:()=>T()}),(0,l.jsx)("div",{className:"",children:!b&&!y&&(0,l.jsx)("span",{className:"label",children:c})})]}),O&&(0,l.jsx)("small",{className:"text-xl font-semibold text-error-1 mt-2 block",children:i.errors[n.name]})]})}},5402:function(e,t,r){"use strict";var l=r(85893);r(67294);var s=r(798),a=r(19617),n=r(94425);t.Z=e=>(0,l.jsxs)("div",{className:"".concat(e.blueBg?"bg-products-background":""," relative min-h-screen"),children:[(0,l.jsx)(s.Z,{showCart:e.showCart,whiteBg:e.navWhiteBg}),(0,l.jsx)(a.Z,{}),(0,l.jsx)("div",{className:"block  mx-auto",children:e.children}),(0,l.jsx)(n.Z,{})]})},4559:function(e,t,r){"use strict";r.d(t,{Mx:function(){return x},fT:function(){return o},XJ:function(){return u},vr:function(){return c},$j:function(){return m}});var l=r(85893);r(67294);var s=r(84022),a=r.n(s),n=r(25675),i=r.n(n),d={src:"/_next/static/media/loading-spinner.af254b41.svg",height:800,width:800,blurWidth:0,blurHeight:0};let o=()=>(0,l.jsx)("div",{className:"bg-grey-2 py-6  animate-pulse h-[10rem] rounded-2xl  mb-4"}),u=()=>(0,l.jsxs)("div",{className:"h-[30rem] mb-28 mt-12",children:[(0,l.jsx)("div",{className:" bg-grey-2 rounded-2xl h-full flex justify-center items-center sm:h-[80%]  mb-14 sm:mb-0 mx-auto animate-pulse"}),(0,l.jsx)("div",{className:"h-[3rem] bg-grey-2 w-full animate-pulse mt-[2rem]"}),(0,l.jsx)("div",{className:"h-[3rem] bg-grey-2 w-full animate-pulse mt-[2rem]"})]}),m=()=>(0,l.jsxs)("div",{className:a().Spinner,children:[(0,l.jsx)("div",{}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{})]}),c=()=>(0,l.jsx)(i(),{className:"w-6 h-6 fill-white animate-spin",src:d,alt:"Loading icon"}),x=()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed top-0 left-0 w-full h-screen z-[10000] bg-[#282828a2]"}),(0,l.jsx)("div",{className:"fixed top-[50%] left-[50%] -translate-x-[50%] z-[100000] -translate-y-[50%] ",children:(0,l.jsxs)("div",{className:a().Spinner,children:[(0,l.jsx)("div",{}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{})]})})]})},82863:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return _}});var l=r(85893),s=r(5402),a=r(67294),n=r(45373),i=r(40406),d=r(67846),o=r(2185),u=r(16072),m=r(15259),c=r(4559),x=r(90360),v=r(98106),h=r(15349),p=r(11163),f=r(72754),b=r(55801),j=r(87414),g=r(66545),N=r(80186),y=e=>{var t;let{data:r}=(0,b.a)("",{refetchOnMountOrArgChange:!0}),s=(0,o.I0)(),n=(0,p.useRouter)(),[y,w]=(0,a.useState)([]),[_,S]=(0,a.useState)({state:null===(t=e.data.state_id)||void 0===t?void 0:t.toString()}),[k,C]=(0,g.kD)(),q=(0,o.v9)(e=>e.persistedState.cart.cartItems),Z=(0,o.v9)(e=>e.persistedState.order.orderInfo),[E,R]=(0,a.useState)({}),[I,O]=(0,a.useState)(""),P={name:e.data.name||"",address:e.data.address||"",phone:e.data.number||"",landmark:e.data.landmark||"",city:e.data.city||""};(0,a.useEffect)(()=>{r&&w((0,j.PO)(r.data))},[r]),(0,a.useEffect)(()=>{var e,t,r,l,a,i;if(C.isError&&((null===(e=C.error)||void 0===e?void 0:e.status)===400&&((0,j.xF)(n.pathname),n.push("/auth/login?redirect=true")),(0,f.g)((null===(t=C.error.data)||void 0===t?void 0:t.message)||"Something went wrong","error")),C.data){let e=(0,j.qQ)(6),t=JSON.parse(localStorage.getItem("user")),d={public_key:h.Z.FLUTTERWAVE_KEY,amount:null===(l=C.data)||void 0===l?void 0:null===(r=l.data)||void 0===r?void 0:r.total_item_price,tx_ref:e,currency:"NGN",payment_options:"card,ussd,banktransfer",redirect_url:h.Z.FLUTTERWAVE_PRODUCTS_REDIRECT_URL,customer:{email:t.email,name:Z.name,phone_number:Z.phone}};s((0,v.sA)(E)),s((0,N.yM)(d)),s((0,N.T$)(null===(i=C.data)||void 0===i?void 0:null===(a=i.data)||void 0===a?void 0:a.delivery_fee)),n.push("/store/products/summary")}
1},[C.isError,C.isSuccess]);let T=async e=>{if(!_.state)return(0,f.g)("Please Select A State","error");let t={address:e.address,name:e.name,phone:e.phone,stateId:Number(_.state),landmark:e.landmark,city:e.city,state:_.state},r=q.map(e=>({productId:e.productId,quantity:e.quantity}));R(t),k({address:t,cartItems:r})};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(d.J9,{initialValues:P,validationSchema:i.U,onSubmit:T,children:(0,l.jsxs)(d.l0,{id:"create-order-form",children:[(0,l.jsxs)("div",{className:"flex flex-wrap md:my-8 justify-between w-full",children:[(0,l.jsx)(d.gN,{name:"name",component:u.Z,className:" flex-col flex mx-auto  text-xl",inputClass:"border border-grey-2 text-[1.5rem] w-full",placeholder:"Full Name",input2:!0,label:"Full Name",labelClass:"mb-2 font-medium mb-[1.4rem] text-[1.5rem] ",wrapperWidth:"w-full sm:w-[48%] mb-10 sm:mb-6",required:!0}),(0,l.jsx)(d.gN,{name:"phone",component:u.Z,className:" flex-col flex mx-auto  text-xl",inputClass:"border border-grey-2 text-[1.5rem] w-full",placeholder:"Phone Number",input2:!0,label:"Phone Number",labelClass:"mb-2 font-medium mb-[1.4rem] text-[1.5rem] ",wrapperWidth:"w-full sm:w-[48%] mb-10 sm:mb-6",required:!0})]}),(0,l.jsxs)("div",{className:"flex flex-wrap justify-between md:my-12",children:[(0,l.jsxs)("div",{className:"w-full mb-12 sm:mb-0 sm:w-[48%] -mt-[.5rem]",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)("p",{className:"font-medium mb-[1.4rem] text-[1.5rem] ",children:"State"}),(0,l.jsx)("p",{className:"font-medium text-2xl ml-1 text-error-1",children:"*"})]}),(0,l.jsx)(m.Z,{value:_.state,options:y,placeholder:I||"Select State",filterFunction:(e,t)=>{S({..._,state:e})},classname:"py-3 text-[#11101086] bg-white border border-grey-2 rounded-md"})]}),(0,l.jsx)(d.gN,{name:"address",component:u.Z,className:" flex-col flex mx-auto  text-xl",inputClass:"border border-grey-2 text-[1.5rem] w-full",placeholder:"Address",input2:!0,label:"Address",labelClass:"mb-2 font-medium mb-[1.4rem] text-[1.5rem] ",wrapperWidth:"w-full sm:w-[48%] mb-10 sm:mb-6",required:!0})]}),(0,l.jsxs)("div",{className:"flex flex-wrap md:my-8 justify-between w-full",children:[(0,l.jsx)(d.gN,{name:"city",component:u.Z,className:" flex-col flex mx-auto  text-xl",inputClass:"border border-grey-2 text-[1.5rem] w-full",placeholder:"City",input2:!0,label:"City",labelClass:"mb-2 font-medium mb-[1.4rem] text-[1.5rem] ",wrapperWidth:"w-full sm:w-[48%] mb-10 sm:mb-6",required:!0}),(0,l.jsx)(d.gN,{name:"landmark",component:u.Z,className:" flex-col flex mx-auto  text-xl",inputClass:"border border-grey-2 text-[1.5rem] w-full",placeholder:"Landmark",input2:!0,label:"landmark",labelClass:"mb-2 font-medium mb-[1.4rem] text-[1.5rem] ",wrapperWidth:"w-full sm:w-[48%] mb-10 sm:mb-6",required:!0})]}),(0,l.jsx)(x.Z,{className:"bg-blue-1 w-full relative text-white py-5  block mx-auto text-xl font-semibold rounded-md",children:C.isLoading?(0,l.jsx)("div",{className:"flex py-1 justify-center",children:(0,l.jsx)(c.vr,{})}):(0,l.jsx)("p",{className:"mr-auto text-2xl",children:"Proceed"})})]})})})},w=r(88883),_=e=>{var t,r,a,i,d,u,m,x,v,h,p,f,b,j,g,N,_,S,k,C,q;let{data:Z,isFetching:E}=(0,w.I_)("",{refetchOnMountOrArgChange:!0}),R=(0,o.v9)(e=>e.persistedState.auth.authStatus);return(0,l.jsx)(s.Z,{navWhiteBg:!0,children:(0,l.jsxs)("section",{className:" w-full   pb-32 pt-[10rem] xxl:h-screen block md:bg-products-background",children:[(0,l.jsx)("div",{className:"mt-5 ml-12 z-[2000000]",children:(0,l.jsx)(n.Z,{})}),E&&"LOGGED_IN"===R?(0,l.jsx)("div",{className:"relative h-[70vh]",children:(0,l.jsx)("div",{className:"absolute left-[50%] top-[50%] -translate-x-1/2 -translate-y-1/2 ",children:(0,l.jsx)(c.$j,{})})}):(0,l.jsxs)("div",{className:"max-w-[1500px] mx-auto flex flex-wrap items-center px-12 mm:px-36",children:[(0,l.jsxs)("div",{className:"w-full md:w-[70%] mm:w-[40%] mt-14 mm:mt-0",children:[(0,l.jsx)("h1",{className:"text-[4rem] font-bold text-grey-5 mb-6 ",children:"Delivery Information"}),(0,l.jsx)("p",{className:"text-2xl mb-12 mm:mb-0 font-semibold",children:"Please provide your valid delivery details."})]}),(0,l.jsx)("div",{className:"full rounded-xl w-full mm:w-[50%] bg-white mt-[2rem] py-16 sm:px-20  block mx-auto",children:(0,l.jsx)(y,{data:{address:null==Z?void 0:null===(i=Z.data)||void 0===i?void 0:null===(t=i.delivery_addresses[(null==Z?void 0:null===(a=Z.data)||void 0===a?void 0:null===(r=a.delivery_addresses)||void 0===r?void 0:r.length)-1||0])||void 0===t?void 0:t.full_address,city:null==Z?void 0:null===(x=Z.data)||void 0===x?void 0:null===(d=x.delivery_addresses[(null==Z?void 0:null===(m=Z.data)||void 0===m?void 0:null===(u=m.delivery_addresses)||void 0===u?void 0:u.length)-1||0])||void 0===d?void 0:d.city,landmark:null==Z?void 0:null===(f=Z.data)||void 0===f?void 0:null===(v=f.delivery_addresses[(null==Z?void 0:null===(p=Z.data)||void 0===p?void 0:null===(h=p.delivery_addresses)||void 0===h?void 0:h.length)-1||0])||void 0===v?void 0:v.closest_landmark,name:null==Z?void 0:null===(b=Z.data)||void 0===b?void 0:b.full_name,number:null==Z?void 0:null===(_=Z.data)||void 0===_?void 0:null===(j=_.delivery_addresses[(null==Z?void 0:null===(N=Z.data)||void 0===N?void 0:null===(g=N.delivery_addresses)||void 0===g?void 0:g.length)-1||0])||void 0===j?void 0:j.phone_number,state_id:null==Z?void 0:null===(q=Z.data)||void 0===q?void 0:null===(S=q.delivery_addresses[(null==Z?void 0:null===(C=Z.data)||void 0===C?void 0:null===(k=C.delivery_addresses)||void 0===k?void 0:k.length)-1||0])||void 0===S?void 0:S.states_id}})})]}),"\\"]})})}},87414:function(e,t,r){"use strict";r.d(t,{ED:function(){return i},Oi:function(){return c},P3:function(){return p},PO:function(){return v},R1:function(){return h},Vh:function(){return u},bI:function(){return n},fv:function(){return d},gM:function(){return o},qQ:function(){return m},xF:function(){return x}});var l=r(72754),s=r(17325),a=r(52514);function n(e,t){let r=e.substring(0,t);return e.length<=t?e:r+"..."}function i(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function d(e){let[t,r]=e.split(" "),[l,s]=t.split(":");return"12"===l&&(l="00"),"pm"===r&&(l=(parseInt(l,10)+12).toString()),"".concat(l,":").concat(s)}function o(e,t){let r=e.split("T"),l=r[1].split(":");return l.splice(0,2,t),r[0]+"T"+l.join(":")}function u(e){let t=[];for(let r of e)t.push("".concat(r.name," x").concat(r.quantity));return t.join(",")}function m(e){let t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=r.length,s=0;for(;s<e;)t+=r.charAt(Math.floor(Math.random()*l)),s+=1;return t}function c(e){let t;let r=e.split("@"),l=r[1].split(":"),s=Number(l[0]);return(12===s||10===s||11===s)&&(t=s-1),1===s&&(t=12),2===s&&(t=13),3===s&&(t=14),4===s&&(t=15),5===s&&(t=16),r[0]+"@"+(null==t?void 0:t.toString())+":"+l[1]}function x(e){localStorage.removeItem("token"),s.h.dispatch((0,a.nm)(e)),s.h.dispatch((0,a._4)("LOGGED_OUT")),(0,l.g)("Session Expired Please Log In","error")}function v(e){let t=[];
1for(let r of e)t.push({label:r.name,value:r.id.toString()});return t}function h(e){let t=[],r={};for(let t in e)r[e[t].label]=e[t];for(let e in r)t.push(r[e]);return t}function p(e){return e.replace(/\s+/g,"-").toLowerCase()}},40406:function(e,t,r){"use strict";r.d(t,{U:function(){return a},j:function(){return s}});var l=r(16310);let s=l.Ry({email:l.Z_().email("Invalid Email Address").required("Email is Required"),phone_number:l.Z_().min(11,"Cannot be less than 11 characters").required("Phone Number is Required"),first_name:l.Z_().required("First Name is Required"),last_name:l.Z_().required("Last Name is Required")}),a=l.Ry({name:l.Z_().required("Name is Required"),phone:l.Z_().required("Phone Number is Required"),address:l.Z_().required("Address is Required"),landmark:l.Z_().required("landmark is Required"),city:l.Z_().required("City is Required")})},84022:function(e){e.exports={Spinner:"Loader_Spinner__TDOgp"}}},function(e){e.O(0,[7409,9866,5445,2013,3873,1664,9880,7846,6310,8258,4088,5125,2888,9774,179],function(){return e(e.s=71617)}),_N_E=e.O()}]);

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.