(()=>{"use strict";var e,l,i,n,t,o,a={9218:(e,l,i)=>{i.d(l,{Q:()=>n});const n={apiBaseUrlV1:"",apiBaseUrlV2:"",srApiBaseUrl:"https://apiv2.shiprocket.in/v1/",gaId:"",clevertapId:"",debugTracking:!0,apiIdentityService:"https://edge.pickrr.com/identity-service/",pickrrAggregatorApi:"https://edge.pickrr.com/aggregator/",pickrrCustomerApi:"https://edge.pickrr.com/customer/",pickrrOrderApi:"https://edge.pickrr.com/order/",couponSuggestionBaseUrl:"https://edge.pickrr.com/promotion/",paymentServiceBaseUrl:"https://edge.pickrr.com/pay/",paymentHandler:"https://payment-handler.pickrr.com/payment/callback/razorpay/",pickrrCartService:"https://edge.pickrr.com/cart/",resumeCartService:"https://edge.pickrr.com/aggregator/api/ve1/aggregator-service/abandon-checkout/",RAZORPAY_CALLBACK:"https://edge.pickrr.com/pay/api/ve1/payment-aggregator/transaction/verify-and-redirect/razorpay",edgeService:"https://edge.pickrr.com/",IS_PRODUCTION:!0,IDENTITY_SERVICE:"/identity-service/session/create",SELLER_CONFIG:"/aggregator/api/ve1/aggregator-service/seller/config",CART_SERVICE:"/cart/api/ve1/cart-service/",RESUME_CART:"/aggregator/api/ve1/aggregator-service/abandon-checkout/",ABANDONED_CART:"api/ve1/aggregator-service/cart-service",USER_DETAILS:"/identity-service/user/details",CUSTOM_CHECKOUT:"/identity-service/api/ve1/seller-customer-token/ui/access-token/checkout/data",PAYU_URL:"https://secure.payu.in/_payment",COLLECT_EVENT:"https://events.pickrr.com/collect",FEALTYX_ENDPOINT:"https://sdk.fealtyx.com/fealtyx-checkout.js",FEALTYX_APIKEY:"1FUClRvERr8QBJzOYIzpY7q8MYN2FwsJ",TURNSTILE_SITE_KEY:"0x4AAAAAABjbXHNQBExGBWa3"}},3106:(e,l,i)=>{i.d(l,{Z:()=>S});var n=i(7313),t=i(6352),o=i(5504),a=i(7075),d=i(1608),r=i(7083),s=i(2718),u=i(528),c=i(6417);const v=e=>{var l,i,n,t,o;let{loginstate:a,handleExitFormCheck:d,checkedState:r,otherReason:s,setOtherReason:v,handleExitFormSubmit:m,submitExitFormButtonDisabled:g,isCardDesign:p}=e;return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"exit-form".concat(p?"-card":""),children:[(0,c.jsx)("div",{style:{fontSize:"14px",fontWeight:400,marginBottom:"12px"},children:"What stopped you from completing your purchase?"}),(null==a||null===(l=a.sellerConfig)||void 0===l||null===(i=l.exitResponseDetails)||void 0===i?void 0:i.length)>0&&(null==a||null===(n=a.sellerConfig)||void 0===n||null===(t=n.exitResponseDetails)||void 0===t?void 0:t.map(((e,l)=>{var i,n,t;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{onClick:e=>d(l),className:"exit-form-options",children:[(0,c.jsx)("input",{value:e,type:null!=a&&null!==(i=a.sellerConfig)&&void 0!==i&&i.allowSingleExitReason?"radio":"checkbox",className:"exit-form-select",checked:r[l],style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),(0,c.jsx)("span",{style:{fontSize:"14px"},children:"others"===e?"Others":e})]},l),(null==a||null===(n=a.sellerConfig)||void 0===n?void 0:n.allowSingleExitReason)&&"others"==(null==a||null===(t=a.sellerConfig)||void 0===t?void 0:t.exitResponseDetails[l])&&r[l]&&(0,c.jsx)("textarea",{placeholder:"Others (please specify)",id:"line1",name:"address",value:s,onInput:e=>v(e.target.value),className:"mt-18 full-width exit-other-reason".concat(p?"-card":""),autoComplete:"address-line1",maxLength:255})]})}))),!(null!=a&&null!==(o=a.sellerConfig)&&void 0!==o&&o.allowSingleExitReason)&&(0,c.jsx)("textarea",{placeholder:"Others (please specify)",id:"line1",name:"address",value:s,onInput:e=>v(e.target.value),className:"mt-18 full-width exit-other-reason".concat(p?"-card":""),autoComplete:"address-line1",maxLength:255}),(0,c.jsx)(u.Z,{className:"mt-18 full-width text-center",onClick:m,disabled:g,isCardDesign:p,children:(null==s?void 0:s.length)>0||null!=r&&r.includes(!0)?"Submit and exit":"Skip and exit"})]})})};var m=i(9563),g=i(2569),p=i(804);const h=e=>{var l,i,t,o,u;const{loginstate:h,isCardDesign:y,cartstate:f,isProductPage:_,couponState:C}=e,[x,b]=(0,n.useState)(""),[A,E]=(0,n.useState)(null===(l=new Array(null!==(i=null==h||null===(t=h.sellerConfig)||void 0===t||null===(o=t.exitResponseDetails)||void 0===o?void 0:o.length)&&void 0!==i?i:0))||void 0===l?void 0:l.fill(!1)),[S,D]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{var e,l,i;null!=h&&null!==(e=h.sellerConfig)&&void 0!==e&&e.allowSingleExitReason&&(null!=h&&null!==(l=h.sellerConfig)&&void 0!==l&&l.exitResponseDetails.includes("others")||null==h||null===(i=h.sellerConfig)||void 0===i||i.exitResponseDetails.push("others"),E((e=>(e.push(!1),e))))}),[null==h||null===(u=h.sellerConfig)||void 0===u?void 0:u.allowSingleExitReason]),(0,c.jsx)(v,{...e,handleExitFormCheck:e=>{const l=null==A?void 0:A.map(((l,i)=>{var n;return null!=h&&null!==(n=h.sellerConfig)&&void 0!==n&&n.allowSingleExitReason?i===e:i===e?!l:l}));E(l)},checkedState:A,otherReason:x,setOtherReason:b,handleExitFormSubmit:async()=>{var l,i;D(!0);let n=null==A?void 0:A.map(((e,l)=>{var i,n,t,o;if(e)return{question:null==h||null===(i=h.sellerConfig)||void 0===i||null===(n=i.exitResponseDetails)||void 0===n?void 0:n[l],answer:null==h||null===(t=h.sellerConfig)||void 0===t||null===(o=t.exitResponseDetails)||void 0===o?void 0:o[l]}}));n=null===(l=n)||void 0===l?void 0:l.filter((e=>!(null==e||!e.question||"others"==e.question)&&e)),(null==x?void 0:x.length)>0&&(n=[...n,{question:"others",answer:x}]);const t={cartId:null==f||null===(i=f.Cart_data)||void 0===i?void 0:i.id,reqResponses:n};a.Z.exitCheckout(null==f?void 0:f.orderDetails),"shipping"!==h.onPage||h.user_type_for_text?a.Z.additionalEvents("back-exit-checkout",null==f?void 0:f.Cart_data,C.couponCode,!!d.y.getItem("refreshToken"),!1):a.Z.additionalEvents("yes-exit-checkout",null==f?void 0:f.Cart_data,C.couponCode,!!d.y.getItem("refreshToken"),!1);try{var o,u,c,v;"APPLIED"!==(null===(o=f.loyaltyPointDetails)||void 0===o?void 0:o.status)&&"APPLIED"!==(null===(u=f.giftVoucherDetails)||void 0===u||null===(c=u.EASYREWARD)||void 0===c||null===(v=c.status)||void 0===v?void 0:v.toUpperCase())||await e.removeLoyaltyPoints(),(0,m.Uw)(null==f?void 0:f.orderDetails)&&await e.unblockThirdPartyCoupons(),await r.Z.post(s.Z.EXIT_FORM_SUBMIT(),t,h.sellerConfig.seller_id)&&D(!1),_&&y?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:"https://".concat(h.sellerConfig.domainName)}}]},"*"):((0,g.Ln)(),(0,p.N)("checkout_close",{exitCheckout:!0}),window.parent.postMessage({trigger:"headless-close"},"*"))}catch(e){window.parent.postMessage({trigger:"headless-close"},"*"),D(!1)}},submitExitFormButtonDisabled:S,isCardDesign:y})};var y=i(5381),f=i(1805);i(1318);const _=e=>{var l,i,n,t,r;let{phoneNumberRef:s,setActiveButton:u,activeButton:v,cartstate:m,couponState:g,loginstate:p,otpstate:_,isHeadless:C,fetchingDetails:x,applicationType:b,SetIsOpen:A,isOpen:E,backgroundColor:S,openModalHandler:D,shopName:w,exitCheckoutHandler:N,tryAnotherPaymentMethod:I,isProductPage:k,showExitForm:T,setShowExitForm:P,removeLoyaltyPoints:j,showLoader:F,showExitLoader:R,setShowExitLoader:L,unblockThirdPartyCoupons:O,notifyParentAboutExit:M,showBackButton:U}=e;return(0,c.jsxs)("header",{className:"align-v-center d-flex",style:{position:"relative",paddingBottom:"8px"},children:[(0,c.jsx)(o.Z,{open:E,title:T?"Sorry to see you go..":"Are you sure you want to exit?",showNewModal:!0,onClose:()=>{A(!1),P(!1),L(!1),u(!1),M(!1),m.fireSetuRequest=!0,"shipping"!==p.onPage||p.user_type_for_text?a.Z.additionalEvents("back-drawer-closed",null==m?void 0:m.Cart_data,g.couponCode,!!d.y.getItem("refreshToken"),!1):a.Z.additionalEvents("exit-drawer-closed",null==m?void 0:m.Cart_data,g.couponCode,!!d.y.getItem("refreshToken"),!1)},showClose:!0,showAnotherMobile:!0,size:"sm",showBanner:!0,children:T?(0,c.jsx)(h,{loginstate:p,cartstate:m,couponState:g,isProductPage:k,isCardDesign:!0,removeLoyaltyPoints:j,unblockThirdPartyCoupons:O}):(0,c.jsxs)(c.Fragment,{children:[(!C&&"appmaker"!==b||f.v8.includes(null==p||null===(l=p.sellerConfig)||void 0===l?void 0:l.domainName))&&(0,c.jsx)("button",{disabled:R,className:"".concat(v?"modal_button_blue":"modal_button_white"," full-width"),onClick:N,onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},children:"Yes, exit checkout"}),(0,c.jsx)("button",{className:m.cardDesignEnabled?"".concat(v?"modal_button_white":"modal_button_blue"," full-width mt-16"):"modal_button modal_button_bg full-width relative mt-20",onMouseEnter:()=>{u(!1)},onClick:()=>{A(!1),M(!1),a.Z.additionalEvents("no-continue-checkout",null==m?void 0:m.Cart_data,g.couponCode,!!d.y.getItem("refreshToken"),!1)},children:"No, continue checkout"})]})}),m.orderPending&&"UPI"!==m.activePaymentMode||C&&!_.verified||m.orderPending&&C||m.resumeCartFailed||!0===m.outofstock||x||m.isPaymentSuccess&&(m.verifyingPayment||m.paymentProcessing)?(0,c.jsx)(c.Fragment,{}):"shipping"!==p.onPage||p.user_type_for_text?m.isPaymentSuccess||!m.verifyingPayment&&!m.paymentProcessing?U?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",position:"absolute",border:"none"},onClick:()=>{D(),a.Z.additionalEvents("back-button-clicked",null==m?void 0:m.Cart_data,g.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,c.jsx)(y.xE,{color:"var(--header-icon-color)"})}):(0,c.jsx)(c.Fragment,{}):(0,c.jsx)("div",{style:{backgroundColor:S||"white",display:"flex",alignItems:"center",cursor:"pointer",position:"absolute"},onClick:()=>{I()},children:(0,c.jsx)(y.xE,{color:"var(--header-icon-color)"})}):(0,c.jsx)(c.Fragment,{children:U&&(null!=m&&m.cardDesignEnabled?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",position:"absolute"},onClick:()=>{D(),a.Z.additionalEvents("close-button-clicked",null==m?void 0:m.Cart_data,g.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,c.jsx)(y.xE,{color:"var(--header-icon-color)"})}):(0,c.jsx)("div",{className:"back",style:{color:S&&"white"},onClick:()=>{D(),a.Z.additionalEvents("close-button-clicked",null==m?void 0:m.Cart_data,g.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,c.jsx)("span",{className:"cross-icon",children:"✕"})}))}),null!=p&&null!==(i=p.sellerConfig)&&void 0!==i&&i.logUrl?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"var(--logo-alignment)",width:"100%",marginLeft:"var(--logo-margin)"},children:(0,c.jsx)("img",{className:"logoCard",src:null==p||null===(n=p.sellerConfig)||void 0===n?void 0:n.logUrl,alt:w,onClick:()=>{var e,l;k?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null!=m&&m.productPageRedirectionUrl?null==m?void 0:m.productPageRedirectionUrl:"https://".concat(null==p||null===(e=p.sellerConfig)||void 0===e?void 0:e.domainName)}}]},"*"):null==s||null===(l=s.current)||void 0===l||l.focus()},style:{cursor:k?"pointer":"default"}})}):(0,c.jsx)(c.Fragment,{}),(null===(t=p.sellerConfig)||void 0===t||null===(r=t.festiveThemeConfig)||void 0===r?void 0:r.enabled)&&(0,c.jsx)("img",{className:"header_old_holigif",alt:"independence Day",onClick:()=>{var e;null==s||null===(e=s.current)||void 0===e||e.focus()},src:"./assets/images/independenceDay.gif"})]})},C=(0,n.memo)(_),x=e=>{var l,i,n,t,r,s,u,v,m,g,p,_;let{phoneNumberRef:C,setActiveButton:x,activeButton:b,changeNumber:A,showLoader:E,cartstate:S,couponState:D,loginstate:w,addressstate:N,isHeadless:I,otpstate:k,fetchingDetails:T,applicationType:P,SetIsOpen:j,isOpen:F,backgroundColor:R,openModalHandler:L,shopName:O,exitCheckoutHandler:M,tryAnotherPaymentMethod:U,showExitForm:Z,setShowExitForm:B,removeLoyaltyPoints:H,showExitLoader:V,setShowExitLoader:G,unblockThirdPartyCoupons:W,notifyParentAboutExit:q,showBackButton:z}=e;return(0,c.jsxs)("header",{className:"align-v-center container d-flex flex-center",style:{paddingBottom:"www.soni.fashion"===(null===(l=w.sellerConfig)||void 0===l?void 0:l.domainName)?0:"10px",justifyContent:"var(--logo-alignment)"},children:[(0,c.jsx)(o.Z,{open:F,title:Z?"Sorry to see you go..":w.user_type_for_text||"shipping"!==w.onPage?"Leaving so soon!":"Are you sure you want to exit?",onClose:()=>{j(!1),B(!1),G(!1),x(!1),q(!1),S.fireSetuRequest=!0,"shipping"!==w.onPage||w.user_type_for_text?a.Z.additionalEvents("back-drawer-closed",null==S?void 0:S.Cart_data,D.couponCode,!!d.y.getItem("refreshToken"),!1):a.Z.additionalEvents("exit-drawer-closed",null==S?void 0:S.Cart_data,D.couponCode,!!d.y.getItem("refreshToken"),!1)},showBanner:!0,showClose:!0,showAnotherMobile:!0,children:Z?(0,c.jsx)(h,{loginstate:w,cartstate:S,couponState:D,isCardDesign:!1,removeLoyaltyPoints:H,unblockThirdPartyCoupons:W}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{style:{fontWeight:"400",fontSize:"14px",lineHeight:"18px",letterSpacing:"0.32px"},children:(0,c.jsx)("span",{style:{color:"#767373",paddingLeft:"5px"},children:"Are you sure you want to exit?"})}),(!I&&"appmaker"!==P||f.v8.includes(null==w||null===(i=w.sellerConfig)||void 0===i?void 0:i.domainName))&&(0,c.jsx)("button",{disabled:V,className:"modal_button full-width text-center",onClick:M,onMouseOver:()=>x(!0),onMouseLeave:()=>x(!1),style:{marginTop:"shipping"!==w.onPage||w.user_type_for_text?"20px":""},children:"shipping"!==w.onPage||w.user_type_for_text?"Exit checkout":"Yes, exit checkout"}),(0,c.jsx)("button",{className:"modal_button_oldDesign full-width mt-16",onClick:()=>{j(!1),q(!1),a.Z.additionalEvents("no-continue-checkout",null==S?void 0:S.Cart_data,D.couponCode,!!d.y.getItem("refreshToken"),!1)},onMouseOver:()=>x(!0),onMouseLeave:()=>x(!1),children:"shipping"!==w.onPage||w.user_type_for_text?"Continue checkout":"No, continue checkout"})]})}),S.orderPending&&"UPI"!==S.activePaymentMode||I&&!k.verified||S.orderPending&&I||S.resumeCartFailed||!0===S.outofstock||T||S.isPaymentSuccess&&(S.verifyingPayment||S.paymentProcessing)?(0,c.jsx)(c.Fragment,{}):"shipping"!==w.onPage||w.user_type_for_text?S.isPaymentSuccess||!S.verifyingPayment&&!S.paymentProcessing?z?(0,c.jsx)("div",{className:"back",style:{backgroundColor:"www.soni.fashion"===(null==w||null===(s=w.sellerConfig)||void 0===s?void 0:s.domainName)?"#333333":"transparent",border:"none",borderRadius:"www.soni.fashion"===(null==w||null===(u=w.sellerConfig)||void 0===u?void 0:u.domainName)?"6px":"",padding:"www.soni.fashion"===(null==w||null===(v=w.sellerConfig)||void 0===v?void 0:v.domainName)?"5px 7px":""},onClick:()=>{L(),a.Z.additionalEvents("back-button-clicked",null==S?void 0:S.Cart_data,D.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,c.jsx)("div",{style:{transform:"scaleX(-1)"},children:(0,c.jsx)(y.Ii,{color:"var(--header-icon-color)"})})}):(0,c.jsx)(c.Fragment,{}):(0,c.jsx)("div",{className:"back",style:{backgroundColor:"www.soni.fashion"===(null==w||null===(n=w.sellerConfig)||void 0===n?void 0:n.domainName)?"#333333":"transparent",border:"none",borderRadius:"www.soni.fashion"===(null==w||null===(t=w.sellerConfig)||void 0===t?void 0:t.domainName)?"6px":"",padding:"www.soni.fashion"===(null==w||null===(r=w.sellerConfig)||void 0===r?void 0:r.domainName)?"5px 7px":""},onClick:()=>{U()},children:(0,c.jsx)("div",{style:{transform:"scaleX(-1)"},children:(0,c.jsx)(y.Ii,{color:"var(--header-icon-color)"})})}):(0,c.jsx)(c.Fragment,{children:z&&(0,c.jsx)("div",{className:"back",onClick:()=>{L(),a.Z.additionalEvents("close-button-clicked",null==S?void 0:S.Cart_data,D.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,c.jsx)("span",{className:"cross-icon",children:"✕"})})}),null!=w&&null!==(m=w.sellerConfig)&&void 0!==m&&m.logUrl?(0,c.jsx)("div",{onClick:()=>{var e;return null==C||null===(e=C.current)||void 0===e?void 0:e.focus()},children:(0,c.jsx)("img",{className:"logo",src:null==w||null===(g=w.sellerConfig)||void 0===g?void 0:g.logUrl,alt:O,style:{width:"auto",maxHeight:"www.soni.fashion"===w.sellerConfig.domainName?"100%":"30px",minHeight:"www.soni.fashion"===w.sellerConfig.domainName?"100%":"30px",marginLeft:"var(--logo-margin)"}})}):(0,c.jsx)(c.Fragment,{}),(null==w||null===(p=w.sellerConfig)||void 0===p||null===(_=p.festiveThemeConfig)||void 0===_?void 0:_.enabled)&&(0,c.jsx)("img",{className:"header_old_holigif",alt:"Independence Day",onClick:()=>{var e;null==C||null===(e=C.current)||void 0===e||e.focus()},src:"./assets/images/independenceDay.gif"})]})},b=(0,n.memo)(x);var A=i(2183),E=i(9094);const S=e=>{const{cardDesignEnabled:l,onRender:i,onRenderLoading:o,isHeadless:r,fetchingDetails:s,applicationType:u,showBackButton:v}=e,[h,y]=(0,n.useState)(""),[f,_]=(0,n.useState)(""),[x,S]=(0,n.useState)(!1),[D,w]=(0,n.useState)(!1),N=(0,t.v9)((e=>e.Login)),I=(0,t.v9)((e=>e.Cart)),k=(0,t.v9)((e=>e.Coupon)),T=(0,t.v9)((e=>e.Otp)),P=(0,t.v9)((e=>e.Address)),[j,F]=(0,n.useState)(!1),R=e=>{I.isOpen=e,o()},L=e=>{I.showExitForm=e,o()};(0,n.useEffect)((()=>{var e,l,i,n,t,o,a;y(null==N||null===(e=N.channel)||void 0===e?void 0:e.shop_name),(null==N||null===(l=N.sellerConfig)||void 0===l||null===(i=l.uiConfig)||void 0===i||null===(n=i.header)||void 0===n?void 0:n.background_color)&&_(null==N||null===(t=N.sellerConfig)||void 0===t||null===(o=t.uiConfig)||void 0===o||null===(a=o.header)||void 0===a?void 0:a.background_color)}),[N]),(0,n.useEffect)((()=>{var e,l,i,n,t,o;(null==N||null===(e=N.sellerConfig)||void 0===e||null===(l=e.uiConfig)||void 0===l||null===(i=l.header)||void 0===i?void 0:i.background_color)&&_(null==N||null===(n=N.sellerConfig)||void 0===n||null===(t=n.uiConfig)||void 0===t||null===(o=t.header)||void 0===o?void 0:o.background_color)}),[N]);const O=window.location.search,M=e=>{window.parent.postMessage({trigger:"shiprocket-checkout-listener",actions:[{action:"notifyParentAboutExit",data:{type:e}}]},"*")};window.addEventListener("message",(e=>{"openExitPopup"===e.data.trigger&&U()}));const U=()=>{e.fomoCoupon&&!I.fomoCalled?e.setShowFomoCoupon(!0):(R(!0),M(!0))};new URLSearchParams(O);const Z=async()=>{var i,n,t,o,r;(0,g.Ln)();try{(0,p.N)("checkout_close",{exitCheckout:!0})}catch(e){console.log(e)}w(!0),null!=N&&null!==(i=N.sellerConfig)&&void 0!==i&&i.exitFormEnabled?L(!0):(a.Z.exitCheckout(I.orderDetails),"shipping"!==N.onPage||N.user_type_for_text?a.Z.additionalEvents("back-exit-checkout",null==I?void 0:I.Cart_data,k.couponCode,!!d.y.getItem("refreshToken"),!1):a.Z.additionalEvents("yes-exit-checkout",null==I?void 0:I.Cart_data,k.couponCode,!!d.y.getItem("refreshToken"),!1),N.isProductPage&&l?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:"https://".concat(N.sellerConfig.domainName)}}]},"*"):("APPLIED"!==(null===(n=I.loyaltyPointDetails)||void 0===n?void 0:n.status)&&"APPLIED"!==(null===(t=I.giftVoucherDetails)||void 0===t||null===(o=t.EASYREWARD)||void 0===o||null===(r=o.status)||void 0===r?void 0:r.toUpperCase())||await e.removeLoyaltyPoints(),(0,m.Uw)(null==I?void 0:I.orderDetails)&&await e.unblockThirdPartyCoupons(),window.parent.postMessage({trigger:"headless-close"},"*")))},B=()=>{I.upiIdEntryDrawer=!1,I.paymentProcessing=!1,N.paymentPageReached=!0,I.verifyingPayment=!1,I.paymentMethodsFetched=!1,clearInterval(null==N?void 0:N.upiIntervalID),clearInterval(null==N?void 0:N.razorpayIntervalID),clearInterval(null==N?void 0:N.optionalPaymentIntervalId),clearInterval(I.snapmintIntervalId),i(),o()};return l?(0,c.jsx)(C,{phoneNumberRef:e.phoneNumberRef,cartstate:I,couponState:k,loginstate:N,otpstate:T,SetIsOpen:R,isOpen:I.isOpen,backgroundColor:f,openModalHandler:U,shopName:h,exitCheckoutHandler:Z,tryAnotherPaymentMethod:B,isProductPage:N.isProductPage,setShowExitForm:L,showExitForm:I.showExitForm,isHeadless:r,fetchingDetails:s,applicationType:u,setActiveButton:F,activeButton:j,removeLoyaltyPoints:e.removeLoyaltyPoints,showLoader:x,showExitLoader:D,setShowExitLoader:w,unblockThirdPartyCoupons:e.unblockThirdPartyCoupons,notifyParentAboutExit:M,showBackButton:v}):(0,c.jsx)(b,{phoneNumberRef:e.phoneNumberRef,cartstate:I,couponState:k,loginstate:N,addressstate:P,otpstate:T,SetIsOpen:R,isOpen:I.isOpen,backgroundColor:f,openModalHandler:U,shopName:h,exitCheckoutHandler:Z,tryAnotherPaymentMethod:B,setShowExitForm:L,showExitForm:I.showExitForm,showLoader:x,changeNumber:async()=>{var l,i,n,t,o,r,s,u,c;S(!0),"APPLIED"!==(null===(l=I.loyaltyPointDetails)||void 0===l?void 0:l.status)&&"APPLIED"!==(null===(i=I.giftVoucherDetails)||void 0===i||null===(n=i.EASYREWARD)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.toUpperCase())||await e.removeLoyaltyPoints(),(0,m.Uw)(null==I?void 0:I.orderDetails)&&await e.unblockThirdPartyCoupons(),await(0,A.kf)({name:"CHANGE_NUMBER",domain:null===(o=N.sellerConfig)||void 0===o?void 0:o.domainName,payload:{cart_id:null==I||null===(r=I.Cart_data)||void 0===r?void 0:r.id,otpLess:null==N||null===(s=N.sellerConfig)||void 0===s?void 0:s.enabledFeatureCodForm}}),a.Z.changeNumber(),a.Z.additionalEvents("back-change-number",null==I?void 0:I.Cart_data,k.couponCode,!!d.y.getItem("refreshToken"),!1),null!==(u=N.sellerConfig)&&void 0!==u&&u.disableLogout&&(0,m.$U)()?(E.Z.setItem("logout_temp",!0),null===(c=localStorage)||void 0===c||c.setItem("logout_temp","true"),window.location.reload()):(d.y.removeItem("refreshToken"),d.y.removeItem("refreshTokenValue"),d.y.removeItem("user_id"),d.y.removeItem("seller_id"),d.y.removeItem("pim_sid"),d.y.removeItem("expireTime"),window.location.reload())},isHeadless:r,fetchingDetails:s,applicationType:u,setActiveButton:F,activeButton:j,removeLoyaltyPoints:e.removeLoyaltyPoints,showExitLoader:D,setShowExitLoader:w,unblockThirdPartyCoupons:e.unblockThirdPartyCoupons,notifyParentAboutExit:M,showBackButton:v})}},6280:(e,l,i)=>{i.d(l,{RQ:()=>a,uz:()=>d,wg:()=>r,Q8:()=>s,y3:()=>u}),i(4835);var n=i(2718),t=(i(1881),i(7083)),o=i(2199);const a=e=>async l=>{l({type:"New_User_Address_REQUEST"});try{const i=await t.Z.post(n.Z.ADD_NEW_USER_ADDRESS(),e);i.data.status&&l({type:"New_User_Address_SUCCESS",payload:i.data.data})}catch(t){var i,a,d;l({type:"New_User_Address_FAILURE",payload:null==t||null===(i=t.response)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.error}),"number"==typeof(null==t||null===(d=t.response)||void 0===d?void 0:d.status)&&o.$e((l=>{var i,a;l.setExtras({request_headers:null==t||null===(i=t.config)||void 0===i?void 0:i.headers,error:null==t?void 0:t.toJSON(),request_body:e,response_body:JSON.stringify(null==t||null===(a=t.response)||void 0===a?void 0:a.data)}),o.uT("New_User_Address_FAILURE-".concat(n.Z.ADD_NEW_USER_ADDRESS()))}))}},d=(e,l,i,a,d)=>async r=>{r({type:"FETCH_All_Address_REQUEST"});try{const o=await t.Z.getAddressWithHeaders(n.Z.GET_ADDRESS_LIST(e,d),l,i,a);if(o.data.status){var s;let e=[];var u,c;"6333fb454f354c57324887c0"===a&&(e=null==o||null===(u=o.data)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.filter((e=>{var l;return(null==e||null===(l=e.line1)||void 0===l?void 0:l.length)>3}))),r({type:"FETCH_All_Address_SUCCESS",payload:"6333fb454f354c57324887c0"!==a?null==o||null===(s=o.data)||void 0===s?void 0:s.data:e})}}catch(l){var v;r({type:"FETCH_All_Address_FAILURE",payload:l}),"number"==typeof(null==l||null===(v=l.response)||void 0===v?void 0:v.status)&&o.$e((i=>{var t,a;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,response_body:JSON.stringify(null==l||null===(a=l.response)||void 0===a?void 0:a.data),error:null==l?void 0:l.toJSON()}),o.uT("Fetch-all-address-failure-".concat(n.Z.GET_ADDRESS_LIST(e)))}))}},r=(e,l,i,a,d,r)=>async s=>{s({type:"FETCH_Address_REQUEST"});try{const o=await t.Z.getAddressWithHeaders(n.Z.GET_ADDRESS_LIST_CACHE(e,d),l,i,a);if(o.data.status){var u,c,v,m,g,p,h,y,f;let e=[],l=null==o||null===(u=o.data)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.filter((e=>!0!==(null==e?void 0:e.doubtfulAddress))),i=(null===(v=l)||void 0===v?void 0:v.length)>0?l[0]:null==o||null===(m=o.data)||void 0===m?void 0:m.data[0],n=!((null===(g=l)||void 0===g?void 0:g.length)>0)&&(null==o||null===(p=o.data)||void 0===p||null===(h=p.data)||void 0===h?void 0:h.length)>0;var _,C,x,b,A,E;"6333fb454f354c57324887c0"===a&&(e=null==o||null===(_=o.data)||void 0===_||null===(C=_.data)||void 0===C?void 0:C.filter((e=>{var l;return(null==e||null===(l=e.line1)||void 0===l?void 0:l.length)>3})),l=null===(x=e)||void 0===x?void 0:x.filter((e=>!0!==(null==e?void 0:e.doubtfulAddress))),i=(null===(b=l)||void 0===b?void 0:b.length)>0?l[0]:e[0],n=!((null===(A=l)||void 0===A?void 0:A.length)>0)&&(null===(E=e)||void 0===E?void 0:E.length)>0),s({type:"FETCH_Address_SUCCESS",payload:"6333fb454f354c57324887c0"!==a?null==o||null===(y=o.data)||void 0===y?void 0:y.data:e,cachedAddresses:!0,selectedAddress:i,faultyAddress:r&&!(null==o||null===(f=o.data)||void 0===f||!f.fetchGender)||n})}}catch(l){var S;s({type:"FETCH_Address_FAILURE",payload:l}),"number"==typeof(null==l||null===(S=l.response)||void 0===S?void 0:S.status)&&o.$e((i=>{var t,a;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,response_body:JSON.stringify(null==l||null===(a=l.response)||void 0===a?void 0:a.data),error:null==l?void 0:l.toJSON()}),o.uT("Cache-Address-Fail-".concat(n.Z.GET_ADDRESS_LIST_CACHE(e)))}))}},s=(e,l,i,a,d)=>async r=>{r({type:"ADD_Existing_User_Address_REQUEST"}),await t.Z.post(n.Z.ADD_EXISTING_USER_ADDRESS(l),e,a).then((e=>{e.data.status&&(r({type:"ADD_Existing_User_Address_SUCCESS",payload:{fetchAddressPermission:i,addedAddress:e.data.data}}),i&&r(((e,l,i,a,d,r)=>async i=>{i({type:"FETCH_Address_REQUEST"});try{var s,u;const g=await t.Z.getAddressWithHeaders(n.Z.GET_ADDRESS_LIST(e,r),l,true,a);if(g.data.status){var c;let e=[];var v,m;"6333fb454f354c57324887c0"===a&&(e=null==g||null===(v=g.data)||void 0===v||null===(m=v.data)||void 0===m?void 0:m.filter((e=>{var l;return(null==e||null===(l=e.line1)||void 0===l?void 0:l.length)>3}))),i({type:"FETCH_Address_SUCCESS_After_Add_New",payload:{addedAddress:d,data:"6333fb454f354c57324887c0"!==a?null==g||null===(c=g.data)||void 0===c?void 0:c.data:e}})}0===(null==g||null===(s=g.data)||void 0===s||null===(u=s.data)||void 0===u?void 0:u.length)&&o.$e((e=>{e.setExtras({response:JSON.stringify(g),added_address:d}),o.uT("Add-Returned-Zero")}))}catch(l){var g;i({type:"FETCH_Address_FAILURE",payload:l}),"number"==typeof(null==l||null===(g=l.response)||void 0===g?void 0:g.status)&&o.$e((i=>{var t,a;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,response_body:JSON.stringify(null==l||null===(a=l.response)||void 0===a?void 0:a.data),error:null==l?void 0:l.toJSON()}),o.uT("Fetch-all-address-failure-".concat(n.Z.GET_ADDRESS_LIST(e)))}))}})(l,i,0,a,e.data.data,d)))})).catch((i=>{var t,a,d;r({type:"ADD_Existing_User_Address_FAILURE",payload:null==i||null===(t=i.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.error}),document.getElementById("addAddressBtn").removeAttribute("disabled"),document.getElementById("addAddressBtn").innerHTML="Add address","number"==typeof(null==i||null===(d=i.response)||void 0===d?void 0:d.status)&&o.$e((t=>{var a,d;t.setExtras({request_headers:null==i||null===(a=i.config)||void 0===a?void 0:a.headers,error:null==i?void 0:i.toJSON(),request_body:e,response_body:JSON.stringify(null==i||null===(d=i.response)||void 0===d?void 0:d.data)}),o.uT("Add-existing-user-address-failure-".concat(n.Z.ADD_EXISTING_USER_ADDRESS(l)))}))}))},u=(e,l,i,a)=>async d=>{d({type:"Update_Address_REQUEST"});try{const o=await t.Z.put(n.Z.ADD_EXISTING_USER_ADDRESS(l,a),e,i);o&&d({type:"Update_Address_SUCCESS",payload:o.data.data})}catch(i){var r,s,u;d({type:"Update_Address_FAILURE",payload:null==i||null===(r=i.response)||void 0===r||null===(s=r.data)||void 0===s?void 0:s.error}),"number"==typeof(null==i||null===(u=i.response)||void 0===u?void 0:u.status)&&o.$e((t=>{var a,d;t.setExtras({request_headers:null==i||null===(a=i.config)||void 0===a?void 0:a.headers,error:null==i?void 0:i.toJSON(),request_body:e,response_body:JSON.stringify(null==i||null===(d=i.response)||void 0===d?void 0:d.data)}),o.uT("Update-Address-Failure-".concat(n.Z.ADD_EXISTING_USER_ADDRESS(l)))}))}}},1902:(e,l,i)=>{i.d(l,{LV:()=>a,Cs:()=>d,uM:()=>r,M8:()=>s,U9:()=>u});var n=i(2718),t=(i(4835),i(1881),i(7083)),o=(i(9094),i(8846),i(1608),i(2199));const a=(e,l,i)=>async l=>{l({type:"CREATE_ORDER_REQUEST"});try{const o=await t.Z.post(n.Z.FETCH_ORDERS(),{...e},i);o&&l({type:"CREATE_ORDER_SUCCESS",payload:o.data})}catch(i){var a;l({type:"CREATE_ORDER_FAILURE",payload:i}),"number"==typeof(null==i||null===(a=i.response)||void 0===a?void 0:a.status)&&o.$e((l=>{var t;l.setExtras({request_headers:null==i?void 0:i.toJSON(),response_body:JSON.stringify(null==i||null===(t=i.response)||void 0===t?void 0:t.data),request_body:e}),o.uT("Order-POST-Failure-".concat(n.Z.FETCH_ORDERS()))}))}},d=(e,l)=>async i=>{i({type:"UPDATE_ORDER_REQUEST"});try{const o=await t.Z.put(n.Z.FETCH_ORDERS(),{...e},l);o&&i({type:"UPDATE_ORDER_SUCCESS",payload:o.data})}catch(l){var a;i({type:"UPDATE_ORDER_FAILURE",payload:l}),"number"==typeof(null==l||null===(a=l.response)||void 0===a?void 0:a.status)&&o.$e((i=>{var t;i.setExtras({request_headers:null==l?void 0:l.toJSON(),request_body:e,response_body:JSON.stringify(null==l||null===(t=l.response)||void 0===t?void 0:t.data)}),o.uT("Order-PUT-Failure-".concat(n.Z.FETCH_ORDERS()))}))}},r=(e,l,i,a)=>async d=>{d({type:"GST_APPLY_REQUESTED",payload:{}});try{const o=await t.Z.put("".concat(n.Z.CREATE_CART_DETAILS(),"/").concat(l),e,a);o&&(d({type:"GST_APPLY_SUCCESS",payload:null==o?void 0:o.data}),console.log("it is working or not"),i())}catch(i){var r;d({type:"GST_APPLY_FAILURE",payload:i}),"number"==typeof(null==i||null===(r=i.response)||void 0===r?void 0:r.status)&&o.$e((t=>{var a,d;t.setExtras({request_headers:null==i||null===(a=i.config)||void 0===a?void 0:a.headers,response_body:JSON.stringify(null==i||null===(d=i.response)||void 0===d?void 0:d.data),error:null==i?void 0:i.toJSON(),request_body:e}),o.uT("Coupon-Apply-Failure-".concat(n.Z.CREATE_CART_DETAILS(),"/").concat(l))}))}},s=e=>async l=>{try{l({type:"UPDATE_PAYMENT_CONFIG_REQUEST"});const i=await t.Z.post(n.Z.GET_PAYMENT_METHODS(null==e?void 0:e.sellerId),null==e?void 0:e.payload);null!=i&&i.data?l({type:"UPDATE_PAYMENT_CONFIG_SUCCESS",payload:null==i?void 0:i.data}):l({type:"UPDATE_PAYMENT_CONFIG_FAILURE"})}catch(e){l({type:"UPDATE_PAYMENT_CONFIG_FAILURE"})}},u=e=>async l=>{try{const i=await t.Z.getWithHeaders(n.Z.GET_UPSELL_ITEMS(),null==e?void 0:e.sellerId,null==e?void 0:e.headers);null!=i&&i.data?l({type:"GET_UPSELL_DATA_SUCCESS",payload:null==i?void 0:i.data}):l({type:"GET_UPSELL_DATA_FAILURE"})}catch(e){l({type:"GET_UPSELL_DATA_FAILURE"})}}},8595:(e,l,i)=>{i.d(l,{t:()=>r,y:()=>s});var n=i(2718),t=(i(4835),i(1881),i(7083)),o=i(2199),a=i(5637),d=i(1902);const r=function(e,l,i,r,s,u,c,v,m,g,p,h,y,f,_,C,x,b){let A=arguments.length>18&&void 0!==arguments[18]&&arguments[18];return async i=>{i({type:"COUPON_APPLY_REQUESTED",payload:{}});try{const o=await t.Z.put("".concat(n.Z.CREATE_CART_DETAILS(),"/").concat(r),e,c);if(o){var _,E,S,D,w,N,I,k,T;if(null!=o&&null!==(_=o.data)&&void 0!==_&&null!==(E=_.couponData)&&void 0!==E&&null!==(S=E.custom_attributes)&&void 0!==S&&null!==(D=S.fomo)&&void 0!==D&&D.discount_id&&(o.toggleConfetti=A),null!=e&&e.couponCode){var P,j,F;const l={couponCode:null==e?void 0:e.couponCode,errorMessage:(null==o||null===(P=o.data)||void 0===P||null===(j=P.discountDetail)||void 0===j||null===(F=j.validation_error_msgs)||void 0===F?void 0:F[0])||""};o.manuallyAddedCouponError=l}else o.manuallyAddedCouponError=null;i({type:"COUPON_APPLY_SUCCESS",payload:o}),(m||C)&&g&&null!=v&&v.address&&p&&(!y||y&&h||y&&f)&&(u||(null==o||null===(w=o.data)||void 0===w?void 0:w.totalDiscount)>0)&&await i((0,a.i)(v,l,c)),b&&x&&(u||o.data.totalDiscount>0)&&p&&(!y||y&&h||y&&f)&&await i((0,d.M8)({sellerId:c,payload:{check_payment_eligibility_request:{...null==x?void 0:x.check_payment_eligibility_request,amount:null!=o&&null!==(N=o.data)&&void 0!==N&&N.totalDiscount?(null===(I=o.data)||void 0===I?void 0:I.totalPrice)-(null==o||null===(k=o.data)||void 0===k?void 0:k.totalDiscount):null===(T=o.data)||void 0===T?void 0:T.totalPrice}}})),(u&&p&&(!y||y&&h||y&&f)||o.data.totalDiscount>0&&p&&(!y||y&&h||y&&f))&&s()}}catch(l){var R;i({type:"COUPON_APPLY_FAILURE",payload:l}),"number"==typeof(null==l||null===(R=l.response)||void 0===R?void 0:R.status)&&o.$e((i=>{var t,a;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,response_body:JSON.stringify(null==l||null===(a=l.response)||void 0===a?void 0:a.data),error:null==l?void 0:l.toJSON(),request_body:e}),o.uT("Coupon-Apply-Failure-".concat(n.Z.CREATE_CART_DETAILS(),"/").concat(r))}))}}},s=e=>async l=>{l({type:"SUGGESTION_COUPON_APPLY_REQUEST"});try{const i=await t.Z.get("".concat(n.Z.COUPON_SUGGESTION(),"?id=").concat(e,"&version=",1),e);i&&l({type:"SUGGESTION_COUPON_APPLY_SUCCESS",payload:i})}catch(t){var i;l({type:"SUGGESTION_COUPON_APPLY_ERROR",payload:t}),"number"==typeof(null==t||null===(i=t.response)||void 0===i?void 0:i.status)&&o.$e((l=>{var i,a;l.setExtras({request_headers:null==t||null===(i=t.config)||void 0===i?void 0:i.headers,response_body:JSON.stringify(null==t||null===(a=t.response)||void 0===a?void 0:a.data),error:null==t?void 0:t.toJSON()}),o.uT("get-all-coupons-failure-".concat(n.Z.COUPON_SUGGESTION(),"?id=").concat(e))}))}}},3826:(e,l,i)=>{i.d(l,{J:()=>o});var n=i(4835),t=i(2718);const o=e=>async l=>{l({type:"FETCH_Pincode_REQUEST"}),await n.Z.getWithParams(t.Z.GET_PINCODE(),e).then((e=>{l({type:"FETCH_Pincode_SUCCESS",payload:e.data})})).catch((e=>{l({type:"FETCH_Pincode_FAILURE",payload:e})}))}},4293:(e,l,i)=>{i.d(l,{Lt:()=>v,$0:()=>m,n4:()=>g,bl:()=>p,r3:()=>h,WX:()=>y,UA:()=>f,gJ:()=>_}),i(4835);var n=i(2718),t=i(1881),o=i.n(t),a=i(7083),d=i(9094),r=i(1608),s=i(2199),u=i(9563);const c=e=>{try{s.$e((l=>{l.setExtras({status:null==e?void 0:e.code}),s.uT("".concat(e.apiName,"::429"))}))}catch(e){}},v=()=>async e=>{e({type:"Create_Guest_User_REQUESTED"});try{const i=await o().get(n.Z.CREATE_GUEST_USER());if(i.data.ok){var l;const n={...null==i||null===(l=i.data)||void 0===l?void 0:l.result,pim_sid:null==i?void 0:i.headers["pim-sid"]};r.y.setItem("pim_sid",null==i?void 0:i.headers["pim-sid"]),r.y.setItem("expireTime",null==i?void 0:i.headers["expires-at"]),e({type:"Create_Guest_User_SUCCESS",payload:n})}}catch(l){var i;e({type:"Create_Guest_User_FAILURE",payload:l}),e({type:"FETCH_Config_FAILURE",payload:l}),"number"==typeof(null==l||null===(i=l.response)||void 0===i?void 0:i.status)&&s.$e((e=>{var i,t;e.setExtras({request_headers:null==l||null===(i=l.config)||void 0===i?void 0:i.headers,error:null==l?void 0:l.toJSON(),response_body:JSON.stringify(null==l||null===(t=l.response)||void 0===t?void 0:t.data)}),s.uT("Create-Guest-Failure-".concat(n.Z.CREATE_GUEST_USER()))}))}},m=(e,l,i)=>async t=>{try{i&&t({type:"FETCH_SHOPIFY_CRED_REQUEST"});const o=await a.Z.put(n.Z.FETCH_SHOPIFY_CREDENTIALS(),e,l);200===(null==o?void 0:o.status)&&i&&t({type:"FETCH_SHOPIFY_CRED_SUCCESS",payload:o.data})}catch(e){console.log("error"),i&&t({type:"FETCH_SHOPIFY_CRED_FAILURE",payload:e})}},g=(e,l)=>async i=>{try{i({type:"CREATE_SHOPIFY_CRED_REQUEST"});const t=await a.Z.put(n.Z.FETCH_SHOPIFY_CREDENTIALS(),e,l);200===(null==t?void 0:t.status)&&i({type:"CREATE_SHOPIFY_CRED_SUCCESS",payload:t.data})}catch(e){var t;422===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)?i({type:"CREATE_SHOPIFY_CRED_EMAIL_ERROR",payload:e}):i({type:"CREATE_SHOPIFY_CRED_FAILURE",payload:e})}},p=(e,l,i)=>async t=>{t({type:"FETCH_Login_REQUEST"});try{const s=await a.Z.post(n.Z.LOGIN_CHECK(),e,l);if(s.data.status){var o,d,r,u;let l={...s.data.data,user_type:"otpLess"===(null==e?void 0:e.login_type)?"otpLess":"known",loginThrough:"otpLess"===(null==e?void 0:e.login_type)?"otpLess":"known"};i&&(l={...l,otpSkip:"new"===(null==s||null===(o=s.data)||void 0===o||null===(d=o.data)||void 0===d?void 0:d.user_type)}),t({type:"FETCH_Login_SUCCESS",payload:l}),"new"===(null==s||null===(r=s.data)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.user_type)&&i&&t({type:"SKIP_OTP_SUCCESS"})}}catch(l){var c,v,m,g,p;if(412===(null==l||null===(c=l.response)||void 0===c?void 0:c.status))return void(null===(g=window)||void 0===g||null===(p=g.location)||void 0===p||p.reload());null===(v=document.getElementById("mobile"))||void 0===v||v.removeAttribute("disabled"),t({type:"FETCH_Login_FAILURE",payload:l}),"number"==typeof(null==l||null===(m=l.response)||void 0===m?void 0:m.status)&&s.$e((i=>{var t,o,a;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,request_body:e,response_body:JSON.stringify(null==l||null===(o=l.response)||void 0===o?void 0:o.data),error:null==l?void 0:l.toJSON(),status:null==l||null===(a=l.response)||void 0===a?void 0:a.status}),s.uT("Login-Failure-".concat(n.Z.LOGIN_CHECK()))}))}},h=(e,l)=>async i=>{i({type:"FETCH_User_Details_REQUEST"});try{const t=await a.Z.get(n.Z.FETCH_USER_DETAILS(e,l),e);t.data.ok&&i({type:"FETCH_User_Details_SUCCESS",payload:t.data.result.user_data})}catch(o){var t;i({type:"FETCH_User_Details_FAILURE",payload:o}),"number"==typeof(null==o||null===(t=o.response)||void 0===t?void 0:t.status)&&s.$e((i=>{var t,a;i.setExtras({request_headers:null==o||null===(t=o.config)||void 0===t?void 0:t.headers,response_body:JSON.stringify(null==o||null===(a=o.response)||void 0===a?void 0:a.data),error:null==o?void 0:o.toJSON()}),s.uT("Fetch-User-Details-Failure-".concat(n.Z.FETCH_USER_DETAILS(e,l)))}))}},y=(e,l)=>async l=>{l({type:"FETCH_VERIFY_TOKEN_REQUEST"});try{const i=await a.Z.post(n.Z.VERIFY_TOKEN(),e);i.status&&l({type:"FETCH_VERIFY_TOKEN_SUCCESS",payload:i.data.result})}catch(t){var i;l({type:"FETCH_VERIFY_TOKEN_FAILURE",payload:t}),"number"==typeof(null==t||null===(i=t.response)||void 0===i?void 0:i.status)&&s.$e((l=>{var i,o;l.setExtras({request_headers:null==t||null===(i=t.config)||void 0===i?void 0:i.headers,request_body:e,response_body:JSON.stringify(null==t||null===(o=t.response)||void 0===o?void 0:o.data),error:null==t?void 0:t.toJSON()}),s.uT("VERIFY_TOKEN-FAILURE-".concat(n.Z.VERIFY_TOKEN()))}))}},f=(e,l)=>async i=>{i({type:"COMBINATION_API_REQUEST"});try{const t=await o().post(n.Z.COMBINATION_API(),e,{headers:{uuid:l,"X-Device-Id":"fastrr",..."fastrr-boost-ui.pickrr.com"!==window.location.host&&d.Z.getItem("xtestnamespace")&&{"X-Test-Namespace":d.Z.getItem("xtestnamespace")}}}),a={data:t.data.data,headers:null==t?void 0:t.headers};t&&i({type:"COMBINATION_API_SUCCESS",payload:a})}catch(l){var t,a;429===(null==l||null===(t=l.response)||void 0===t?void 0:t.status)&&((0,u.BA)({errorText:"Too many requests",code:429}),c({apiName:"GUEST_V1",code:429})),i({type:"COMBINATION_API_FAILURE",payload:l}),402!=(null==l||null===(a=l.response)||void 0===a?void 0:a.status)&&s.$e((i=>{var t,o;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,request_body:e,response_body:JSON.stringify(null==l||null===(o=l.response)||void 0===o?void 0:o.data),error:JSON.stringify(l)}),s.uT("batch-api-failure-guest-".concat(n.Z.COMBINATION_API()))}))}},_=(e,l)=>async i=>{i({type:"COMBINATION_API_REQUEST"});try{const t=await a.Z.post(n.Z.COMBINATION_API(),e,l),o={data:t.data.data,headers:null==t?void 0:t.headers,..."fastrr-boost-ui.pickrr.com"!==window.location.host&&d.Z.getItem("xtestnamespace")&&{"X-Test-Namespace":d.Z.getItem("xtestnamespace")}};t&&i({type:"COMBINATION_API_SUCCESS",payload:o})}catch(l){var t,o;429===(null==l||null===(t=l.response)||void 0===t?void 0:t.status)&&((0,u.BA)({errorText:"Too many requests",code:429}),c({apiName:"LOGGED_IN_V1",code:429})),null!=l&&l.response&&(i({type:"COMBINATION_API_FAILURE",payload:l}),402!=(null==l||null===(o=l.response)||void 0===o?void 0:o.status)&&s.$e((i=>{var t,o;i.setExtras({request_headers:null==l||null===(t=l.config)||void 0===t?void 0:t.headers,request_body:e,response_body:JSON.stringify(null==l||null===(o=l.response)||void 0===o?void 0:o.data),error:JSON.stringify(l)}),s.uT("batch-api-failure-login-".concat(n.Z.COMBINATION_API()))})))}}},7666:(e,l,i)=>{i.d(l,{Mu:()=>r,PG:()=>s,Lm:()=>u,t1:()=>c,qF:()=>v});var n=i(4835),t=i(2718),o=(i(1881),i(7083)),a=(i(9094),i(1608)),d=i(2199);const r=(e,l)=>async i=>{i({type:"FETCH_OtpVerify_REQUEST"});try{const n=await o.Z.post(t.Z.VERIFY_OTP(),e,l);n.data.ok&&(a.y.setItem("pim_sid",null==n?void 0:n.headers["pim-sid"]),a.y.setItem("expireTime",null==n?void 0:n.headers["expires-at"]),i({type:"FETCH_OtpVerify_SUCCESS",payload:n.data.result,pim_sid:null==n?void 0:n.headers["pim-sid"],refresh_token:n.headers["refresh-token"]}))}catch(e){var n,d,r;i({type:"FETCH_OtpVerify_FAILURE",payload:null==e||null===(n=e.response)||void 0===n||null===(d=n.data)||void 0===d||null===(r=d.error)||void 0===r?void 0:r.message})}},s=e=>async l=>{l({type:"FETCH_OtpVerify_FAILURE",payload:e})},u=(e,l)=>async(i,n)=>{const r=n().Login;i({type:"FETCH_OTPLESS_TOKEN_VERIFY_REQUEST"});try{const n=await o.Z.post(t.Z.VERIFY_OTPLESS_TOKEN(),{...e,authenticationToken:null==r?void 0:r.authentication_token},l);n.data.ok&&(a.y.setItem("pim_sid",null==n?void 0:n.headers["pim-sid"]),a.y.setItem("expireTime",null==n?void 0:n.headers["expires-at"]),i({type:"FETCH_OTPLESS_TOKEN_VERIFY_SUCCESS",payload:n.data.result,pim_sid:null==n?void 0:n.headers["pim-sid"],refresh_token:n.headers["refresh-token"]}))}catch(l){var s,u,c,v;i({type:"FETCH_OTPLESS_TOKEN_VERIFY_FAILURE",payload:null==l||null===(s=l.response)||void 0===s||null===(u=s.data)||void 0===u||null===(c=u.error)||void 0===c?void 0:c.message}),"number"==typeof(null==l||null===(v=l.response)||void 0===v?void 0:v.status)&&d.$e((i=>{var n,o;i.setExtras({request_headers:null==l||null===(n=l.config)||void 0===n?void 0:n.headers,error:null==l?void 0:l.toJSON(),request_body:{tokenData:e,authenticationToken:null==r?void 0:r.authentication_token},response_body:JSON.stringify(null==l||null===(o=l.response)||void 0===o?void 0:o.data)}),d.uT("Otp-Verify-Failure-".concat(t.Z.VERIFY_OTP()))}))}},c=e=>async l=>{l({type:"SEND_Otp_REQUEST"}),await n.Z.post(t.Z.REQUEST_OTP(),e).then((e=>{l({type:"SEND_Otp_SUCCESS",payload:e.data})})).catch((e=>{l({type:"SEND_Otp_FAILURE",payload:e})}))},v=(e,l)=>async i=>{i({type:"SEND_Otp_REQUEST"});try{const n=await o.Z.post(t.Z.RESEND_OTP(),e,l);n&&i({type:"SEND_Otp_SUCCESS",payload:null==n?void 0:n.data})}catch(l){var n,a,r,s;i({type:"SEND_Otp_FAILURE",payload:null==l||null===(n=l.response)||void 0===n||null===(a=n.data)||void 0===a||null===(r=a.error)||void 0===r?void 0:r.message}),"number"==typeof(null==l||null===(s=l.response)||void 0===s?void 0:s.status)&&d.$e((i=>{var n,o;i.setExtras({request_headers:null==l||null===(n=l.config)||void 0===n?void 0:n.headers,error:null==l?void 0:l.toJSON(),request_body:e,response_body:JSON.stringify(null==l||null===(o=l.response)||void 0===o?void 0:o.data)}),d.uT("Resend-OTP-Failure-".concat(t.Z.RESEND_OTP()))}))}}},5637:(e,l,i)=>{i.d(l,{i:()=>r});var n=i(1881),t=i.n(n),o=i(2718);t().create({baseURL:"https://gorest.co.in/public/v2"});var a=i(7083),d=(i(4835),i(2199));const r=(e,l,i,n)=>async l=>{const t=window.location.search;let r=new URLSearchParams(t),s=null!=r.get("userDeviceId")?r.get("userDeviceId"):null,u=null!=r.get("userSessionId")?r.get("userSessionId"):null,c={...s&&{"X-USER-DEVICE-ID":s},...u&&{"X-USER-SESSION-ID":u}};n||l({type:"FETCH_SERVICE_REQUEST"});try{const t=await a.Z.postWithHeaders(o.Z.SERVICABILITY_STATUS(),e,i,c);var v;t.data.status&&l({type:"FETCH_SERVICE_SUCCESS",payload:null==t||null===(v=t.data)||void 0===v?void 0:v.data,requestPayload:e,savedCodFormAddress:n})}catch(i){var m;l({type:"FETCH_SERVICE_FAILED",payload:i}),"number"==typeof(null==i||null===(m=i.response)||void 0===m?void 0:m.status)&&d.$e((l=>{var n,t;l.setExtras({request_headers:null==i||null===(n=i.config)||void 0===n?void 0:n.headers,error:null==i?void 0:i.toJSON(),request_body:e,response_body:JSON.stringify(null==i||null===(t=i.response)||void 0===t?void 0:t.data)}),d.uT("Fetch-Service-Failure-".concat(o.Z.SERVICABILITY_STATUS()))}))}}},8805:(e,l,i)=>{i.d(l,{C:()=>n,R:()=>t});const n=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i=>{var n;const o=Date.now();i({type:"SHOW_TOAST",payload:{id:o,message:e,autoClose:l.autoClose||3e3,closeOnClick:null===(n=l.closeOnClick)||void 0===n||n,toastType:"SUCCESS"}}),l.autoClose&&setTimeout((()=>{i(t(o))}),l.autoClose)}},t=e=>({type:"REMOVE_TOAST",payload:e})},8846:(e,l,i)=>{i.d(l,{Z:()=>S});var n=i(9038),t=i(3064),o=(i(8018),i(6280),i(7088)),a={loader:1,fail:!1,sendAddressfired:!0,Address_data:null,selectedAddress:{name:"",address:"",email:""},selectedPaymentMode:"",selectedUpiApp:"",addAddress:!1,Updated_address_data:{},failMsg:null,invalidEmail:null,Silent_User_Address:{},addressAdded:!1,New_User_Address_Payload:null,spinner:!1,newUserAddressAdded:!1,fetchingAddress:!1,addressFetched:!1,authentication_token_for_otp:null,selectedAddress:null,addressFetched:!1,existingAddressAdded:!1,isAddressSavedCalled:!1,allAddressFetched:!1,fetchingAllAddress:!1,addingNewAddress:0,updatingAddress:!1,addressUpdated:!1,updatedAddress:null,initialAllAddressFetched:0,addressUpdateFail:!1,isEmailConfirmed:!1,newAddressAdded:!1,cachedAddressCalled:!1,addressCachedFetched:!1,emailConfirmed:!1,networkFail:!1,addressAdding:!1,billingAddress:null,defaultAddressCorrect:!0,editAddressCustomCheckout:!1,customAddressNew:!1,selectedAddressDoubtFull:!1,previous_adddress:null,addressFailMsg:"",errorPreferredShipping:{isError:!1,value:null}};var d={loader:1,fail:0,spinner:!1,pincode:"",Delivery_data:{},Pincode_data:{},wrongPincode:!1,city:"",state:"",tags:"",selectedTag:"home",tagValue:""};i(9094);var r=i(1608),s=i(9563),u={loader:1,newUserAdd:!1,fail:!1,spinner:!1,user_type:"",Session_data:{},shouldComponentUpdate:!0,verifySessionfired:!0,Login_data:{},error:"",sessionExist:!1,sendOtpfired:!0,onPage:"shipping",changeNumber:!1,showCoupon:!1,mobileNumber:"",upiIntervalID:"",qrIntervalID:"",paymentStatus:!1,createCustomerFired:!0,newUser_data:{},NewUser_Token:null,AuthTokenGenerated:!1,newSilentUser:!1,addSilentUserAddress:!1,paymentPageReached:!1,selectedUpiApp:0,analyticsData:null,userData:{},onLoginPage:Boolean,cartData:{},authentication_token:"",userInfo:{},pim_sid:"",sellerConfig:{},configFetched:!1,creatingGuest:!1,createdGuest:!1,fetchingConfig:!1,userDetailsFetched:!1,unauthorizedUser:!1,razorpayIntervalID:"",enteredNumber:!1,redirectEventFired:!1,loginWasCalled:!1,newPayment:!0,optionalPaymentIntervalId:"",networkFail:!1,easeBuzzIntervalID:"",whatsappHidden:!0,uiVersion:"v1",isLayoutUpdated:!1,codPullingInterval:"",mobileCheck:!1,showUPIBanner:!1,redirectPullingInterval:!1,applyUPIDiscount:!0,enteredEditNumber:!1,changePhoneLoader:1,customLogin:!1,sellerVerifyToken:!1,verifyTokenConfig:{},otpSkip:!1,partialCod:!1,partialCodButtonText:"",customCheckoutConfig:{},userDetailsDataCustom:{},cardDesign:!1,fetchingUserDetails:!1,fetchingShopifyCred:!1,shopifyCred:{},shopifyCredEmailError:!1,creatingShopifyCredError:!1,fetchingShopifyCredError:!1,loginSuccess:!1,loginThrough:null,initateCheckoutData:{},initiateCheckout:!1,isAnyModalOpen:!1,batchAPI:!1,isProductPage:!1,paymenFailedCartMismatch:!1,deviceFingerprint:null,otpLess:{otpLessScriptLoaded:!1,otplessInitialized:!1,initiationSuccesful:!1,initiationResponse:{requestID:null,deliveryChannel:null,authType:null,channel:null},verificationSuccessful:!1,verificationResponse:null,token:null},fireShipRocketFallBackOtpRequest:!1,headlessUserLimitReach:!1,guestAbandonPayload:{},fingerPrintCalled:!1,showFourDigitOtpClients:["foxtale.in","harish-30.myshopify.com"],showFealtyXDiv:!1,customerTokenCalled:!1,showCaptcha:!1};var c={loader:1,fail:0,OrderSummary_data:{}};var v={loader:1,fail:0,Payment_data:{}};var m={loader:1,fail:!1,toShow:{name:"",eddmsg:"",price:0},shippingDate:"",sendShippingfired:!0,Shipping_data:{},serviceFetching:!1,serviceFetched:!1,selected_service_data:null,service_data:null,paymentMode:"PREPAID",orderBlock:!1,platformCustomerId:"",networkFail:!1,payment_modes_discount:{},max_prepaid_discount:0,updatePayloadIntermittentServiceability:{},additionalDiscount:null,savedCodFormAddress:!1,otpLessIntermittentUpdate:!1,additionalPrepaidDiscountApplied:!1,codIntent:!1,additional_charge_text:""};var g=i(7555),p={loader:1,fail:!1,spinner:!0,otpValue:"",otpLessOtpValue:"",Otp_data:{},verified:!1,Otp_verified:{},counter:30,mobile:"",wrongOtp:!1,submitted:!1,pim_sid_updated:null,failedAttempts:0,errorMessage:"",resendErrorMessage:"",verifyFired:!1,fetchAddressPermission:!0,SSOPermission:!0,user_profile_id_from_otp:"",otp_received:!1,mobile_no:"",postOtpCouponsFetched:!1,userLoggedIn:!1,otpDigits:6};var h={loader:1,fail:0,Upi_data:{}};let y={loader:1,fail:!1,sendCartInitiate:!0,updateAddressfired:!0,updateShippingfired:!0,updatePaymentfired:!0,Cart_data:{},UpdateAdd_data:{},UpdatedShipping_data:{},cod_total_price:0,sub_total_price:0,total_price:0,prepaid_discount:0,auto_discount:0,coupon_discount:0,cod_charges:0,shipping_charges:0,channel_order_id:"",prepaid_discount_type:"",prepaid_discount_value:"",order_id:0,pg_order_id:"",showPrepaidDiscount:!0,coupon_discount_type:"",coupon_discount_value:"",transaction_ID:0,deliveryDate:"",showPreferredDelivery:!0,showPreferredShipping:!0,initiateRazorpayListener:!1,cartAddressUpdated:!1,orderComplete:!1,paymentProcessing:!1,verifyingPayment:!1,paymentFailed:!1,completeApiFired:!1,orderCompleteUrl:"",fireSetuRequest:!0,customerMarketingConsent:null,paymentMode:"",createCartCalled:!1,paymentDetails:{},orderDetails:{},loyaltyPointDetails:{},giftVoucherDetails:{EASYREWARD:null,SHOPIFY:null},orderFetched:!1,orderFetching:!1,cart_items:[],updateCartCalled:!1,initialCartData:null,upiPaymentStatus:!1,paymentMethodsFetching:!1,paymentMethodsFetched:!1,activePaymentGateway:"",activePaymentMode:"",fireRazorpayRequest:!0,orderPending:!1,activePayment:null,paymentMethodData:null,cartNotFound:!1,cartNotFoundText:"",abandantCartFetched:!1,mobileUpiLinkFetchError:!1,paymentType:"",platform:"",resumeCartData:null,resumeCartDataFetched:!1,outofstock:!1,resumeCartFailed:!1,paymentDone:!1,paymentDoneAnalytics:!1,billdeskDetailsFetched:!1,fbp:"",fbc:"",clientOrderId:"",razorPaymentStatus:!1,openingRazorpayStandard:!1,otherPaymentMode:"",paymentMethodsError:!1,isPaymentSuccess:!1,orderCreatedForPayment:!1,isCodAtTop:!0,hiddenOptions:!1,fireOptionalPaymentRequest:!0,credPaymentFailed:!1,showOtherMethods:!1,shopifyCart:"",networkFail:!1,openingEaseBuzzStandard:!1,fireEaseBuzzRequest:!0,paymentTnxId:"",trueCallerOpened:!1,fireTrueCallerRequest:!0,isAfterSellCookieSet:!1,checkUpSell:!1,showQrCode:!1,fireQrCodeRequest:!0,fireQrCodeInterval:"",qrCodeTimer:2,discountDisable:!1,showQrCodeDrawer:!1,orderId:"",isCtpCookieSet:!1,fireCtpPaymentRequest:!0,ctpTimerId:"",ctpStatusId:"",loadAfterSellCookie:!1,isCtpAttempted:!1,globalPaymentLoader:!1,clarityUserIdSet:!1,isCtpInitialized:!1,fireCodPullingRequest:!1,checkoutButtonLoader:!1,snapmintDetails:{},snapmintLoader:!1,fireRedirectPullingRequest:!1,initialPaymentOrder:[],bankOfferPaymentOrder:[],cardIINData:{},payPartialCod:!1,cardDesignEnabled:!1,paymentMethodCouponArray:[],defaultOrderSummaryOpen:!1,gstRequest:!1,selectedVariant:"",proceedToBuy:!1,selectedQuantity:0,productBuyNowVisible:!1,giftWrapProductPage:!1,gtmIds:{},gaClientId:"",gaSessionId:"",gaFire:!1,easeBuzzScriptLoad:!1,catalogueSyncCalled:!1,catalogueProcessed:!1,productBuyNowVisibleLoggedIn:!1,orderCodFailed:!1,orderCodPending:!1,showConfetti:!0,productSelectionOutStock:!1,timeCalculateCall:!1,startTimeCalled:!1,orderDetailsSaved:!1,orderPlacedDetails:{},showSaveAndPaySellers:["www.soni.fashion","krishnaayurved.com","in.teabox.com","estailofashion.com","beastlife.in","suryasilksonline.com","www.pokonut.com"],showOrderDetailsInSummarySellers:["www.soni.fashion","harish-30.myshopify.com"],snapmintPaymentVerify:!1,snapmintIntervalId:"",customSnapmint:{"acwo.com":"ACwO No Cost EMI","www.flashify.in":"Flashify No Cost EMI","www.figliving.com":"Fig Living Pay Later Zero cost EMI on UPI","jokerandwitch.com":"JW Easy EMI","nypsun.com":"Nypsun Pay Later","houseofayuda.com":"Ayuda Pay Later (Zero cost EMI)","winstonindia.com":"Winston Pay Later","zaverishop.in":"Zaveri Pay Later"},showCustomPartialCod:["avimeeherbal.com"],openSummaryOnAutomatic:["blackberrys.com","harish-30.myshopify.com"],prevProductQty:0,prevSelectedVariantCombination:{},updatingCart:!1,ucEventBuy:!1,ucEventOrder:!1,showGiftConfetti:!1,showSnapmintOnTop:["www.gavinparis.com","harish-30.myshopify.com"],hasBundleProduct:!1,upiId:"",openCodConfirmationModal:!1,currentPaymentStage:"",paymentModal:!1,upiCollectOpen:!1,notClosePaymentModal:!1,fomoCalled:!1,currentRetryClicks:0,placeOrderRecoveryCod:!1,isCodButtonShown:!1,orderPlacementFired:!1,cartResumeEntered:!0,codButtonEnabled:!1,qrCodeTimer:480,isQRIntervalSet:!1,phonepeS2S:!1,checkoutUpsellData:[],upsellDataFetched:!1,simplPodEnabled:!1,productPageRedirectionUrl:null,upiIdEntryDrawer:!1,wasLastTransactionPartial:!1,disableShipCoinForThisCart:!1,isOpen:!1,taxIncludedNoteSellers:["aqoonaa.com"],showExitForm:!1,shopifyPPCartTokenRequested:!1,shopifyPPCartTokenSynced:!1,smartCartSelectedFreebies:null,foxeTailSaveMessage:["foxtale.in"],hasAnyFreebie:!1,itemImageObjectFitSellers:["overlaysnow.com"],customerTokenCalled:!1,showUpiWalletOffersSection:!0};const f=window.location.search;let _=new URLSearchParams(f),C=null!=_.get("isFastrrProduct")&&_.get("isFastrrProduct");let x={loader:0,fail:!1,data:null,error:null,couponApplied:!1,couponPlaceValue:"Enter coupon code",manuallyAddedCouponError:"",couponCode:null,couponFetched:!1,suggestCoupon:[],couponListFetched:!1,paymentMethodType:"",bestCouponApplied:!1,loading:!1,toggleConfetti:!1};var b={toasts:[]};const A=(0,n.UY)({Shipping:function(){var e,l,i,n,t,o,a,d,r,s,u,c;let v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,g=arguments.length>1?arguments[1]:void 0;switch(g.type){case"FETCH_Shipping_REQUEST":return{...v,sendShippingfired:!1,loader:1};case"FETCH_Shipping_SUCCESS":return{...v,sendShippingfired:!1,Shipping_data:g.payload,loader:0};case"FETCH_Shipping_FAILURE":return{...v,fail:!0,sendShippingfired:!1,loader:0};case"FETCH_SERVICE_REQUEST":return{...v,serviceFetching:!0,loader:1,fail:!1};case"FETCH_SERVICE_SUCCESS":return console.log("action payload is",g.payload),{...v,serviceFetching:!1,serviceFetched:!0,service_data:g.payload,loader:0,orderBlock:null===(e=g.payload)||void 0===e?void 0:e.order_block,platformCustomerId:null==g||null===(l=g.payload)||void 0===l?void 0:l.platform_customer_id,payment_modes_discount:null===(i=g.payload)||void 0===i?void 0:i.payment_modes_discount,max_prepaid_discount:null===(n=g.payload)||void 0===n?void 0:n.max_prepaid_discount,updatePayloadIntermittentServiceability:null==g?void 0:g.requestPayload,additionalDiscount:(null===(t=g.payload)||void 0===t?void 0:t.additional_discount)||null,additionalPrepaidDiscountApplied:g.requestPayload.codIntent||v.additionalPrepaidDiscountApplied,additional_charge_text:null===(o=g.payload)||void 0===o?void 0:o.additional_charge_text,...null!=g&&g.savedCodFormAddress?{savedCodFormAddress:!0}:{}};case"FETCH_SERVICE_FAILED":return{...v,fail:"number"==typeof(null==g||null===(a=g.payload)||void 0===a||null===(d=a.response)||void 0===d?void 0:d.status),networkFail:"number"!=typeof(null==g||null===(r=g.payload)||void 0===r||null===(s=r.response)||void 0===s?void 0:s.status)||null==g||null===(u=g.payload)||void 0===u||null===(c=u.response)||void 0===c||!c.status,serviceFetching:!1,serviceFetched:!0,loader:0};case"UPDATE_INTERMITTENT_UPDATED_ADDRESS_OTPLESS_REQUEST":return{...v,otpLessIntermittentUpdate:!0};case"UPDATE_INTERMITTENT_UPDATED_ADDRESS_OTPLESS_SUCCESS":return{...v,updatePayloadIntermittentServiceability:null==g?void 0:g.payload,otpLessIntermittentUpdate:!1};case"UPDATE_INTERMITTENT_UPDATED_ADDRESS_OTPLESS_FAILURE":return{...v,otpLessIntermittentUpdate:!1};default:return v}},Address:function(){var e,l,i,n,t,d,r,s,u,c,v,m,g,p,h,y,f,_,C,x,b,A;let E=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,S=arguments.length>1?arguments[1]:void 0;switch(S.type){case"FETCH_Address_REQUEST":return{...E,loader:1,fetchingAddress:!0,addressFetched:!1};case"FETCH_Address_SUCCESS":return{...E,Address_data:S.payload,loader:0,fetchingAddress:!1,addressFetched:!0,selectedAddress:null!=S&&S.cachedAddresses?null==S?void 0:S.selectedAddress:null==S?void 0:S.payload[0],addressCachedFetched:!0,defaultAddressCorrect:null==S||!S.cachedAddresses||!(null!=S&&S.faultyAddress)};case"FETCH_Address_SUCCESS_After_Add_New":return{...E,Address_data:0===(null===(e=S.payload.data)||void 0===e?void 0:e.length)?[null==S||null===(l=S.payload)||void 0===l?void 0:l.addedAddress]:S.payload.data,loader:0,fetchingAddress:!1,selectedAddress:0===(null===(i=S.payload.data)||void 0===i?void 0:i.length)?null==S||null===(n=S.payload)||void 0===n?void 0:n.addedAddress:(null==S||null===(t=S.payload)||void 0===t||null===(d=t.data)||void 0===d||null===(r=d.filter((e=>{var l,i;return(null==e?void 0:e.addressID)===(null==S||null===(l=S.payload)||void 0===l||null===(i=l.addedAddress)||void 0===i?void 0:i.addressID)})))||void 0===r?void 0:r.length)>0?S.payload.data.filter((e=>{var l,i;return(null==e?void 0:e.addressID)===(null==S||null===(l=S.payload)||void 0===l||null===(i=l.addedAddress)||void 0===i?void 0:i.addressID)}))[0]:null==S||null===(s=S.payload)||void 0===s?void 0:s.data[0],addressFetched:!0,allAddressFetched:!0,initialAllAddressFetched:2};case"FETCH_Address_FAILURE":return{...E,fail:"number"==typeof(null==S||null===(u=S.payload)||void 0===u||null===(c=u.response)||void 0===c?void 0:c.status),networkFail:"number"!=typeof(null==S||null===(v=S.payload)||void 0===v||null===(m=v.response)||void 0===m?void 0:m.status)||null==S||null===(g=S.payload)||void 0===g||null===(p=g.response)||void 0===p||!p.status,loader:0,addressFetched:!0,fetchingAddress:!1};case"ADD_Address_REQUEST":return{...E,fail:!1,loader:1,New_User_Address_Payload:null,spinner:!0};case"ADD_Address_SUCCESS":return{...E,loader:0,New_User_Address_Payload:null,Updated_address_data:S.payload,spinner:!1};case"ADD_Address_FAILURE":return{...E,fail:!0,loader:0,failMsg:S.err,spinner:!1};case"Silent_User_Address_REQUEST":return{...E,fail:!1,loader:1,spinner:!0};case"Silent_User_Address_SUCCESS":return{...E,loader:0,Silent_User_Address:S.payload,addressAdded:!0,spinner:!1,newUserAddressAdded:!0};case"Silent_User_Address_FAILURE":return{...E,fail:!0,loader:0,invalidEmail:null===(h=S.payload.response.data)||void 0===h||null===(y=h.invalid_attributes)||void 0===y?void 0:y.email,spinner:!1};case"New_User_Address_REQUEST":return{...E,fail:!1,loader:1,spinner:!0,addressAdding:!0};case"New_User_Address_SUCCESS":return{...E,loader:0,spinner:!1,newUserAddressAdded:!0,addressAdding:!1,selectedAddressDoubtFull:!1,addressFailMsg:"",authentication_token_for_otp:S.payload.authentication_token};case"New_User_Address_FAILURE":return{...E,fail:!0,loader:0,spinner:!1,addressAdding:!1,errorData:S.payload,addressFailMsg:(0,o.lA)(S.payload.message)};case"ADD_Existing_User_Address_SUCCESS":return{...E,newAddressAdded:!0,customAddressNew:!0,addressFetched:!1,addressAdding:!1,selectedAddressDoubtFull:!1,addressFailMsg:"",...!(null!=S&&null!==(f=S.payload)&&void 0!==f&&f.fetchAddressPermission)&&{selectedAddress:null==S||null===(_=S.payload)||void 0===_?void 0:_.addedAddress,Address_data:[null==S||null===(C=S.payload)||void 0===C?void 0:C.addedAddress],fetchingAddress:!1,addressFetched:!0,initialAllAddressFetched:E.initialAllAddressFetched+1,allAddressFetched:!0,failMsg:null,invalidEmail:null}};case"ADD_Existing_User_Address_FAILURE":return{...E,addressFailMsg:(0,o.lA)(S.payload.message)};case"FETCH_All_Address_REQUEST":return{...E,fetchingAllAddress:!0,allAddressFetched:!1};case"FETCH_All_Address_SUCCESS":return{...E,Address_data:S.payload,loader:0,fetchingAllAddress:!1,allAddressFetched:!0,initialAllAddressFetched:E.initialAllAddressFetched+1,...S.payload.length>0&&{selectedAddress:(null==S||null===(x=S.payload)||void 0===x||null===(b=x.filter((e=>{var l;return(null==e?void 0:e.addressID)===(null==E||null===(l=E.selectedAddress)||void 0===l?void 0:l.addressID)})))||void 0===b?void 0:b.length)>0?null==S||null===(A=S.payload)||void 0===A?void 0:A.filter((e=>{var l;return(null==e?void 0:e.addressID)===(null==E||null===(l=E.selectedAddress)||void 0===l?void 0:l.addressID)}))[0]:null==S?void 0:S.payload[0]}};case"FETCH_All_Address_FAILURE":return{...E,loader:0,Address_data:[],allAddressFetched:!0,fetchingAllAddress:!1};case"Update_Address_REQUEST":return{...E,updatingAddress:!0,addressUpdated:!1};case"Update_Address_SUCCESS":return{...E,updatingAddress:!1,addressUpdated:!0,selectedAddressDoubtFull:!1,updatedAddress:S.payload,addressFailMsg:""};case"Update_Address_FAILURE":return{...E,updatingAddress:!1,addressUpdated:!1,addressUpdateFail:!0,addressFailMsg:(0,o.lA)(S.payload.message)};case"Bypass_FetchAddress":return{...E,Address_data:[],loader:0,fetchingAddress:!1,addressFetched:!0,selectedAddress:null,addressCachedFetched:!0,defaultAddressCorrect:!0};case"SKIP_Otp_Address_add":return{...E,newAddressAdded:!0,addressFetched:!1,addressAdding:!1,selectedAddress:null==S?void 0:S.payload,Address_data:[null==S?void 0:S.payload],fetchingAddress:!1,addressFetched:!0,selectedAddressDoubtFull:!1,initialAllAddressFetched:E.initialAllAddressFetched+1,allAddressFetched:!0};default:return E}},Payment:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"FETCH_Payment_REQUEST":return{...e,loader:1};case"FETCH_Payment_SUCCESS":return{...e,Payment_data:l.payload,loader:0};case"FETCH_Payment_FAILURE":return{...e,fail:1,loader:0};default:return e}},OrderSummary:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"FETCH_OrderSummary_REQUEST":return{...e,loader:1};case"FETCH_OrderSummary_SUCCESS":return{...e,OrderSummary_data:l.payload,loader:0};case"FETCH_OrderSummary_FAILURE":return{...e,fail:1,loader:0};default:return e}},Delivery:function(){var e,l,i;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_Delivery_REQUEST":return{...n,loader:1,spinner:!0};case"FETCH_Delivery_SUCCESS":return{...n,Delivery_data:t.payload,spinner:!1,loader:0};case"FETCH_Delivery_FAILURE":return{...n,fail:1,spinner:!1,loader:0};case"FETCH_Pincode_REQUEST":return{...n,loader:1,spinner:!0,wrongPincode:!1};case"FETCH_Pincode_SUCCESS":return{...n,Pincode_data:t.payload,spinner:!1,loader:0,city:null===(e=t.payload.postcode_details)||void 0===e?void 0:e.city,state:null===(l=t.payload.postcode_details)||void 0===l?void 0:l.state};case"FETCH_Pincode_FAILURE":return{...n,fail:1,spinner:!1,loader:0,wrongPincode:!0,city:"",state:""};case"Update_valid_cod_form_address":return{...n,ValidCodFormAddress:null!==(i=null==t?void 0:t.payload)&&void 0!==i&&i};case"Update_first_error_key_address":return{...n,firstErrorKey:null==t?void 0:t.payload};case"update_delivery_add_cod_form":return{...n,...null==t?void 0:t.payload};default:return n}},Login:function(){var e,l,i,n,t,o,a,d,r,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce,ve,me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne;let Ie=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,ke=arguments.length>1?arguments[1]:void 0;switch(ke.type){case"FETCH_Login_REQUEST":return{...Ie,loader:1,fail:!1,sendOtpfired:!0,enteredNumber:!0,loginWasCalled:!0,authentication_token:""};case"FETCH_Login_SUCCESS":return{...Ie,loader:0,Login_data:ke.payload,user_type:null==ke||null===(e=ke.payload)||void 0===e?void 0:e.user_type,user_type_for_text:ke.payload.user_type,authentication_token:ke.payload.authentication_token,spinner:!1,enteredNumber:!0,loginWasCalled:!0,loginSuccess:!0,loginThrough:null==ke||null===(l=ke.payload)||void 0===l?void 0:l.loginThrough,otpSkip:null!=ke&&null!==(i=ke.payload)&&void 0!==i&&i.otpSkip?null==ke||null===(n=ke.payload)||void 0===n?void 0:n.otpSkip:Ie.otpSkip};case"SKIP_OTP_SUCCESS":return{...Ie,user_type:"new",otpSkip:!0,spinner:!1};case"FETCH_Login_FAILURE":return{...Ie,fail:"number"==typeof(null==ke||null===(t=ke.payload)||void 0===t||null===(o=t.response)||void 0===o?void 0:o.status),networkFail:"number"!=typeof(null==ke||null===(a=ke.payload)||void 0===a||null===(d=a.response)||void 0===d?void 0:d.status)||null==ke||null===(r=ke.payload)||void 0===r||null===(c=r.response)||void 0===c||!c.status,Login_data:ke.payload,spinner:!1,loader:0,enteredNumber:!1,loginWasCalled:!0};case"VERIFY_Session_REQUEST":return{...Ie,verifySessionfired:!1,sessionExist:!1,fail:!1};case"VERIFY_Session_SUCCESS":return{...Ie,Session_data:ke.payload,spinner:!1,sessionExist:!0,verifySessionfired:!1};case"VERIFY_Session_FAILURE":return{...Ie,fail:!0,Login_data:ke.payload,spinner:!1,sessionExist:!0,verifySessionfired:!1};case"Create_Customer_REQUEST":return{...Ie,createCustomerFired:!1,fail:!1};case"Create_Customer_SUCCESS":return{...Ie,newUser_data:ke.payload};case"Create_Customer_FAILURE":return{...Ie,fail:!0,spinner:!1,newSilentUser:!0};case"Logout_User_REQUEST":return{...Ie,fail:!1};case"Logout_User_SUCCESS":return{...Ie};case"Logout_User_FAILURE":return{...Ie,fail:!0};case"VERIFY_Integration_SUCCESS":return console.log("VERIFY_Integration_SUCCESS"),{...Ie,analyticsData:ke.payload.data};case"VERIFY_Integration_FAILURE":return console.log("VERIFY_Integration_FAILURE"),{...Ie};case"Create_Guest_User_REQUESTED":return{...Ie,fail:!1,creatingGuest:!0};case"Create_Guest_User_SUCCESS":return{...Ie,userInfo:null==ke?void 0:ke.payload,pim_sid:null==ke?void 0:ke.payload.pim_sid,creatingGuest:!1,createdGuest:!0};case"Create_Guest_User_FAILURE":return{...Ie,fail:"number"==typeof(null==ke||null===(v=ke.payload)||void 0===v||null===(m=v.response)||void 0===m?void 0:m.status),networkFail:"number"!=typeof(null==ke||null===(g=ke.payload)||void 0===g||null===(p=g.response)||void 0===p?void 0:p.status)||null==ke||null===(h=ke.payload)||void 0===h||null===(y=h.response)||void 0===y||!y.status,creatingGuest:!1,createdGuest:!0};case"FETCH_Config_REQUEST":return{...Ie,fail:!1,fetchingConfig:!0};case"FETCH_Config_SUCCESS":try{var Te,Pe,je;null===(Te=ke.payload)||void 0===Te||!Te.exitResponseDetails||null!=ke&&null!==(Pe=ke.payload)&&void 0!==Pe&&Pe.exitResponseDetails.includes("others")||null===(je=ke.payload)||void 0===je||je.exitResponseDetails.push("others")}catch(e){console.log(e)}return{...Ie,sellerConfig:ke.payload,uiVersion:ke.payload.uiVersion,configFetched:!0,fetchingConfig:!1,partialCod:null===(f=ke.payload)||void 0===f||null===(_=f.partialCodConfig)||void 0===_?void 0:_.isEnabled,partialCodButtonText:(null===(C=ke.payload)||void 0===C||null===(x=C.partialCodConfig)||void 0===x?void 0:x.buttonText)||"Partial COD",cardDesign:null===(b=ke.payload)||void 0===b?void 0:b.cardDesign};case"FETCH_Config_FAILURE":return{...Ie,fail:"number"==typeof(null==ke||null===(A=ke.payload)||void 0===A||null===(E=A.response)||void 0===E?void 0:E.status),networkFail:"number"!=typeof(null==ke||null===(S=ke.payload)||void 0===S||null===(D=S.response)||void 0===D?void 0:D.status)||null==ke||null===(w=ke.payload)||void 0===w||null===(N=w.response)||void 0===N||!N.status,fetchingConfig:!1};case"FETCH_Config_Network_Failure":return{...Ie,networkFail:"number"!=typeof(null==ke||null===(I=ke.payload)||void 0===I||null===(k=I.response)||void 0===k?void 0:k.status)||null==ke||null===(T=ke.payload)||void 0===T||null===(P=T.response)||void 0===P||!P.status};case"SET_USER_DATA_AFTER_OTP":return{...Ie,userInfo:null==ke?void 0:ke.payload,pim_sid:null==ke?void 0:ke.pim_sid};case"FETCH_User_Details_REQUEST":return{...Ie,fetchingUserDetails:!0};case"FETCH_User_Details_SUCCESS":return window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_id",data:ke.payload.id}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_profile_id",data:ke.payload.user_profile_id}},"*"),(0,s.z5)(ke.payload.mobile_no,ke.payload.id),{...Ie,userDetailsFetched:!0,userInfo:{...Ie.userInfo,user_id:ke.payload.id,user_profile_id:ke.payload.user_profile_id},mobileNumber:ke.payload.mobile_no,userDetailsDataCustom:ke.payload,fetchingUserDetails:!1};case"FETCH_User_Details_FAILURE":return{...Ie,userDetailsFetched:!0,fail:"number"==typeof(null==ke||null===(j=ke.payload)||void 0===j||null===(F=j.response)||void 0===F?void 0:F.status),networkFail:"number"!=typeof(null==ke||null===(R=ke.payload)||void 0===R||null===(L=R.response)||void 0===L?void 0:L.status)||null==ke||null===(O=ke.payload)||void 0===O||null===(M=O.response)||void 0===M||!M.status,fetchingUserDetails:!1};case"UPDATE_LOGIN_STATE":return{...Ie,[ke.payload.key]:ke.payload.value};case"FETCH_VERIFY_TOKEN_REQUEST":case"FETCH_CUSTOM_CHECKOUT_CONFIG_REQUEST":return{...Ie,fail:!1,fetchingConfig:!0,sellerVerifyToken:!1};case"FETCH_VERIFY_TOKEN_SUCCESS":return{...Ie,sellerConfig:{...null===(U=ke.payload)||void 0===U?void 0:U.seller_config,seller_id:null===(Z=ke.payload)||void 0===Z||null===(B=Z.seller_config)||void 0===B?void 0:B.id},verifyTokenConfig:ke.payload,configFetched:!0,fetchingConfig:!1,sellerVerifyToken:!0};case"FETCH_VERIFY_TOKEN_FAILURE":return{...Ie,sellerVerifyToken:!1,fail:"number"==typeof(null==ke||null===(H=ke.payload)||void 0===H||null===(V=H.response)||void 0===V?void 0:V.status),networkFail:"number"!=typeof(null==ke||null===(G=ke.payload)||void 0===G||null===(W=G.response)||void 0===W?void 0:W.status)||null==ke||null===(q=ke.payload)||void 0===q||null===(z=q.response)||void 0===z||!z.status,fetchingConfig:!1};case"FETCH_CUSTOM_CHECKOUT_CONFIG_SUCCESS":try{var Fe,Re,Le;null===(Fe=ke.payload)||void 0===Fe||!Fe.seller_config.exitResponseDetails||null!=ke&&null!==(Re=ke.payload.seller_config)&&void 0!==Re&&Re.exitResponseDetails.includes("others")||null===(Le=ke.payload)||void 0===Le||Le.seller_config.exitResponseDetails.push("others")}catch(e){console.log(e)}return{...Ie,sellerConfig:{...null===(Y=ke.payload)||void 0===Y?void 0:Y.seller_config,seller_id:null===(Q=ke.payload)||void 0===Q||null===(J=Q.seller_config)||void 0===J?void 0:J.id},customCheckoutConfig:ke.payload,configFetched:!0,fetchingConfig:!1,sellerVerifyToken:!0,partialCod:null===(K=ke.payload)||void 0===K||null===($=K.seller_config)||void 0===$||null===(X=$.partialCodConfig)||void 0===X?void 0:X.isEnabled,partialCodButtonText:(null===(ee=ke.payload)||void 0===ee||null===(le=ee.seller_config)||void 0===le||null===(ie=le.partialCodConfig)||void 0===ie?void 0:ie.buttonText)||"Partial COD"};case"FETCH_CUSTOM_CHECKOUT_CONFIG_FAILURE":return{...Ie,sellerVerifyToken:!1,fail:"number"==typeof(null==ke||null===(ne=ke.payload)||void 0===ne||null===(te=ne.response)||void 0===te?void 0:te.status),networkFail:"number"!=typeof(null==ke||null===(oe=ke.payload)||void 0===oe||null===(ae=oe.response)||void 0===ae?void 0:ae.status)||null==ke||null===(de=ke.payload)||void 0===de||null===(re=de.response)||void 0===re||!re.status,fetchingConfig:!1};case"FETCH_SHOPIFY_CRED_REQUEST":return{...Ie,fetchingShopifyCred:!0};case"FETCH_SHOPIFY_CRED_SUCCESS":return{...Ie,fetchingShopifyCred:!1,shopifyCred:null==ke?void 0:ke.payload};case"FETCH_SHOPIFY_CRED_FAILURE":return{...Ie,fetchingShopifyCred:!1,fetchingShopifyCredError:!0,fail:"number"==typeof(null==ke||null===(se=ke.payload)||void 0===se||null===(ue=se.response)||void 0===ue?void 0:ue.status),networkFail:"number"!=typeof(null==ke||null===(ce=ke.payload)||void 0===ce||null===(ve=ce.response)||void 0===ve?void 0:ve.status)||null==ke||null===(me=ke.payload)||void 0===me||null===(ge=me.response)||void 0===ge||!ge.status};case"CREATE_SHOPIFY_CRED_REQUEST":return{...Ie,creatingShopifyCred:!0};case"CREATE_SHOPIFY_CRED_SUCCESS":return{...Ie,creatingShopifyCred:!1,createdShopifyCred:null==ke?void 0:ke.payload};case"CREATE_SHOPIFY_CRED_FAILURE":return{...Ie,creatingShopifyCred:!1,creatingShopifyCredError:!0,fail:"number"==typeof(null==ke||null===(pe=ke.payload)||void 0===pe||null===(he=pe.response)||void 0===he?void 0:he.status),networkFail:"number"!=typeof(null==ke||null===(ye=ke.payload)||void 0===ye||null===(fe=ye.response)||void 0===fe?void 0:fe.status)||null==ke||null===(_e=ke.payload)||void 0===_e||null===(Ce=_e.response)||void 0===Ce||!Ce.status};case"CREATE_SHOPIFY_CRED_EMAIL_ERROR":return{...Ie,creatingShopifyCred:!1,shopifyCredEmailError:!0};case"SHOPIFY_CRED_EMAIL_FIX":return{...Ie,shopifyCredEmailError:!1,creatingShopifyCredError:!1};case"COMBINATION_API_REQUEST":return{...Ie,initiateCheckout:!1};case"COMBINATION_API_SUCCESS":return{...Ie,initiateCheckout:!0,initateCheckoutData:null==ke?void 0:ke.payload};case"COMBINATION_API_FAILURE":return{...Ie,initiateCheckout:!1,batchAPI:429!=(null==ke||null===(xe=ke.payload)||void 0===xe||null===(be=xe.response)||void 0===be?void 0:be.status),showCaptcha:429==(null==ke||null===(Ae=ke.payload)||void 0===Ae||null===(Ee=Ae.response)||void 0===Ee?void 0:Ee.status)||!1,...402==(null==ke||null===(Se=ke.payload)||void 0===Se||null===(De=Se.response)||void 0===De?void 0:De.status)&&{sellerConfig:{walletThresholdBreach:!0}},headlessUserLimitReach:410==(null==ke||null===(we=ke.payload)||void 0===we||null===(Ne=we.response)||void 0===Ne?void 0:Ne.status)};default:return Ie}},Otp:function(){var e,l,i,n;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,o=arguments.length>1?arguments[1]:void 0;switch(o.type){case"SEND_Otp_REQUEST":return{...t,Otp_data:{},loader:1,wrongOtp:!1,fail:!1};case"SEND_Otp_SUCCESS":return{...t,Otp_data:o.payload,loader:0,spinner:!1,submitted:!1,fail:!1};case"SEND_Otp_FAILURE":return{...t,spinner:!1,loader:0,resendErrorMessage:o.payload};case"AFTER_FIVE_ATTEMPT":return{...t,loader:0,spinner:!1,submitted:!1,fail:!1};case"FETCH_OtpVerify_REQUEST":case"FETCH_OTPLESS_TOKEN_VERIFY_REQUEST":return{...t,loader:1,fail:!1,wrongOtp:!1,verifyFired:!0};case"FETCH_OtpVerify_SUCCESS":return(0,g.ky)(!0),t.SSOPermission?r.y.setItem("refreshToken",o.refresh_token):r.y.removeItem("refreshToken"),r.y.setItem("refreshTokenValue",o.refresh_token),r.y.setItem("user_id",o.payload.user_id),(0,s.z5)(o.payload.mobile_no,o.payload.user_id),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_id",data:o.payload.user_id}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_profile_id",data:o.payload.user_profile_id}},"*"),{...t,Otp_verified:o.payload,verified:!0,loader:0,fail:!1,mobile:null==o||null===(e=o.payload)||void 0===e?void 0:e.mobile_no,pim_sid_updated:null==o?void 0:o.pim_sid,verifyFired:!1,user_profile_id_from_otp:o.payload.user_profile_id,otp_received:!0,mobile_no:null==o||null===(l=o.payload)||void 0===l?void 0:l.mobile_no,userLoggedIn:!0};case"FETCH_OTPLESS_TOKEN_VERIFY_SUCCESS":return(0,g.ky)(!0),t.SSOPermission?r.y.setItem("refreshToken",o.refresh_token):r.y.removeItem("refreshToken"),r.y.setItem("refreshTokenValue",o.refresh_token),r.y.setItem("user_id",o.payload.user_id),(0,s.z5)(o.payload.mobile_no,o.payload.user_id),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_id",data:o.payload.user_id}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_profile_id",data:o.payload.user_profile_id}},"*"),{...t,Otp_verified:o.payload,verified:!0,loader:0,fail:!1,mobile:null==o||null===(i=o.payload)||void 0===i?void 0:i.mobile_no,pim_sid_updated:null==o?void 0:o.pim_sid,verifyFired:!1,user_profile_id_from_otp:o.payload.user_profile_id,otp_received:!0,mobile_no:null==o||null===(n=o.payload)||void 0===n?void 0:n.mobile_no,userLoggedIn:!0};case"FETCH_OtpVerify_FAILURE":return{...t,fail:!0,Otp_verified:o.payload,loader:0,wrongOtp:!0,otpValue:"",failedAttempts:t.failedAttempts+1,errorMessage:o.payload,verifyFired:!1,spinner:!1};case"FETCH_OTPLESS_TOKEN_VERIFY_FAILURE":return{...t,fail:!0,Otp_verified:o.payload,loader:0,wrongOtp:!0,otpValue:"",failedAttempts:t.failedAttempts+1,errorMessage:o.payload,verifyFired:!1};default:return t}},Upi:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"FETCH_Upi_REQUEST":return{...e,loader:1};case"FETCH_Upi_SUCCESS":return{...e,Upi_data:l.payload,loader:0};case"FETCH_Upi_FAILURE":return{...e,fail:1,loader:0};default:return e}},Cart:function(){var e,l,i,n,t,o,a,d,r,s,u,c,v,m,g,p,h,f,_,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G;let W=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,q=arguments.length>1?arguments[1]:void 0;switch(q.type){case"CART_INITIATE_REQUEST":return{...W,sendCartInitiate:!1,loader:1};case"CART_INITIATE_SUCCESS":return{...W,sendCartInitiate:!1,Cart_data:q.payload,loader:0,createCartCalled:!0,outofstock:null===(e=q.payload)||void 0===e?void 0:e.outOfStock,cardDesignEnabled:!!C||(null==q?void 0:q.cardDesignEnabled),productPageRedirectionUrl:null===(l=q.payload)||void 0===l?void 0:l.redirectionUrl,platform:null===(i=q.payload)||void 0===i?void 0:i.channel};case"CART_INITIATE_FAILURE":return{...W,fail:"number"==typeof(null==q||null===(n=q.payload)||void 0===n||null===(t=n.response)||void 0===t?void 0:t.status),networkFail:"number"!=typeof(null==q||null===(o=q.payload)||void 0===o||null===(a=o.response)||void 0===a?void 0:a.status)||null==q||null===(d=q.payload)||void 0===d||null===(r=d.response)||void 0===r||!r.status,sendCartInitiate:!1,loader:0};case"ABANDONED_INITIATE_REQUEST":return{...W,sendCartInitiate:!1,loader:1,cartNotFound:!1,abandantCartFetched:!0};case"ABANDONED_INITIATE_SUCCESS":return{...W,sendCartInitiate:!1,Cart_data:q.payload,loader:0,createCartCalled:!0,cartNotFound:!1,abandantCartFetched:!0};case"ABANDONED_INITIATE_FAILURE":return{...W,sendCartInitiate:!1,cartNotFound:!0,cartNotFoundText:null==q||null===(s=q.payload)||void 0===s||null===(u=s.response)||void 0===u||null===(c=u.data)||void 0===c||null===(v=c.error)||void 0===v?void 0:v.message,loader:0,abandantCartFetched:!1};case"RESUME_CART_REQUEST":return{...W,sendCartInitiate:!1,loader:1,resumeCartDataFetched:!1,resumeCartFailed:!1};case"RESUME_CART_SUCCESS":return{...W,sendCartInitiate:!1,resumeCartData:q.payload,loader:0,resumeCartDataFetched:!0,platform:q.payload.channel,resumeCartFailed:!1,createCartCalled:!0,Cart_data:q.payload};case"RESUME_CART_FAILURE":return{...W,sendCartInitiate:!1,loader:0,resumeCartDataFetched:!1,resumeCartFailed:!0};case"Update_Transaction_REQUEST":return{...W,loader:1,fail:!1};case"Update_Transaction_SUCCESS":case"Update_Transaction_FAILURE":return{...W,loader:0};case"CREATE_ORDER_REQUEST":case"UPDATE_ORDER_REQUEST":return{...W,loader:1,orderFetching:!0,orderFetched:!1};case"CREATE_ORDER_SUCCESS":return{...W,paymentDetails:q.payload.paymentDetails,orderDetails:q.payload.orderDetails,loyaltyPointDetails:q.payload.loyaltyPointDetails,giftVoucherDetails:null!=q&&null!==(m=q.payload)&&void 0!==m&&null!==(g=m.giftVoucherDetails)&&void 0!==g&&g.gift_voucher_provider?{[null===(p=q.payload)||void 0===p||null===(h=p.giftVoucherDetails.gift_voucher_provider)||void 0===h?void 0:h.toUpperCase()]:null===(f=q.payload)||void 0===f?void 0:f.giftVoucherDetails}:{EASYREWARD:null,SHOPIFY:null},orderFetched:!0,orderFetching:!1,loader:0,outofstock:q.payload.orderDetails.outOfStock,orderCreatedForPayment:!0};case"CREATE_ORDER_FAILURE":return{...W,fail:"number"==typeof(null==q||null===(_=q.payload)||void 0===_||null===(x=_.response)||void 0===x?void 0:x.status),networkFail:"number"!=typeof(null==q||null===(b=q.payload)||void 0===b||null===(A=b.response)||void 0===A?void 0:A.status)||null==q||null===(E=q.payload)||void 0===E||null===(S=E.response)||void 0===S||!S.status,orderFetched:!0,orderFetching:!1,loader:0,orderCreatedForPayment:!0};case"UPDATE_ORDER_SUCCESS":return{...W,paymentDetails:q.payload.paymentDetails,orderDetails:q.payload.orderDetails,loyaltyPointDetails:q.payload.loyaltyPointDetails,giftVoucherDetails:null!=q&&null!==(D=q.payload)&&void 0!==D&&null!==(w=D.giftVoucherDetails)&&void 0!==w&&w.gift_voucher_provider?{[null===(N=q.payload)||void 0===N||null===(I=N.giftVoucherDetails.gift_voucher_provider)||void 0===I?void 0:I.toUpperCase()]:null===(k=q.payload)||void 0===k?void 0:k.giftVoucherDetails}:{EASYREWARD:null,SHOPIFY:null},orderFetched:!0,orderFetching:!1,loader:0,updateCartCalled:!0,outofstock:null===(T=q.payload)||void 0===T||null===(P=T.orderDetails)||void 0===P?void 0:P.outOfStock};case"UPDATE_ORDER_FAILURE":return{...W,fail:"number"==typeof(null==q||null===(j=q.payload)||void 0===j||null===(F=j.response)||void 0===F?void 0:F.status),networkFail:"number"!=typeof(null==q||null===(R=q.payload)||void 0===R||null===(L=R.response)||void 0===L?void 0:L.status)||null==q||null===(O=q.payload)||void 0===O||null===(M=O.response)||void 0===M||!M.status,orderFetched:!0,orderFetching:!1,loader:0};case"GST_APPLY_REQUESTED":return{...W,sendCartInitiate:!1,loader:1,gstRequest:!0};case"GST_APPLY_SUCCESS":return console.log(q.payload,"checking the payload"),{...W,sendCartInitiate:!1,Cart_data:q.payload,loader:0,createCartCalled:!0,gstRequest:!1,outofstock:q.payload.outOfStock};case"GST_APPLY_FAILURE":return{...W,fail:"number"==typeof(null==q||null===(U=q.payload)||void 0===U||null===(Z=U.response)||void 0===Z?void 0:Z.status),networkFail:"number"!=typeof(null==q||null===(B=q.payload)||void 0===B||null===(H=B.response)||void 0===H?void 0:H.status)||null==q||null===(V=q.payload)||void 0===V||null===(G=V.response)||void 0===G||!G.status,sendCartInitiate:!1,loader:0,gstRequest:!1};case"UPDATE_CART_STATE":return{...W,[q.payload.key]:q.payload.value};case"UPDATE_PAYMENT_CONFIG_SUCCESS":return{...W,paymentMethodData:q.payload,paymentMethodsFetching:!1};case"UPDATE_PAYMENT_CONFIG_REQUEST":return{...W,paymentMethodsFetching:!0};case"UPDATE_PAYMENT_CONFIG_FAILURE":return{...W,paymentMethodsFetching:!1};case"GET_UPSELL_DATA_SUCCESS":return{...W,upsellDataFetched:!0,checkoutUpsellData:q.payload};case"GET_UPSELL_DATA_FAILURE":return{...W,upsellDataFetched:!0,checkoutUpsellData:[]};default:return W}},Coupon:function(){var e,l,i;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"COUPON_APPLY_REQUESTED":return{...n,loader:1,couponApplied:!1,couponFetched:!1,loading:!0};case"COUPON_APPLY_SUCCESS":return{...n,data:null==t||null===(e=t.payload)||void 0===e?void 0:e.data,manuallyAddedCouponError:(null==t||null===(l=t.payload)||void 0===l?void 0:l.manuallyAddedCouponError)||(null==n?void 0:n.manuallyAddedCouponError),error:null,loader:0,couponApplied:!0,couponCode:t.payload.data.couponCode,couponFetched:!0,loading:!1,toggleConfetti:(null==t||null===(i=t.payload)||void 0===i?void 0:i.toggleConfetti)||n.toggleConfetti};case"COUPON_APPLY_FAILURE":return{...n,fail:!0,data:null,error:t.payload.data,loader:0,couponApplied:!1,couponFetched:!1,loading:!1};case"SUGGESTION_COUPON_APPLY_REQUEST":return{...n,suggestCoupon:[],couponListFetched:!0};case"SUGGESTION_COUPON_APPLY_SUCCESS":return{...n,suggestCoupon:t.payload,couponListFetched:!0};case"SUGGESTION_COUPON_APPLY_ERROR":return{...n,suggestCoupon:[],couponListFetched:!1};default:return n}},Toast:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SHOW_TOAST":return{...e,toasts:[...e.toasts,l.payload]};case"REMOVE_TOAST":return{...e,toasts:e.toasts.filter((e=>e.id!==l.payload))};default:return e}}}),E=(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||n.qC)((0,n.md)(t.Z)),S=(0,n.MT)(A,E)},2718:(e,l,i)=>{i.d(l,{Z:()=>t});var n=i(9218);const t={VERIFY_SESSION:()=>"".concat(n.Q.apiBaseUrlV2,"customer/verify"),CUSTOMER_EXIST:()=>"".concat(n.Q.apiBaseUrlV2,"customer/exists"),REQUEST_OTP:()=>"".concat(n.Q.apiBaseUrlV2,"customer/auth/send"),VERIFY_OTP:()=>"".concat(n.Q.apiIdentityService,"authenticate/otp"),POST_CREATE_CART:()=>"".concat(n.Q.apiBaseUrlV2,"customer/checkout/initiate"),GET_ADDRESS:()=>"".concat(n.Q.apiBaseUrlV1,"customer/user"),GET_SHIPPING:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/shipping-plans"),GET_PAYMENT_LINK:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/payment/upi-send"),GET_PINCODE:()=>"".concat(n.Q.srApiBaseUrl,"external/open/postcode/details"),POST_ADD_ADDRESS:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/customer/add"),GET_UPI_LIST:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/pgs/upi"),GET_PAYMENT_STATUS:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/setu-payment-details"),GET_QR_CODE:()=>"".concat(n.Q.apiBaseUrlV1,"qr-code/generate"),GET_PAYMENT_METHOD:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/payment-methods"),GET_INTEGRATION_STATUS:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/integration"),POST_COMPLETE_CHECKOUT:()=>"".concat(n.Q.apiBaseUrlV2,"customer/checkout/complete"),UPDATE_PAYMENT:()=>"".concat(n.Q.apiBaseUrlV2,"customer/checkout/payment"),UPDATE_TRANSACTION:(e,l,i)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/orders/").concat(i,"/update-transaction"),COUPON_APPLY:()=>"".concat(n.Q.apiBaseUrlV2,"customer/checkout/coupon"),UPDATE_CART_SHIPPING_SPEEED:()=>"".concat(n.Q.apiBaseUrlV2,"customer/checkout/shipping"),GET_SETU_PAYMENT_DETAILS:(e,l)=>"".concat(n.Q.apiBaseUrlV1).concat(e,"/").concat(l,"/setu-payment-details"),BASEURLV1:()=>"".concat(n.Q.apiBaseUrlV1),CREATE_SILENT_CUSTOMER:()=>"".concat(n.Q.apiBaseUrlV2,"customer"),AUTH_TOKEN_SILENT_CUSTOMER:()=>"".concat(n.Q.apiBaseUrlV2,"customer/auth/token"),ADD_ADDRESS_SILENT_CUSTOMER:()=>"".concat(n.Q.apiBaseUrlV2,"customer/address"),LOGOUT_USER:()=>"".concat(n.Q.apiBaseUrlV2,"customer/logout"),LOGIN_CHECK:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/user/login"),CREATE_GUEST_USER:()=>"".concat(n.Q.apiIdentityService,"session/create"),SELLER_CONFIG:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/seller/config"),ADD_EXISTING_USER_ADDRESS:(e,l)=>"".concat(n.Q.pickrrAggregatorApi+"api/ve1/aggregator-service/address/users/"+e,"/addresses").concat(l?"?addressVerified=true":""),ADD_NEW_USER_ADDRESS:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/save/address"),CREATE_CART_DETAILS:()=>"".concat(n.Q.pickrrCartService,"api/ve1/cart-service"),GET_ADDRESS_LIST:(e,l)=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/address/users/").concat(e,"/addresses?blockOldAddress=").concat(l),SERVICABILITY_STATUS:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/serviceability"),RESEND_OTP:()=>"".concat(n.Q.apiIdentityService,"authenticate/resend_otp"),FETCH_ORDERS:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/order"),GET_UPI_PAYMENT_DETAILS:(e,l)=>"".concat(n.Q.pickrrOrderApi,"api/ve1/order-service/payment/verify?txn_id=").concat(e,"&seller_id=").concat(l),COD_COMPLETE_PURCHASE:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/order"),SEND_PAYMENT_LINK:(e,l,i)=>"".concat(n.Q.pickrrOrderApi).concat(e,"/payment/").concat(l,"/communication?paymentLink=").concat(i),FIRE_EVENT:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/publish-event"),COUPON_SUGGESTION:()=>"".concat(n.Q.couponSuggestionBaseUrl,"api/ve1/promotion-service/cart/suggest-coupons"),GET_PAYMENT_METHODS:e=>"".concat(n.Q.paymentServiceBaseUrl,"api/ve1/payment-aggregator/seller/config/").concat(e,"/?api_version=v2"),CREATE_UPI_ORDER:(e,l)=>"".concat(n.Q.pickrrOrderApi,"api/ve1/order-service/payment/verify?txn_id=").concat(e,"&seller_id=").concat(l,"&type=createOrder"),RAZORPAY_CALLBACK_URL:()=>"".concat(n.Q.paymentHandler),FETCH_USER_DETAILS:(e,l)=>"".concat(n.Q.apiIdentityService,"user/details?user_id=").concat(l,"&tenant_id=").concat(e,"&add_profile=true"),GET_ADDRESS_LIST_CACHE:(e,l)=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/address/users/").concat(e,"/addresses?cached=true&blockOldAddress=").concat(l),RESUME_CART:()=>"".concat(n.Q.resumeCartService),DELETE_ADDRESS:(e,l,i)=>"".concat(n.Q.pickrrAggregatorApi+"api/ve1/aggregator-service/address/users/"+e,"/addresses/?isDelete=",!0),FETCH_USER_DETAILS_TRUECALLER:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/truecaller/user/login"),FETCH_UPSELL_PRODUCTS:(e,l)=>"".concat(n.Q.couponSuggestionBaseUrl,"api/ve1/promotion-service/fastrr-discount/fetch/aftersell-discounts"),FETCH_CTP_LINK:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/order/cod/prepaid"),FETCH_CTP_DATA:e=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/cod/prepaid/discount?order_id=").concat(e),COD_ORDER_VERIFY:(e,l)=>"".concat(n.Q.pickrrOrderApi,"api/ve1/order-service/payment/verify?txn_id=").concat(e,"&seller_id=").concat(l),GET_CUSTOMER_CREDS:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/shopify/native/initiate"),VERIFY_TOKEN:()=>"".concat(n.Q.apiIdentityService,"api/ve1/seller-customer-token/ui/access-token/login/data"),VERIFY_OTPLESS_TOKEN:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/otp-less"),CHECKOUT_COMPELTE:()=>"".concat(n.Q.apiIdentityService,"api/ve1/seller-customer-token/ui/access-token/customer"),GET_CARD_DETAILS:e=>"".concat(n.Q.paymentServiceBaseUrl,"api/ve1/payment-aggregator/transaction/fetch/iin/").concat(e,"?paymentPlatform=RAZORPAY"),CUSTOM_CHECKOUT_CONFIG:()=>"".concat(n.Q.apiIdentityService,"api/ve1/seller-customer-token/ui/access-token/checkout/data"),EXIT_FORM_SUBMIT:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/exit-checkout-form"),FETCH_ESTIMATED_DELIVRY:e=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/serviceability/").concat(e),CATALOGUE_SYNC:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/sync/category"),FETCH_SHOPIFY_CREDENTIALS:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/shopify-login"),COMBINATION_API:()=>"".concat(n.Q.edgeService,"batch/api/v1"),UPI_COLLECT_VERIFY:(e,l)=>"".concat(n.Q.paymentServiceBaseUrl,"api/ve1/payment-aggregator/transaction/verify/vpa?vpa=").concat(e),EASYREWARDS_COUPON_UNBLOCK_URL:()=>"".concat(n.Q.couponSuggestionBaseUrl,"api/ve1/promotion-service/loyalty-point-manager/unblock-coupon"),GET_UPSELL_ITEMS:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/fetch/upsell-config"),FINGER_PRINT:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/fingerprint"),SYNC_SHOPIFY_CART_TOKEN:()=>"".concat(n.Q.pickrrAggregatorApi,"api/ve1/aggregator-service/capture/cart-data"),GET_CUSTOMER_AUTH_TOKEN:()=>"".concat(n.Q.apiIdentityService,"api/ve1/seller-customer-token/ui/access-token/full-checkout/customer"),VERIFY_CAPTCHA_TOKEN:()=>"".concat(n.Q.edgeService,"batch/api/clear-rl-captcha")}},5381:(e,l,i)=>{i.d(l,{xE:()=>t,sz:()=>o,AN:()=>a,dY:()=>d,qW:()=>r,LQ:()=>s,Ii:()=>u,Gt:()=>c,R7:()=>v,qX:()=>m,Hl:()=>g});var n=i(6417);const t=e=>{let{color:l="#383838"}=e;return(0,n.jsx)("svg",{width:"18",height:"16",viewBox:"0 0 21 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M17.0041 11C17.5563 10.9978 18.0022 10.5482 18 9.99594C17.9978 9.44366 17.5482 8.99777 16.9959 9.00001L17.0041 11ZM0.396178 9.36022C0.00724105 9.75232 0.00980865 10.3855 0.401913 10.7744L6.79163 17.1125C7.18373 17.5015 7.81689 17.4989 8.20583 17.1068C8.59477 16.7147 8.5922 16.0815 8.2001 15.6926L2.52035 10.0587L8.15422 4.37897C8.54315 3.98687 8.54059 3.35371 8.14848 2.96477C7.75638 2.57583 7.12322 2.5784 6.73428 2.9705L0.396178 9.36022ZM16.9959 9.00001L1.10209 9.06446L1.1102 11.0644L17.0041 11L16.9959 9.00001Z",fill:l})})},o=e=>{let{color:l="#3173E3"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:[(0,n.jsx)("g",{"clip-path":"url(#clip0_6239_115275)",children:(0,n.jsx)("path",{d:"M5.95898 3.79158H7.04232V4.87492H5.95898V3.79158ZM5.95898 5.95825H7.04232V9.20825H5.95898V5.95825ZM6.50065 1.08325C3.51065 1.08325 1.08398 3.50992 1.08398 6.49992C1.08398 9.48992 3.51065 11.9166 6.50065 11.9166C9.49065 11.9166 11.9173 9.48992 11.9173 6.49992C11.9173 3.50992 9.49065 1.08325 6.50065 1.08325ZM6.50065 10.8333C4.1119 10.8333 2.16732 8.88867 2.16732 6.49992C2.16732 4.11117 4.1119 2.16659 6.50065 2.16659C8.8894 2.16659 10.834 4.11117 10.834 6.49992C10.834 8.88867 8.8894 10.8333 6.50065 10.8333Z",fill:l})}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"clip0_6239_115275",children:(0,n.jsx)("rect",{width:"13",height:"13",fill:"white"})})})]})},a=e=>{let{color:l="#3173E3"}=e;return(0,n.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M7.15 4.95H6.05V2.75C6.05 2.60413 5.99206 2.46424 5.88891 2.36109C5.78577 2.25795 5.64587 2.2 5.5 2.2C5.35413 2.2 5.21424 2.25795 5.11109 2.36109C5.00795 2.46424 4.95 2.60413 4.95 2.75V5.5C4.95 5.64587 5.00795 5.78576 5.11109 5.88891C5.21424 5.99205 5.35413 6.05 5.5 6.05H7.15C7.29587 6.05 7.43576 5.99205 7.53891 5.88891C7.64205 5.78576 7.7 5.64587 7.7 5.5C7.7 5.35413 7.64205 5.21423 7.53891 5.11109C7.43576 5.00794 7.29587 4.95 7.15 4.95ZM5.5 0C4.4122 0 3.34884 0.322569 2.44437 0.926917C1.5399 1.53126 0.834947 2.39025 0.418665 3.39524C0.00238306 4.40023 -0.106535 5.5061 0.105683 6.57299C0.317902 7.63989 0.841726 8.6199 1.61091 9.38908C2.3801 10.1583 3.36011 10.6821 4.42701 10.8943C5.4939 11.1065 6.59977 10.9976 7.60476 10.5813C8.60975 10.1651 9.46874 9.4601 10.0731 8.55563C10.6774 7.65116 11 6.5878 11 5.5C10.9984 4.04181 10.4184 2.6438 9.3873 1.6127C8.3562 0.581605 6.95819 0.00162172 5.5 0ZM5.5 9.9C4.62976 9.9 3.77907 9.64194 3.05549 9.15846C2.33192 8.67498 1.76796 7.9878 1.43493 7.18381C1.10191 6.37981 1.01477 5.49512 1.18455 4.6416C1.35432 3.78809 1.77338 3.00408 2.38873 2.38873C3.00408 1.77338 3.78809 1.35432 4.6416 1.18454C5.49512 1.01477 6.37981 1.1019 7.18381 1.43493C7.9878 1.76796 8.67499 2.33191 9.15847 3.05549C9.64194 3.77907 9.9 4.62976 9.9 5.5C9.89867 6.66654 9.43467 7.78492 8.6098 8.60979C7.78493 9.43466 6.66654 9.89866 5.5 9.9Z",fill:l})})},d=e=>{let{color:l="#3173E3"}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",children:(0,n.jsx)("path",{d:"M5.0549 10.4731H7.05926C7.12148 10.4735 7.18315 10.4616 7.24075 10.438C7.29834 10.4145 7.35073 10.3799 7.3949 10.3361L10.6662 7.06102L12.0087 5.74722C12.053 5.70328 12.0882 5.65101 12.1122 5.59343C12.1362 5.53584 12.1486 5.47407 12.1486 5.41168C12.1486 5.34929 12.1362 5.28752 12.1122 5.22993C12.0882 5.17234 12.053 5.12007 12.0087 5.07614L10.0044 3.04873C9.96041 3.00443 9.90812 2.96927 9.85052 2.94528C9.79291 2.92129 9.73112 2.90894 9.66872 2.90894C9.60631 2.90894 9.54452 2.92129 9.48692 2.94528C9.42931 2.96927 9.37703 3.00443 9.33308 3.04873L7.99999 4.38616L4.71926 7.66121C4.67545 7.70537 4.64079 7.75774 4.61726 7.81532C4.59374 7.8729 4.58181 7.93455 4.58217 7.99675V10.0005C4.58217 10.1259 4.63198 10.2461 4.72063 10.3347C4.80929 10.4233 4.92953 10.4731 5.0549 10.4731ZM9.66872 4.05062L11.0065 5.38805L10.3353 6.05913L8.99745 4.7217L9.66872 4.05062ZM5.52763 8.19051L8.3309 5.38805L9.66872 6.72548L6.86545 9.52794H5.52763V8.19051ZM12.6185 11.4183H4.10945C3.98407 11.4183 3.86383 11.4681 3.77518 11.5567C3.68652 11.6453 3.63672 11.7656 3.63672 11.8909C3.63672 12.0162 3.68652 12.1364 3.77518 12.2251C3.86383 12.3137 3.98407 12.3635 4.10945 12.3635H12.6185C12.7439 12.3635 12.8642 12.3137 12.9528 12.2251C13.0415 12.1364 13.0913 12.0162 13.0913 11.8909C13.0913 11.7656 13.0415 11.6453 12.9528 11.5567C12.8642 11.4681 12.7439 11.4183 12.6185 11.4183Z",fill:l})})},r=()=>(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M2.96708 0.69934L3.79068 0.463789C4.56618 0.241993 5.39476 0.600437 5.72687 1.30139L6.23956 2.38349C6.52263 2.98096 6.37346 3.68312 5.86854 4.12987L4.97297 4.92227C4.9619 4.93206 4.95281 4.9437 4.94616 4.9566C4.85249 5.13827 4.99443 5.62364 5.44074 6.35711C5.94377 7.1838 6.33258 7.51094 6.51215 7.46015L7.68779 7.11912C8.34783 6.92765 9.06312 7.15597 9.46697 7.68704L10.1951 8.64453C10.6678 9.26613 10.5828 10.1237 9.99623 10.6508L9.37001 11.2135C8.92768 11.6109 8.3083 11.7778 7.71184 11.6601C5.96671 11.3159 4.40316 9.98244 3.00808 7.68974C1.61163 5.39478 1.17686 3.44166 1.73773 1.83467C1.92823 1.28887 2.3869 0.865271 2.96708 0.69934ZM3.18187 1.37548C2.83377 1.47503 2.55856 1.72919 2.44427 2.05667C1.96099 3.44133 2.35245 5.1999 3.65264 7.33664C4.95158 9.47135 6.35951 10.6721 7.86334 10.9687C8.22121 11.0393 8.59284 10.9392 8.85824 10.7007L9.48446 10.138C9.8003 9.8542 9.84607 9.39244 9.59154 9.05774L8.86341 8.10025C8.64595 7.81429 8.2608 7.69135 7.90539 7.79445L6.72726 8.1362C6.0752 8.32063 5.46234 7.80498 4.79618 6.7102C4.23223 5.7834 4.03646 5.11396 4.27761 4.64627C4.32421 4.55589 4.38786 4.47437 4.4654 4.40578L5.36095 3.6134C5.63283 3.37284 5.71315 2.99475 5.56073 2.67304L5.04804 1.59094C4.86921 1.2135 4.42305 1.0205 4.00547 1.13993L3.18187 1.37548Z",fill:"#9A9A9A"})}),s=()=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 14 11",fill:"none",children:(0,n.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.615885 0.609375L0.0742188 1.16493V10.0538L0.615885 10.6094H12.5326L13.0742 10.0538V1.16493L12.5326 0.609375H0.615885ZM1.15755 2.42086V9.49826H11.9909V2.42067L6.57415 7.4713L1.15755 2.42086ZM11.1314 1.72049H2.0169L6.57415 5.96967L11.1314 1.72049Z",fill:"#9A9A9A"})}),u=e=>{let{color:l="#E0E0E0"}=e;return(0,n.jsx)("svg",{width:"8",height:"14",viewBox:"0 0 8 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M1.2207 12.4434L6.7016 6.96247L1.2207 1.48157",stroke:l,"stroke-width":"1.56754","stroke-linecap":"round","stroke-linejoin":"round"})})},c=e=>{let{color:l="#4E596F"}=e;return(0,n.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M5.52701 9.48063C5.3729 9.56406 5.40042 9.78307 5.57104 9.84043C5.6481 9.87172 6.226 9.89258 6.84794 9.89258C7.79461 9.89258 8.00926 9.87693 8.11383 9.80915C8.26243 9.71007 8.26794 9.66314 8.12484 9.52756C8.02026 9.42848 7.94321 9.42327 6.82042 9.42327C6.10492 9.42327 5.58205 9.44934 5.52701 9.48063Z",fill:l}),(0,n.jsx)("path",{d:"M9.17808 9.5067C9.02397 9.60578 9.02397 9.71007 9.17808 9.80915C9.28265 9.87693 9.49731 9.89258 10.4495 9.89258C11.132 9.89258 11.6383 9.87172 11.7044 9.84043C11.7649 9.80915 11.8089 9.73093 11.8089 9.65792C11.8089 9.58492 11.7649 9.5067 11.7044 9.47541C11.6383 9.44413 11.132 9.42327 10.4495 9.42327C9.49731 9.42327 9.28265 9.43891 9.17808 9.5067Z",fill:l}),(0,n.jsx)("path",{d:"M5.43269 11.2059C5.34463 11.2894 5.35014 11.378 5.45471 11.4771C5.53176 11.5501 5.83998 11.5605 8.03052 11.5605C10.7219 11.5605 10.6834 11.5658 10.6394 11.2894L10.6228 11.1694L8.06354 11.1538C6.11517 11.1434 5.48223 11.159 5.43269 11.2059Z",fill:l}),(0,n.jsx)("path",{d:"M12.9139 0.0350046C12.8093 0.0662918 10.2445 0.62425 7.2229 1.2865C4.19577 1.94354 1.61446 2.53278 1.48237 2.59536C1.01454 2.80915 0.695312 3.28889 0.695312 3.77906C0.695312 4.05543 0.810894 4.51953 0.87694 4.51953C0.90446 4.51953 3.0895 4.05022 5.72585 3.4714C8.3622 2.8978 11.4389 2.22512 12.5562 1.98525C13.6789 1.74017 14.6366 1.52637 14.6972 1.51073C14.7797 1.48987 14.7907 1.45337 14.7632 1.27086C14.6806 0.791117 14.3449 0.32702 13.9431 0.128867C13.6899 0.00893164 13.2001 -0.0379992 12.9139 0.0350046Z",fill:l}),(0,n.jsx)("path",{d:"M11.5127 3.2249L7.99022 4.01229L6.47666 4.0488C5.22177 4.07487 4.91906 4.10094 4.6934 4.17916C4.43472 4.26781 4.02193 4.59633 3.90635 4.79969C3.86232 4.8727 3.5541 4.95613 2.49736 5.19079C1.75433 5.35244 1.1324 5.49845 1.11038 5.51409C1.07186 5.55581 2.15061 10.0299 2.28271 10.3584C2.47534 10.8538 3.03123 11.2449 3.53759 11.2449H3.70821L3.73573 11.7299C3.77976 12.4651 4.03294 12.9136 4.57782 13.1899C4.79797 13.3047 4.82549 13.3047 8.55712 13.3203L12.3108 13.3359V13.1795V13.0231L8.61216 13.0074C5.22177 12.9918 4.89154 12.9866 4.73193 12.9031C4.50077 12.7832 4.24759 12.486 4.17053 12.2409C4.1265 12.1001 4.10999 11.0363 4.10999 8.64283C4.10999 5.70181 4.121 5.21686 4.19255 5.05521C4.31363 4.78405 4.42371 4.67976 4.74294 4.53897L5.01813 4.41382H11.177C17.2642 4.41382 17.3413 4.41382 17.5725 4.51811C17.8311 4.63804 18.0513 4.9092 18.1394 5.22207C18.1779 5.34722 18.1999 6.00947 18.1999 6.87509V8.32474H18.365H18.5301V6.79687C18.5301 5.92083 18.5081 5.19079 18.4751 5.08128C18.3705 4.72669 18.0898 4.40339 17.7376 4.23131C17.4128 4.07487 17.3963 4.07487 16.4277 4.05923L15.448 4.03837L15.3984 3.85064C15.3709 3.74114 15.2828 3.38133 15.2003 3.04239C15.1177 2.70865 15.0462 2.43228 15.0462 2.4375C15.0407 2.4375 13.4501 2.7973 11.5127 3.2249Z",fill:l}),(0,n.jsx)("path",{d:"M15.6789 6.78357C15.216 6.86838 14.8153 7.08368 14.4975 7.40337C14.0208 7.89268 13.9241 8.17975 13.8757 9.191L13.8412 10.0718L13.551 10.1044C13.1987 10.1435 12.9292 10.3523 12.8739 10.6394C12.8532 10.7568 12.8394 11.4092 12.8532 12.0812L12.8739 13.3143L13.1019 13.5035L13.3299 13.6992L16.128 13.6796L18.9329 13.6601L19.0987 13.4643C19.2646 13.2686 19.2646 13.249 19.2646 11.8855C19.2646 10.5285 19.2646 10.5024 19.0987 10.3262C18.9813 10.1892 18.8569 10.137 18.6013 10.1109L18.2628 10.0718L18.2213 9.15838C18.2006 8.49943 18.1522 8.17322 18.0693 7.99054C17.6686 7.13587 16.6254 6.60741 15.6789 6.78357ZM16.5563 7.31203C17.0054 7.41641 17.489 7.87963 17.6341 8.34938C17.7792 8.79302 17.7861 9.92823 17.6479 10.0326C17.5857 10.0848 17.0883 10.1044 16.0105 10.0913L14.463 10.0718V9.191C14.463 8.382 14.4768 8.29066 14.6288 8.04926C15.0433 7.38379 15.7342 7.1163 16.5563 7.31203ZM16.4527 10.9786C16.7083 11.2005 16.7636 11.5723 16.5978 11.8659C16.5218 11.9899 16.4527 12.2443 16.4458 12.4205C16.4181 12.9098 16.1003 13.1186 15.8102 12.8445C15.7134 12.7532 15.672 12.6293 15.672 12.427C15.672 12.2704 15.6236 12.0551 15.5684 11.9573C15.5131 11.8529 15.4647 11.6441 15.4647 11.4875C15.4647 10.933 16.052 10.6328 16.4527 10.9786Z",fill:l})]})},v=e=>{let{color:l="#4E596F"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"28",viewBox:"0 0 15 15",fill:"none",children:[(0,n.jsx)("mask",{id:"path-1-inside-1_9_9",fill:"white",children:(0,n.jsx)("path",{d:"M14.2682 8.04349L11.9634 5.2503C11.8935 5.16528 11.8055 5.09684 11.7059 5.04992C11.6063 5.00299 11.4975 4.97876 11.3874 4.97895H9.70895V0.746843C9.70876 0.548828 9.63001 0.358981 9.48999 0.218964C9.34997 0.0789462 9.16012 0.000197718 8.96211 0H0.746843C0.548828 0.000197718 0.358981 0.0789462 0.218964 0.218964C0.0789462 0.358981 0.000197718 0.548828 0 0.746843V12.1984C0.000197718 12.3964 0.0789462 12.5863 0.218964 12.7263C0.358981 12.8663 0.548828 12.9451 0.746843 12.9453H1.5136C1.57274 13.36 1.77954 13.7395 2.096 14.0141C2.41247 14.2886 2.81736 14.4398 3.23632 14.4398C3.65527 14.4398 4.06016 14.2886 4.37663 14.0141C4.6931 13.7395 4.89989 13.36 4.95903 12.9453H9.47992C9.53907 13.36 9.74586 13.7395 10.0623 14.0141C10.3788 14.2886 10.7837 14.4398 11.2026 14.4398C11.6216 14.4398 12.0265 14.2886 12.343 14.0141C12.6594 13.7395 12.8662 13.36 12.9254 12.9453H13.6921C13.8901 12.9451 14.08 12.8663 14.22 12.7263C14.36 12.5863 14.4388 12.3964 14.439 12.1984V8.51874C14.4388 8.34524 14.3785 8.17717 14.2682 8.04324V8.04349ZM3.7489 0.497895H5.96005V3.41929L5.03471 2.44765C4.98672 2.40022 4.92196 2.37362 4.85448 2.37362C4.787 2.37362 4.72224 2.40022 4.67424 2.44765L3.7489 3.41929V0.497895ZM0.497895 0.746843C0.497961 0.680838 0.52421 0.617555 0.570883 0.570883C0.617555 0.52421 0.680838 0.497961 0.746843 0.497895H3.25101V4.04166C3.251 4.09142 3.26589 4.14003 3.29378 4.18124C3.32167 4.22244 3.36126 4.25435 3.40745 4.27284C3.45364 4.29132 3.50431 4.29555 3.55293 4.28496C3.60154 4.27437 3.64587 4.24946 3.68019 4.21344L4.85448 2.9804L6.02876 4.21344C6.06308 4.24946 6.10741 4.27437 6.15602 4.28496C6.20464 4.29555 6.25531 4.29132 6.3015 4.27284C6.3477 4.25435 6.38729 4.22244 6.41517 4.18124C6.44306 4.14003 6.45796 4.09142 6.45795 4.04166V0.497895H8.96211C9.02812 0.497961 9.0914 0.52421 9.13807 0.570883C9.18474 0.617555 9.21099 0.680838 9.21106 0.746843V9.70895C9.21099 9.77496 9.18474 9.83824 9.13807 9.88491C9.0914 9.93158 9.02812 9.95784 8.96211 9.9579H0.746843C0.680838 9.95784 0.617555 9.93158 0.570883 9.88491C0.52421 9.83824 0.497961 9.77496 0.497895 9.70895V0.746843ZM3.23632 13.9411C2.99013 13.9411 2.74947 13.8681 2.54478 13.7313C2.34008 13.5945 2.18054 13.4001 2.08633 13.1727C1.99212 12.9452 1.96747 12.6949 2.0155 12.4535C2.06353 12.212 2.18208 11.9902 2.35616 11.8162C2.53024 11.6421 2.75203 11.5235 2.99348 11.4755C3.23494 11.4275 3.48521 11.4521 3.71266 11.5463C3.9401 11.6405 4.13451 11.8001 4.27128 12.0048C4.40805 12.2095 4.48106 12.4501 4.48106 12.6963C4.48066 13.0263 4.34939 13.3427 4.11604 13.576C3.8827 13.8094 3.56632 13.9407 3.23632 13.9411ZM11.2026 13.9411C10.9565 13.9411 10.7158 13.8681 10.5111 13.7313C10.3064 13.5945 10.1469 13.4001 10.0527 13.1727C9.95844 12.9452 9.93379 12.6949 9.98182 12.4535C10.0298 12.212 10.1484 11.9902 10.3225 11.8162C10.4966 11.6421 10.7183 11.5235 10.9598 11.4755C11.2013 11.4275 11.4515 11.4521 11.679 11.5463C11.9064 11.6405 12.1008 11.8001 12.2376 12.0048C12.3744 12.2095 12.4474 12.4501 12.4474 12.6963C12.447 13.0263 12.3157 13.3427 12.0824 13.576C11.849 13.8094 11.5326 13.9407 11.2026 13.9411ZM13.9411 12.1984C13.9411 12.2645 13.9148 12.3278 13.8681 12.3745C13.8215 12.4211 13.7581 12.4474 13.6921 12.4474H12.9254C12.8662 12.0326 12.6594 11.6531 12.343 11.3786C12.0265 11.104 11.6216 10.9529 11.2026 10.9529C10.7837 10.9529 10.3788 11.104 10.0623 11.3786C9.74586 11.6531 9.53907 12.0326 9.47992 12.4474H4.95903C4.89989 12.0326 4.6931 11.6531 4.37663 11.3786C4.06016 11.104 3.65527 10.9529 3.23632 10.9529C2.81736 10.9529 2.41247 11.104 2.096 11.3786C1.77954 11.6531 1.57274 12.0326 1.5136 12.4474H0.746843C0.680818 12.4474 0.617497 12.4211 0.57081 12.3745C0.524123 12.3278 0.497895 12.2645 0.497895 12.1984V10.7047C0.497895 10.6387 0.524123 10.5754 0.57081 10.5287C0.617497 10.482 0.680818 10.4558 0.746843 10.4558H8.96211C9.16019 10.4558 9.35015 10.3771 9.49021 10.2371C9.63027 10.097 9.70895 9.90703 9.70895 9.70895V5.47685H11.3869C11.4236 5.4768 11.46 5.4849 11.4932 5.50057C11.5265 5.51624 11.5559 5.53908 11.5793 5.56746L13.8841 8.36016C13.9209 8.40478 13.9411 8.46086 13.9411 8.51874V12.1984ZM6.83137 8.03951C6.83137 7.97349 6.8576 7.91017 6.90428 7.86348C6.95097 7.81679 7.01429 7.79056 7.08032 7.79056H8.16398C8.23001 7.79056 8.29333 7.81679 8.34002 7.86348C8.3867 7.91017 8.41293 7.97349 8.41293 8.03951C8.41293 8.10554 8.3867 8.16886 8.34002 8.21554C8.29333 8.26223 8.23001 8.28846 8.16398 8.28846H7.08007C7.01404 8.28846 6.95072 8.26223 6.90403 8.21554C6.85735 8.16886 6.83137 8.10554 6.83137 8.03951ZM6.83137 8.85232C6.83137 8.7863 6.8576 8.72298 6.90428 8.67629C6.95097 8.62961 7.01429 8.60338 7.08032 8.60338H8.16398C8.23001 8.60338 8.29333 8.62961 8.34002 8.67629C8.3867 8.72298 8.41293 8.7863 8.41293 8.85232C8.41293 8.91835 8.3867 8.98167 8.34002 9.02836C8.29333 9.07504 8.23001 9.10127 8.16398 9.10127H7.08007C7.01404 9.10127 6.95072 9.07504 6.90403 9.02836C6.85735 8.98167 6.83137 8.91835 6.83137 8.85232ZM11.1504 6.07083C11.1271 6.04089 11.0972 6.01667 11.0632 6.00001C11.0291 5.98336 10.9916 5.97471 10.9537 5.97474H10.2068C10.1408 5.97474 10.0775 6.00097 10.0308 6.04766C9.98413 6.09434 9.9579 6.15766 9.9579 6.22369V8.46422C9.9579 8.53024 9.98413 8.59356 10.0308 8.64025C10.0775 8.68694 10.1408 8.71316 10.2068 8.71316H12.6963C12.7429 8.7132 12.7886 8.70014 12.8282 8.67547C12.8678 8.65081 12.8996 8.61553 12.9201 8.57366C12.9406 8.53179 12.9489 8.485 12.9441 8.43863C12.9393 8.39226 12.9216 8.34816 12.893 8.31136L11.1504 6.07083ZM10.4558 8.21527V6.47264H10.8317L12.1875 8.21527H10.4558Z"})}),(0,n.jsx)("path",{d:"M14.2682 8.04349L11.9634 5.2503C11.8935 5.16528 11.8055 5.09684 11.7059 5.04992C11.6063 5.00299 11.4975 4.97876 11.3874 4.97895H9.70895V0.746843C9.70876 0.548828 9.63001 0.358981 9.48999 0.218964C9.34997 0.0789462 9.16012 0.000197718 8.96211 0H0.746843C0.548828 0.000197718 0.358981 0.0789462 0.218964 0.218964C0.0789462 0.358981 0.000197718 0.548828 0 0.746843V12.1984C0.000197718 12.3964 0.0789462 12.5863 0.218964 12.7263C0.358981 12.8663 0.548828 12.9451 0.746843 12.9453H1.5136C1.57274 13.36 1.77954 13.7395 2.096 14.0141C2.41247 14.2886 2.81736 14.4398 3.23632 14.4398C3.65527 14.4398 4.06016 14.2886 4.37663 14.0141C4.6931 13.7395 4.89989 13.36 4.95903 12.9453H9.47992C9.53907 13.36 9.74586 13.7395 10.0623 14.0141C10.3788 14.2886 10.7837 14.4398 11.2026 14.4398C11.6216 14.4398 12.0265 14.2886 12.343 14.0141C12.6594 13.7395 12.8662 13.36 12.9254 12.9453H13.6921C13.8901 12.9451 14.08 12.8663 14.22 12.7263C14.36 12.5863 14.4388 12.3964 14.439 12.1984V8.51874C14.4388 8.34524 14.3785 8.17717 14.2682 8.04324V8.04349ZM3.7489 0.497895H5.96005V3.41929L5.03471 2.44765C4.98672 2.40022 4.92196 2.37362 4.85448 2.37362C4.787 2.37362 4.72224 2.40022 4.67424 2.44765L3.7489 3.41929V0.497895ZM0.497895 0.746843C0.497961 0.680838 0.52421 0.617555 0.570883 0.570883C0.617555 0.52421 0.680838 0.497961 0.746843 0.497895H3.25101V4.04166C3.251 4.09142 3.26589 4.14003 3.29378 4.18124C3.32167 4.22244 3.36126 4.25435 3.40745 4.27284C3.45364 4.29132 3.50431 4.29555 3.55293 4.28496C3.60154 4.27437 3.64587 4.24946 3.68019 4.21344L4.85448 2.9804L6.02876 4.21344C6.06308 4.24946 6.10741 4.27437 6.15602 4.28496C6.20464 4.29555 6.25531 4.29132 6.3015 4.27284C6.3477 4.25435 6.38729 4.22244 6.41517 4.18124C6.44306 4.14003 6.45796 4.09142 6.45795 4.04166V0.497895H8.96211C9.02812 0.497961 9.0914 0.52421 9.13807 0.570883C9.18474 0.617555 9.21099 0.680838 9.21106 0.746843V9.70895C9.21099 9.77496 9.18474 9.83824 9.13807 9.88491C9.0914 9.93158 9.02812 9.95784 8.96211 9.9579H0.746843C0.680838 9.95784 0.617555 9.93158 0.570883 9.88491C0.52421 9.83824 0.497961 9.77496 0.497895 9.70895V0.746843ZM3.23632 13.9411C2.99013 13.9411 2.74947 13.8681 2.54478 13.7313C2.34008 13.5945 2.18054 13.4001 2.08633 13.1727C1.99212 12.9452 1.96747 12.6949 2.0155 12.4535C2.06353 12.212 2.18208 11.9902 2.35616 11.8162C2.53024 11.6421 2.75203 11.5235 2.99348 11.4755C3.23494 11.4275 3.48521 11.4521 3.71266 11.5463C3.9401 11.6405 4.13451 11.8001 4.27128 12.0048C4.40805 12.2095 4.48106 12.4501 4.48106 12.6963C4.48066 13.0263 4.34939 13.3427 4.11604 13.576C3.8827 13.8094 3.56632 13.9407 3.23632 13.9411ZM11.2026 13.9411C10.9565 13.9411 10.7158 13.8681 10.5111 13.7313C10.3064 13.5945 10.1469 13.4001 10.0527 13.1727C9.95844 12.9452 9.93379 12.6949 9.98182 12.4535C10.0298 12.212 10.1484 11.9902 10.3225 11.8162C10.4966 11.6421 10.7183 11.5235 10.9598 11.4755C11.2013 11.4275 11.4515 11.4521 11.679 11.5463C11.9064 11.6405 12.1008 11.8001 12.2376 12.0048C12.3744 12.2095 12.4474 12.4501 12.4474 12.6963C12.447 13.0263 12.3157 13.3427 12.0824 13.576C11.849 13.8094 11.5326 13.9407 11.2026 13.9411ZM13.9411 12.1984C13.9411 12.2645 13.9148 12.3278 13.8681 12.3745C13.8215 12.4211 13.7581 12.4474 13.6921 12.4474H12.9254C12.8662 12.0326 12.6594 11.6531 12.343 11.3786C12.0265 11.104 11.6216 10.9529 11.2026 10.9529C10.7837 10.9529 10.3788 11.104 10.0623 11.3786C9.74586 11.6531 9.53907 12.0326 9.47992 12.4474H4.95903C4.89989 12.0326 4.6931 11.6531 4.37663 11.3786C4.06016 11.104 3.65527 10.9529 3.23632 10.9529C2.81736 10.9529 2.41247 11.104 2.096 11.3786C1.77954 11.6531 1.57274 12.0326 1.5136 12.4474H0.746843C0.680818 12.4474 0.617497 12.4211 0.57081 12.3745C0.524123 12.3278 0.497895 12.2645 0.497895 12.1984V10.7047C0.497895 10.6387 0.524123 10.5754 0.57081 10.5287C0.617497 10.482 0.680818 10.4558 0.746843 10.4558H8.96211C9.16019 10.4558 9.35015 10.3771 9.49021 10.2371C9.63027 10.097 9.70895 9.90703 9.70895 9.70895V5.47685H11.3869C11.4236 5.4768 11.46 5.4849 11.4932 5.50057C11.5265 5.51624 11.5559 5.53908 11.5793 5.56746L13.8841 8.36016C13.9209 8.40478 13.9411 8.46086 13.9411 8.51874V12.1984ZM6.83137 8.03951C6.83137 7.97349 6.8576 7.91017 6.90428 7.86348C6.95097 7.81679 7.01429 7.79056 7.08032 7.79056H8.16398C8.23001 7.79056 8.29333 7.81679 8.34002 7.86348C8.3867 7.91017 8.41293 7.97349 8.41293 8.03951C8.41293 8.10554 8.3867 8.16886 8.34002 8.21554C8.29333 8.26223 8.23001 8.28846 8.16398 8.28846H7.08007C7.01404 8.28846 6.95072 8.26223 6.90403 8.21554C6.85735 8.16886 6.83137 8.10554 6.83137 8.03951ZM6.83137 8.85232C6.83137 8.7863 6.8576 8.72298 6.90428 8.67629C6.95097 8.62961 7.01429 8.60338 7.08032 8.60338H8.16398C8.23001 8.60338 8.29333 8.62961 8.34002 8.67629C8.3867 8.72298 8.41293 8.7863 8.41293 8.85232C8.41293 8.91835 8.3867 8.98167 8.34002 9.02836C8.29333 9.07504 8.23001 9.10127 8.16398 9.10127H7.08007C7.01404 9.10127 6.95072 9.07504 6.90403 9.02836C6.85735 8.98167 6.83137 8.91835 6.83137 8.85232ZM11.1504 6.07083C11.1271 6.04089 11.0972 6.01667 11.0632 6.00001C11.0291 5.98336 10.9916 5.97471 10.9537 5.97474H10.2068C10.1408 5.97474 10.0775 6.00097 10.0308 6.04766C9.98413 6.09434 9.9579 6.15766 9.9579 6.22369V8.46422C9.9579 8.53024 9.98413 8.59356 10.0308 8.64025C10.0775 8.68694 10.1408 8.71316 10.2068 8.71316H12.6963C12.7429 8.7132 12.7886 8.70014 12.8282 8.67547C12.8678 8.65081 12.8996 8.61553 12.9201 8.57366C12.9406 8.53179 12.9489 8.485 12.9441 8.43863C12.9393 8.39226 12.9216 8.34816 12.893 8.31136L11.1504 6.07083ZM10.4558 8.21527V6.47264H10.8317L12.1875 8.21527H10.4558Z",fill:l,stroke:l,"stroke-width":"400",mask:"url(#path-1-inside-1_9_9)"})]})},m=e=>{let{color:l="#4E596F"}=e;return(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"28",viewBox:"0 0 13 16",fill:"none",children:[(0,n.jsxs)("g",{"clip-path":"url(#clip0_12596_50936)",children:[(0,n.jsx)("path",{d:"M8.22521 11.787L8.22054 11.79L6.54529 12.8928L4.87005 11.79L4.86537 11.787C4.16415 11.3353 3.58931 10.7236 3.18982 10.0072C2.79084 9.29163 2.57853 8.49276 2.57031 7.68045V4.06085L6.54529 2.58594L10.5203 4.06085V7.68049C10.5121 8.49278 10.2998 9.29164 9.90076 10.0072C9.50128 10.7236 8.92643 11.3353 8.22521 11.787ZM6.38879 12.9958V12.9958Z",stroke:l,"stroke-width":"1.13649"}),(0,n.jsx)("path",{d:"M6.43644 15.6971L3.81294 14.022L3.81058 14.0205C2.73508 13.3485 1.85212 12.4377 1.23801 11.3694C0.624183 10.3017 0.297355 9.10864 0.285156 7.89507V2.54614C0.285308 2.53915 0.287629 2.53084 0.294034 2.52229C0.300772 2.5133 0.312139 2.50413 0.328309 2.49865L0.333386 2.49688L6.45697 0.292948L6.45824 0.292486C6.485 0.282713 6.51532 0.282713 6.54208 0.292489L6.54335 0.292945L12.667 2.49688L12.672 2.49865C12.6882 2.50413 12.6996 2.5133 12.7063 2.52229C12.7127 2.53083 12.715 2.53914 12.7152 2.54613V7.89502C12.703 9.10861 12.3762 10.3017 11.7624 11.3694C11.1482 12.4377 10.2653 13.3485 9.18974 14.0205L9.18738 14.022L6.5641 15.697C6.54658 15.7082 6.52414 15.7152 6.50016 15.7152C6.47618 15.7152 6.45396 15.7083 6.43644 15.6971Z",stroke:l,"stroke-width":"0.57"}),(0,n.jsx)("path",{d:"M6.49883 9.66063L4.42188 7.76445L4.80751 7.39704L6.46027 8.90524L8.94767 6.14062L9.37187 6.47207L6.49883 9.66063Z",fill:l})]}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"clip0_12596_50936",children:(0,n.jsx)("rect",{width:"13",height:"16",fill:"white"})})})]})},g=e=>(0,n.jsxs)("svg",{width:"11",height:"10",viewBox:"0 0 11 10",fill:e,xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M5.00758 9.80048C7.7732 9.80048 10.0152 7.60657 10.0152 4.90024C10.0152 2.19391 7.7732 0 5.00758 0C2.24197 0 0 2.19391 0 4.90024C0 7.60657 2.24197 9.80048 5.00758 9.80048Z",fill:"#F4CF00"}),(0,n.jsx)("path",{d:"M4.93386 2.83956C4.68586 2.83956 4.46986 2.63956 4.46986 2.38356C4.46986 2.12756 4.68586 1.91956 4.93386 1.91956C5.18986 1.91956 5.39786 2.12756 5.39786 2.38356C5.39786 2.63956 5.18986 2.83956 4.93386 2.83956ZM4.58186 7.35156V3.48756H5.30186V7.35156H4.58186Z",fill:"white"})]})},8018:(e,l,i)=>{i.d(l,{Z:()=>x});var n=i(7313),t=i(976),o=i(7075),a=i(6352),d=i(1608),r=i(6417);const s=e=>{var l,i,s,u,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D;const w=()=>{var l,i;null!=e&&null!==(l=e.address_obj)&&void 0!==l&&l.doubtfulAddress&&null!==(i=P.sellerConfig)&&void 0!==i&&i.addressVerify?(k.previous_adddress=e,e.setEditAddressData(e.address_obj),e.setEditAddress(!0),e.setTitle("Edit address"),k.selectedAddressDoubtFull=!0,k.addressUpdated=!1,k.addressUpdateFail=!1,o.Z.additionalEvents("edit-address",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)):(e.onSelectAddressMethod(e),e.SetIsOpen(!1))},N=(0,a.v9)((e=>e.Coupon)),I=(0,a.v9)((e=>e.Cart)),k=(0,a.v9)((e=>e.Address)),T=(0,a.v9)((e=>e.Otp)),P=(0,a.v9)((e=>e.Login)),[j,F]=(0,n.useState)(0);function R(e){return(null==e?void 0:e.length)>25?e.substring(0,25)+"...":e}return(0,r.jsx)(r.Fragment,{children:null!=I&&I.cardDesignEnabled?(0,r.jsxs)("div",{className:t.Z.addressContainerCard,onMouseLeave:()=>{null==e||e.setActiveMenuIndex("")},children:[(0,r.jsxs)("div",{style:{width:null!=I&&I.cardDesignEnabled?"100%":""},onClick:e=>{var l;w(),o.Z.savedAddressChanged(null==I?void 0:I.orderDetails,N.couponCode,null==k||null===(l=k.Address_data)||void 0===l?void 0:l.length),o.Z.additionalEvents("different-address-selected",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)},children:[(0,r.jsx)("input",{type:"radio",defaultChecked:(null==k||null===(_=k.selectedAddress)||void 0===_?void 0:_.addressID)===(null==e||null===(C=e.address_obj)||void 0===C?void 0:C.addressID),checked:(null==k||null===(x=k.selectedAddress)||void 0===x?void 0:x.addressID)===(null==e||null===(b=e.address_obj)||void 0===b?void 0:b.addressID),className:"sr-radio",name:"address",id:e.id}),(0,r.jsxs)("label",{htmlFor:e.id,className:"sr-label-card",children:[(0,r.jsx)("div",{style:{width:"20px"},children:(0,r.jsx)("span",{className:"circle-card",style:{width:"16px"},children:(0,r.jsx)("span",{className:"circle-dot"})})}),(0,r.jsxs)("div",{className:"full-width pl-8 pr-4",children:[(0,r.jsxs)("p",{className:t.Z.nameHeading,children:[e.name,(null==e||null===(A=e.tags)||void 0===A?void 0:A.length)>0&&(0,r.jsx)("span",{className:t.Z.tags_pill,children:null!=e&&null!==(E=e.tags)&&void 0!==E&&E.includes("other")?R(null==e||null===(S=e.tags.split(":"))||void 0===S?void 0:S[1]):R(null==e?void 0:e.tags)})]}),(0,r.jsx)("p",{className:t.Z.addressDetail,style:{overflowWrap:"break-word"},children:e.address1}),(null===(D=e.address_obj)||void 0===D?void 0:D.email)&&"noreply@shiprocket.com"!==e.address_obj.email&&(0,r.jsxs)("p",{className:t.Z.addressDetail,children:[" ",e.address_obj.email]})]})]})]}),(0,r.jsxs)("div",{style:{width:"20px",display:"flex",alignItems:"center",flexDirection:"column"},children:[(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:"./assets/images/threeDot.svg",onClick:l=>{l.preventDefault(),null==e||e.setActiveMenuIndex((l=>e.index===l?"":e.index)),F((e=>1^e))},style:{cursor:"pointer"}})}),(null==e?void 0:e.activeMenuIndex)===e.index?(0,r.jsxs)("div",{className:(null==e?void 0:e.activeMenuIndex)===e.index?t.Z.dropdownMenuActive:t.Z.dropdownMenu,children:[(0,r.jsx)("span",{className:t.Z.dropdownOption,onClick:l=>{l.preventDefault(),l.stopPropagation(),e.setEditAddressData(e.address_obj),console.log("Edit",e.address_obj),console.log(e.address_obj),e.setEditAddress(!0),e.setTitle("Edit address"),k.addressUpdated=!1,k.addressUpdateFail=!1,o.Z.additionalEvents("edit-address",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)},children:"Edit"}),T.fetchAddressPermission&&(0,r.jsx)("span",{className:t.Z.dropdownOption,onClick:l=>{l.preventDefault(),l.stopPropagation(),e.setDeleteVisible(!0),P.isAnyModalOpen=!0,e.setDeleteID(),o.Z.additionalEvents("delete-address",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)},children:"Delete"})]}):(0,r.jsx)(r.Fragment,{})]})]}):(0,r.jsxs)("div",{className:"".concat(t.Z.row," ").concat((null==k||null===(l=k.selectedAddress)||void 0===l?void 0:l.addressID)===(null==e||null===(i=e.address_obj)||void 0===i?void 0:i.addressID)?t.Z.selected:""),onClick:e=>{var l;w(),o.Z.savedAddressChanged(null==I?void 0:I.orderDetails,N.couponCode,null==k||null===(l=k.Address_data)||void 0===l?void 0:l.length),o.Z.additionalEvents("different-address-selected",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)},children:[(0,r.jsx)("input",{type:"radio",defaultChecked:(null==k||null===(s=k.selectedAddress)||void 0===s?void 0:s.addressID)===(null==e||null===(u=e.address_obj)||void 0===u?void 0:u.addressID),className:"sr-radio",name:"address",id:e.id}),(0,r.jsxs)("label",{htmlFor:e.id,className:"sr-label",children:[(0,r.jsx)("div",{style:{width:"20px"},children:(0,r.jsx)("span",{className:"circle",style:{width:"16px",borderColor:(null==k||null===(c=k.selectedAddress)||void 0===c?void 0:c.addressID)===(null==e||null===(v=e.address_obj)||void 0===v?void 0:v.addressID)?"var(--primary-color)":""},children:(0,r.jsx)("span",{className:"circle-dot",style:{backgroundColor:(null==k||null===(m=k.selectedAddress)||void 0===m?void 0:m.addressID)===(null==e||null===(g=e.address_obj)||void 0===g?void 0:g.addressID)?"var(--primary-color)":""}})})}),(0,r.jsxs)("div",{className:"full-width",style:{paddingLeft:"12px"},children:[(0,r.jsxs)("p",{className:"grey-dark h3 semi-bold mb-3",children:[(0,r.jsx)("strong",{children:e.name}),(null==e||null===(p=e.tags)||void 0===p?void 0:p.length)>0&&(0,r.jsx)("span",{className:t.Z.tags_pill,children:null!=e&&null!==(h=e.tags)&&void 0!==h&&h.includes("other")?R(null==e||null===(y=e.tags.split(":"))||void 0===y?void 0:y[1]):R(null==e?void 0:e.tags)})]}),(0,r.jsx)("p",{className:"h3 grey-dark light",style:{overflowWrap:"break-word",width:"90%"},children:e.address1}),(null===(f=e.address_obj)||void 0===f?void 0:f.email)&&"noreply@shiprocket.com"!==e.address_obj.email&&(0,r.jsxs)("p",{className:"h3 grey-dark light",children:[" ",e.address_obj.email]}),(0,r.jsx)("span",{onClick:l=>{l.preventDefault(),l.stopPropagation(),e.setEditAddressData(e.address_obj),e.setEditAddress(!0),e.setTitle("Edit address"),k.addressUpdated=!1,k.addressUpdateFail=!1,o.Z.additionalEvents("edit-address",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,r.jsx)("img",{src:"./assets/images/edit-icon.svg",alt:"edit-icon",style:{marginTop:"10px"}})}),T.fetchAddressPermission&&(0,r.jsx)("span",{onClick:l=>{l.preventDefault(),l.stopPropagation(),e.setDeleteVisible(!0),P.isAnyModalOpen=!0,e.setDeleteID(),o.Z.additionalEvents("delete-address",null==I?void 0:I.Cart_data,N.couponCode,!!d.y.getItem("refreshToken"),!1)},children:(0,r.jsx)("img",{src:"./assets/images/delete-icon.svg",alt:"delete-icon",style:{marginTop:"10px",marginLeft:"10px"}})})]})]})]})})},u=n.memo(s);var c=i(2878),v=i(6280),m=i(2855),g=i(3960),p=i(9079),h=i(1094),y=i(7083),f=i(2718),_=i(7348),C=i(5402);const x=e=>{var l;const[i,s]=(0,n.useState)(!1),[x,b]=(0,n.useState)(!0),[A,E]=(0,n.useState)(!1),[S,D]=(0,n.useState)(!1),[w,N]=(0,n.useState)(!1),[I,k]=(0,n.useState)(""),[T,P]=(0,n.useState)(!1),j=(0,a.v9)((e=>e.Delivery)),[F,R]=(0,n.useState)(""),L=(0,a.I0)(),O=(0,a.v9)((e=>e.Address)),M=(0,a.v9)((e=>e.Shipping)),U=(0,a.v9)((e=>e.Login)),Z=(0,a.v9)((e=>e.Otp)),B=(0,a.v9)((e=>e.Cart)),H=(0,a.v9)((e=>e.Coupon));let V=O.Address_data,G=null===(l=O.Address_data)||void 0===l?void 0:l.length;const[W,q]=(0,n.useState)({});(0,n.useEffect)((()=>{L(z)}),[]);const z=async()=>{s(!0)};(0,n.useEffect)((()=>{B.fireSetuRequest=!1}),[]),(0,n.useEffect)((()=>{var e;O.allAddressFetched||L((0,v.uz)(null===(e=U.userInfo)||void 0===e?void 0:e.user_id,Z.fetchAddressPermission,O.isAddressSavedCalled,U.sellerConfig.seller_id,U.sellerConfig.blockOldAddress))}),[O.allAddressFetched]),(0,n.useEffect)((()=>{0===G&&O.allAddressFetched&&E(!0)}),[G,O.allAddressFetched]),(0,n.useEffect)((()=>{console.log("Okays",I)}),[I]);let Y;(0,n.useEffect)((()=>{U.otpSkip&&(D(!0),q(null==O?void 0:O.selectedAddress))}),[null==U?void 0:U.otpSkip]),!O.allAddressFetched||M.serviceFetching||B.orderFetching?(O.fetchingAllAddress||M.serviceFetching||B.orderFetching)&&(Y=(0,r.jsxs)("div",{children:[(0,r.jsx)(g.Z,{alertMessage:"Fetching addresses...",type:"loading"}),(0,r.jsx)(m.Z,{})]})):Y=0===V.length&&O.allAddressFetched?(0,r.jsx)("div",{className:"mb-10",children:"No Address Found"}):null==V?void 0:V.map(((l,i)=>{var n,t,o;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u,{onSelectAddressMethod:e.onSelectAddressMethod,SetIsOpen:e.SetIsOpen,name:"".concat(null!==(n=null==l?void 0:l.firstName)&&void 0!==n?n:"Customer"," ").concat(null!==(t=null==l?void 0:l.lastName)&&void 0!==t?t:""),email:null==l?void 0:l.email,tags:null==l?void 0:l.tags,address1:(null==l?void 0:l.line1)+", "+(null!=l&&l.line2?(null==l?void 0:l.line2)+", ":"")+(null!=l&&l.landmark?"Landmark - "+(null==l?void 0:l.landmark)+", ":"")+(null==l?void 0:l.city)+", "+(null==l?void 0:l.state)+", "+(null==l?void 0:l.pincode)+(null!=U&&null!==(o=U.sellerConfig)&&void 0!==o&&o.enableAdrrPhone&&null!=l&&l.alternatePhone?", Ph: ".concat(null==l?void 0:l.alternatePhone):""),index:i,address_obj:l,customer_id:U.userInfo.user_id,count:G,selectedAddress:e.addressToShow,setEditAddressData:q,setEditAddress:D,setTitle:e.SetTitle,setDeleteVisible:N,setDeleteID:()=>k(l.addressID),activeMenuIndex:F,setActiveMenuIndex:R},null==l?void 0:l.addressID)})}));const Q=(0,n.useCallback)((()=>{var l;j.wrongPincode=!1,B.fireSetuRequest=!1,O.fail=!1,O.failMsg=null,E(!0),o.Z.addNewAddressClicked(B.orderDetails,null==H?void 0:H.couponCode,null==O||null===(l=O.Address_data)||void 0===l?void 0:l.length),o.Z.additionalEvents("add-new-address-clicked",null==B?void 0:B.Cart_data,H.couponCode,!!d.y.getItem("refreshToken"),!1),o.Z.newAddressDrawerOpened(),U.AuthTokenGenerated=!1,O.Updated_address_data={},e.SetTitle("Add new address")}),[]);return(0,r.jsx)(r.Fragment,{children:A?(0,r.jsx)(r.Fragment,{children:null!=U&&null!==(J=U.sellerConfig)&&void 0!==J&&J.landmarkMandatory||null==U||null===(K=U.sellerConfig)||void 0===K||!K.addressLayoutNew?(0,r.jsx)(c.Z,{SetIsOpen:e.SetIsOpen,setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading}):(0,r.jsx)(_.Z,{SetIsOpen:e.SetIsOpen,setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading})}):S?(0,r.jsx)(r.Fragment,{children:null!=U&&null!==($=U.sellerConfig)&&void 0!==$&&$.landmarkMandatory||null==U||null===(X=U.sellerConfig)||void 0===X||!X.addressLayoutNew?(0,r.jsx)(p.default,{SetIsOpen:e.SetIsOpen,setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading,setEditAddress:D,editAddressData:W}):(0,r.jsx)(C.Z,{SetIsOpen:e.SetIsOpen,setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading,setEditAddress:D,editAddressData:W})}):(0,r.jsxs)("div",{className:t.Z.addressContainer,children:[(0,r.jsxs)("p",{className:"mb-18 h3 light",children:["Including addresses related to ",(0,r.jsx)("b",{children:function(e){const l=e.slice(0,5),i=e.slice(5);return"+91 ".concat(l," ").concat(i)}(U.mobileNumber)})," where Shiprocket has previously delivered orders."]}),(0,r.jsxs)("div",{className:null!=B&&B.cardDesignEnabled?"d-flex":"d-flex space-between",style:{marginBottom:null!=B&&B.cardDesignEnabled?"8px":"",justifyContent:null!=B&&B.cardDesignEnabled?"flex-end":""},children:[!(null!=B&&B.cardDesignEnabled)&&(0,r.jsx)("div",{className:"h2 semi-bold",children:"All addresses"}),Z.fetchAddressPermission&&(null!=B&&B.cardDesignEnabled?(0,r.jsx)("button",{className:"card-primary-button btn-link",onClick:Q,children:"Add new address"}):(0,r.jsx)("div",{className:"btn-link semi-bold",onClick:Q,children:"+ Add new"}))]}),Y,!(null!=B&&B.cardDesignEnabled)&&(0,r.jsx)("div",{className:t.Z.extraDiv}),w&&(0,r.jsx)(h.Z,{setDeleteVisible:N,setDeleteID:()=>k(""),deleteAddress:async()=>{try{var e;P(!0),await y.Z.put(f.Z.DELETE_ADDRESS(U.userInfo.user_id,I,U.mobileNumber),{addressID:I},null==U||null===(e=U.sellerConfig)||void 0===e?void 0:e.seller_id)&&(O.allAddressFetched=!1,M.serviceFetched=!1,B.orderFetched=!1,N(!1),U.isAnyModalOpen=!1,P(!1),k(""),o.Z.additionalEvents("address-deleted",null==B?void 0:B.Cart_data,H.couponCode,!!d.y.getItem("refreshToken"),!1)),R("")}catch(e){P(!1),R("")}},deletingAddress:T})]})});var J,K,$,X}},6809:(e,l,i)=>{i.d(l,{Z:()=>a}),i(7313);var n=i(6352),t=i(6417);const o=e=>{let{id:l,label:i,callback:o,selectedTag:a,error:d}=e;const r=(0,n.v9)((e=>e.Cart)),s=null!=r&&r.cardDesignEnabled?"sr-label-card":"sr-label";return console.log(d,"adhjadfjadfjad"),(0,t.jsxs)("div",{onClick:()=>{o(l)},style:{width:100,cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",defaultChecked:l===a,checked:l===a,className:"sr-radio",name:l}),(0,t.jsxs)("label",{htmlFor:l,className:"".concat("Radio_radioWrapper__psCvC"," ").concat(s),children:[(0,t.jsx)("div",{style:{width:"20px"},children:(0,t.jsx)("span",{className:"circle-card",style:{width:"16px",borderColor:d?"#616161":""},children:(0,t.jsx)("span",{className:"circle-dot"})})}),(0,t.jsx)("div",{style:{marginTop:4,fontSize:14},children:i})]})]})},a=e=>{let{selectedTag:l,handleAddressTag:i,error:a}=e;(0,n.v9)((e=>e.Cart));const d=[{key:"home",value:"Home"},{key:"office",value:"Office"},{key:"others",value:"Others"}];return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{style:{color:"#2F2F2F",fontSize:12,fontWeight:500,lineHeight:3},children:"Address type"}),(0,t.jsx)("div",{className:"d-flex",children:null==d?void 0:d.map((e=>(0,t.jsx)(o,{id:e.key,selectedTag:l,label:e.value,callback:i,error:a})))})]})}},8605:(e,l,i)=>{i.d(l,{gR:()=>t,DJ:()=>o,K7:()=>a,Tw:()=>d});var n=i(6417);const t=e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",children:(0,n.jsx)("path",{d:"M5.0549 10.4731H7.05926C7.12148 10.4735 7.18315 10.4616 7.24075 10.438C7.29834 10.4145 7.35073 10.3799 7.3949 10.3361L10.6662 7.06102L12.0087 5.74722C12.053 5.70328 12.0882 5.65101 12.1122 5.59343C12.1362 5.53584 12.1486 5.47407 12.1486 5.41168C12.1486 5.34929 12.1362 5.28752 12.1122 5.22993C12.0882 5.17234 12.053 5.12007 12.0087 5.07614L10.0044 3.04873C9.96041 3.00443 9.90812 2.96927 9.85052 2.94528C9.79291 2.92129 9.73112 2.90894 9.66872 2.90894C9.60631 2.90894 9.54452 2.92129 9.48692 2.94528C9.42931 2.96927 9.37703 3.00443 9.33308 3.04873L7.99999 4.38616L4.71926 7.66121C4.67545 7.70537 4.64079 7.75774 4.61726 7.81532C4.59374 7.8729 4.58181 7.93455 4.58217 7.99675V10.0005C4.58217 10.1259 4.63198 10.2461 4.72063 10.3347C4.80929 10.4233 4.92953 10.4731 5.0549 10.4731ZM9.66872 4.05062L11.0065 5.38805L10.3353 6.05913L8.99745 4.7217L9.66872 4.05062ZM5.52763 8.19051L8.3309 5.38805L9.66872 6.72548L6.86545 9.52794H5.52763V8.19051ZM12.6185 11.4183H4.10945C3.98407 11.4183 3.86383 11.4681 3.77518 11.5567C3.68652 11.6453 3.63672 11.7656 3.63672 11.8909C3.63672 12.0162 3.68652 12.1364 3.77518 12.2251C3.86383 12.3137 3.98407 12.3635 4.10945 12.3635H12.6185C12.7439 12.3635 12.8642 12.3137 12.9528 12.2251C13.0415 12.1364 13.0913 12.0162 13.0913 11.8909C13.0913 11.7656 13.0415 11.6453 12.9528 11.5567C12.8642 11.4681 12.7439 11.4183 12.6185 11.4183Z",fill:e})}),o=e=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:[(0,n.jsx)("g",{"clip-path":"url(#clip0_6239_115275)",children:(0,n.jsx)("path",{d:"M5.95898 3.79158H7.04232V4.87492H5.95898V3.79158ZM5.95898 5.95825H7.04232V9.20825H5.95898V5.95825ZM6.50065 1.08325C3.51065 1.08325 1.08398 3.50992 1.08398 6.49992C1.08398 9.48992 3.51065 11.9166 6.50065 11.9166C9.49065 11.9166 11.9173 9.48992 11.9173 6.49992C11.9173 3.50992 9.49065 1.08325 6.50065 1.08325ZM6.50065 10.8333C4.1119 10.8333 2.16732 8.88867 2.16732 6.49992C2.16732 4.11117 4.1119 2.16659 6.50065 2.16659C8.8894 2.16659 10.834 4.11117 10.834 6.49992C10.834 8.88867 8.8894 10.8333 6.50065 10.8333Z",fill:e})}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"clip0_6239_115275",children:(0,n.jsx)("rect",{width:"13",height:"13",fill:"white"})})})]}),a=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,n.jsx)("rect",{y:"0.500031",width:"15.5",height:"15.5",rx:"7.75",fill:"#D1FADF"}),(0,n.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.04 5.27278L6.41583 9.73549L5.18875 8.42445C4.9627 8.21132 4.6075 8.1984 4.34916 8.37924C4.09729 8.56653 4.02625 8.8959 4.18125 9.1607L5.63437 11.5244C5.77645 11.744 6.02187 11.8797 6.29958 11.8797C6.56437 11.8797 6.81625 11.744 6.95833 11.5244C7.19083 11.2209 11.6277 5.93153 11.6277 5.93153C12.209 5.33736 11.505 4.81424 11.04 5.26632V5.27278Z",fill:"#12B76A"})]}),d=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[(0,n.jsx)("rect",{y:"0.0800781",width:"32",height:"31.2816",rx:"15.6408",fill:"#2E2E2E"}),(0,n.jsx)("path",{d:"M11 19.8722L15.6778 15.2994L20.3556 19.8722M20.3556 10.7266L15.6769 15.2994L11 10.7266",stroke:"#F8F8F8","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})},1094:(e,l,i)=>{i.d(l,{Z:()=>r});const n="DeleteModal_body__-16Uz";var t=i(3061),o=i(2855),a=i(6352),d=i(6417);function r(e){const l=(0,a.v9)((e=>e.Cart)),i=(0,a.v9)((e=>e.Login));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"DeleteModal_backDrop__gmKp-"}),(0,d.jsx)("div",{className:(0,t.Z)(null!=l&&l.cardDesignEnabled?"DeleteModal_modalCard__io+gZ":"DeleteModal_modal__UNixP"),children:null!=l&&l.cardDesignEnabled?(0,d.jsxs)("div",{className:n,children:[(0,d.jsx)("img",{src:"./assets/images/deleteAddress.gif",alt:"delete-icon",style:{position:"absolute",top:"-52px",height:"97px",width:"97px"}}),(0,d.jsx)("h4",{style:{marginTop:"30px"},className:"DeleteModal_titleCard__JcuHs",children:"Delete address"}),(0,d.jsx)("h5",{className:"DeleteModal_subtitleCrad__Srd7e",children:"Are you sure, you want to delete your saved address?"}),(0,d.jsxs)("div",{className:"DeleteModal_actionWrapperCard__9yd8Z",children:[(0,d.jsx)("button",{className:"DeleteModal_confirmButtonCard__kDC7T",onClick:()=>e.deleteAddress(),children:e.deletingAddress?(0,d.jsx)(o.Z,{smallLoader:"small",noMarginTop:"-3px",margin:"0 auto"}):"Yes"}),(0,d.jsx)("button",{className:"DeleteModal_deleteButtonCard__D9hRR",onClick:()=>{e.setDeleteVisible(!1),i.isAnyModalOpen=!1,e.setDeleteID()},children:"No"})]})]}):(0,d.jsxs)("div",{className:n,children:[(0,d.jsx)("img",{src:"https://d10srchmli830n.cloudfront.net/1674393793181_fc5da3ed-42a1-4504-8ae1-7b5dc42a4021_Group-27717Delete.svg",alt:"delete-icon"}),(0,d.jsx)("h4",{className:"DeleteModal_title__ett+2",children:"Delete address"}),(0,d.jsx)("h5",{className:"DeleteModal_subtitle__p3FH3",children:"Are you sure, you want to delete your saved address?"}),(0,d.jsxs)("div",{className:"DeleteModal_actionWrapper__D31xU",children:[(0,d.jsx)("button",{className:"DeleteModal_deleteButton__sdQDd",onClick:()=>{e.setDeleteVisible(!1),i.isAnyModalOpen=!1,e.setDeleteID()},children:"No"}),(0,d.jsx)("button",{className:"DeleteModal_confirmButton__a-HLu",onClick:()=>e.deleteAddress(),children:e.deletingAddress?(0,d.jsx)(o.Z,{smallLoader:"small",noMarginTop:"-3px",margin:"0 auto"}):"Yes"})]})]})})]})}},2878:(e,l,i)=>{i.d(l,{Z:()=>A});var n=i(7313);const t="Delivery_addressDiv__h-Uid";var o=i(9369),a=i(528),d=i(6352),r=i(6280),s=i(3826),u=i(3624),c=i(5637),v=i(2836),m=i(7075),g=i(2855),p=i(1805),h=i(3366),y=i(1608),f=i(4460),_=i(7088),C=i(2183),x=i(6809),b=i(6417);const A=e=>{var l,i,A,E,S,D,w,N,I,k,T,P,j,F,R;const L=window.location.search;let O=new URLSearchParams(L);const[M,U]=(0,n.useState)(!1),[Z,B]=(0,n.useState)(!1),[H,V]=(0,n.useState)(!1),[G,W]=(0,n.useState)(!1),[q,z]=(0,n.useState)(!1),[Y,Q]=(0,n.useState)(0),[J,K]=(0,n.useState)(!0),$=()=>Q((e=>1^e)),X=(0,d.v9)((e=>e.Delivery)),ee=((0,d.v9)((e=>e.Coupon)),(0,d.v9)((e=>e.Otp))),le=(0,d.v9)((e=>e.Address)),ie=(0,d.v9)((e=>e.Cart)),ne=(0,d.v9)((e=>e.Login)),te=(0,d.v9)((e=>e.Shipping)),[oe,ae]=(0,n.useState)(!0),[de,re]=(0,n.useState)(!1),[se,ue]=(0,n.useState)([]),[ce,ve]=(0,n.useState)(!1),[me,ge]=(0,n.useState)("home"),[pe,he]=(0,n.useState)(!1),[ye,fe]=(0,n.useState)(!1),[_e,Ce]=(0,n.useState)(ne.mobileNumber?ne.mobileNumber:ee.mobile_no?ee.mobile_no:""),[xe,be]=(0,n.useState)(!1),[Ae,Ee]=(0,n.useState)(!1),[Se,De]=(0,n.useState)(""),we=(null===(l=ne.sellerConfig)||void 0===l?void 0:l.addressAllowSpecialCharacter)&&(null==ne||null===(i=ne.sellerConfig)||void 0===i?void 0:i.enabledFeatureCodForm),[Ne,Ie]=(0,n.useState)({city:"",state:"",name:"",lastName:"",gender:"",email:"",line1:"",line2:"",landmark:"",completeAdd:"",tags:""}),[ke,Te]=(0,n.useState)(""),[Pe,je]=(0,n.useState)(""),Fe=(0,d.I0)(),Re={pincode:"Please enter a valid 6 digit Pincode",name:"Enter your first name",lastName:"Enter your last name",line1:"Enter required address details",line2:"Enter required address details",landmark:"Enter a landmark",city:"Enter your City",email:"Enter valid email",contact:"Please enter a valid 10 digit phone number",gender:"Please select your gender",tags:"Enter a valid value"},[Le,Oe]=(0,n.useState)({name:Re.name,lastName:Re.lastName,gender:null!=ne&&null!==(A=ne.sellerConfig)&&void 0!==A&&A.genderInAddressEnabled?Re.gender:"",line1:Re.line1,line2:Re.line2,landmark:null!=ne&&null!==(E=ne.sellerConfig)&&void 0!==E&&E.landmarkMandatory?null==Re?void 0:Re.landmark:"",phone:null!=ne&&null!==(S=ne.sellerConfig)&&void 0!==S&&S.enableAdrrPhone?null!=ne&&ne.mobileNumber||ee.mobile_no?"":"Enter your phone number":"",city:Re.city,state:"",email:null!=ne&&null!==(D=ne.sellerConfig)&&void 0!==D&&D.removeEmailFromCodForm?"":null!==(w=ne.sellerConfig)&&void 0!==w&&w.showEmail?Re.email:"",tags:"others"===me?null==Re?void 0:Re.tags:""}),[Me,Ue]=(0,n.useState)({name:"",lastName:"",gender:"",line1:"",line2:"",landmark:"",phone:"",city:"",state:"",email:"",tags:""}),Ze=e=>{"others"===e?(ve(!0),Oe((e=>({...e,tags:Re.tags})))):(ve(!1),Ie((e=>({...e,tags:""}))),Oe((e=>({...e,tags:""}))),Ue((e=>({...e,tags:""})))),ge(e),X.selectedTag=e},Be=(e,l)=>{Oe((i=>({...i,[e]:l})))},He=(e,l)=>{Ue((i=>({...i,[e]:l})))},Ve=(0,n.useMemo)((()=>{let e=!0,l=!0,i=!0;return Object.values(Le).forEach((e=>{""!==e&&(l=!1)})),Object.values(Me).forEach((e=>{""!==e&&(i=!1)})),e=l&&i,Fe({type:"Update_valid_cod_form_address",payload:e}),e}),[Le,Me]);function Ge(e){return Object.keys(e).find((l=>""!==e[l]))}const We=(0,n.useMemo)((()=>{var e;let l="pincode",i=Ge(Le),n=Ge(Me);return l=null!==(e=Object.keys(Le).find((e=>e===i||e===n)))&&void 0!==e?e:"pincode",Fe({type:"Update_first_error_key_address",payload:l}),l}),[Le,Me]),qe=(0,n.useMemo)((()=>X.pincode?X.pincode.length<6&&X.pincode.length>=1||X.pincode.length>6||Z?"Pincode must consist of 6 digit":"":"Enter your pincode"),[X.pincode,Z]);(0,n.useEffect)((()=>{var e,l,i,n;if(y.y.getItem("codFormAddress")&&!pe||O.get("guest-abandon-payload")){if(null!=ne&&null!==(e=ne.sellerConfig)&&void 0!==e&&e.enabledFeatureCodForm&&(null==ee||!ee.verified)){var t,o,a,d,r,s,u,c,v,m,g,p,h,f,_,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,le,te,oe,ae,de,re,se,ue,ce,me,_e,xe,be,Ae,Ee,Se;ye||O.get("guest-abandon-payload")||((0,C.kf)({name:"ADDRESS_PREFILLED_COOKIE",domain:null===(Ee=ne.sellerConfig)||void 0===Ee?void 0:Ee.domainName,payload:{cart_id:null==ie||null===(Se=ie.Cart_data)||void 0===Se?void 0:Se.id}}),fe(!0));const e={address:null==ne||null===(t=ne.initateCheckoutData)||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.cart_create)||void 0===a||null===(d=a.body)||void 0===d||null===(r=d.internalFields)||void 0===r?void 0:r.prefill_address},l=null!=ne&&null!==(s=ne.initateCheckoutData)&&void 0!==s&&null!==(u=s.data)&&void 0!==u&&null!==(c=u.cart_create)&&void 0!==c&&null!==(v=c.body)&&void 0!==v&&null!==(m=v.internalFields)&&void 0!==m&&m.prefill_address?e:JSON.parse(y.y.getItem("codFormAddress"));var De,we,Ne,Ie,ke,Te;if(Ye(null!==(g=null==l||null===(p=l.address)||void 0===p?void 0:p.pincode)&&void 0!==g?g:""),$e("name",null!=l&&null!==(h=l.address)&&void 0!==h&&h.firstName?null==l||null===(f=l.address)||void 0===f?void 0:f.firstName:null!=l&&null!==(_=l.address)&&void 0!==_&&_.fullName?null==l||null===(x=l.address)||void 0===x?void 0:x.fullName:""),$e("lastName",null!==(b=null==l||null===(A=l.address)||void 0===A?void 0:A.lastName)&&void 0!==b?b:""),$e("line1",null!=l&&null!==(E=l.address)&&void 0!==E&&E.line1?null==l||null===(S=l.address)||void 0===S?void 0:S.line1:null!=l&&null!==(D=l.address)&&void 0!==D&&D.fullAddressLine?null==l||null===(w=l.address)||void 0===w?void 0:w.fullAddressLine:""),$e("line2",null!==(N=null==l||null===(I=l.address)||void 0===I?void 0:I.line2)&&void 0!==N?N:""),null!=ne&&null!==(k=ne.sellerConfig)&&void 0!==k&&k.removeEmailFromCodForm||$e("email",null!==(De=null==l||null===(we=l.address)||void 0===we?void 0:we.email)&&void 0!==De?De:""),he(!0),null!=ne&&null!==(T=ne.sellerConfig)&&void 0!==T&&T.landmarkMandatory&&$e("landmark",null!==(Ne=null==l||null===(Ie=l.address)||void 0===Ie?void 0:Ie.landmark)&&void 0!==Ne?Ne:""),null!=ne&&null!==(P=ne.sellerConfig)&&void 0!==P&&P.genderInAddressEnabled&&$e("gender",null!==(ke=null==l||null===(Te=l.address)||void 0===Te?void 0:Te.gender)&&void 0!==ke?ke:""),null!=ne&&null!==(j=ne.sellerConfig)&&void 0!==j&&j.enableAdrrPhone){var Pe,je,Re,Le,Oe,Me,Ue,Ze,Ve,Ge,We,qe;Ce(null!==(Pe=null==l||null===(je=l.address)||void 0===je?void 0:je.alternatePhone)&&void 0!==Pe?Pe:"");let e=!1;e=!!((null==l||null===(Re=l.address)||void 0===Re||null===(Le=Re.alternatePhone)||void 0===Le?void 0:Le.length)>0&&0===Number(null==l||null===(Oe=l.address)||void 0===Oe||null===(Me=Oe.alternatePhone)||void 0===Me?void 0:Me[0])),0===(null==l||null===(Ue=l.address)||void 0===Ue||null===(Ze=Ue.alternatePhone)||void 0===Ze?void 0:Ze.length)?Be("phone","Enter your phone number"):Be("phone",""),10!==(null==l||null===(Ve=l.address)||void 0===Ve||null===(Ge=Ve.alternatePhone)||void 0===Ge?void 0:Ge.length)||e?0===(null==l||null===(We=l.address)||void 0===We||null===(qe=We.alternatePhone)||void 0===qe?void 0:qe.length)?He("phone",""):He("phone","Please enter valid phone number"):He("phone","")}let i;var ze,Qe,Je;let n;var Ke,Xe,el,ll;null!=l&&null!==(F=l.address)&&void 0!==F&&F.tags?(i="home"===(null==l||null===(ze=l.address)||void 0===ze?void 0:ze.tags)||"office"===(null==l||null===(Qe=l.address)||void 0===Qe?void 0:Qe.tags)?null==l||null===(Je=l.address)||void 0===Je?void 0:Je.tags:"others",ve(!0)):(i="home",ve(!1)),ge(i),X.selectedTag=i,n=null!=l&&null!==(R=l.address)&&void 0!==R&&R.tags&&null!=l&&null!==(L=l.address)&&void 0!==L&&null!==(M=L.tags)&&void 0!==M&&M.includes("other")?null==l||null===(Ke=l.address)||void 0===Ke||null===(Xe=Ke.tags)||void 0===Xe||null===(el=Xe.split(":"))||void 0===el||null===(ll=el[1])||void 0===ll?void 0:ll.trim():"",$e("tags",null!==(U=n)&&void 0!==U?U:""),X.tagValue=n;const ee={name:null!=l&&null!==(Z=l.address)&&void 0!==Z&&Z.firstName?null==l||null===(B=l.address)||void 0===B?void 0:B.firstName:null!=l&&null!==(H=l.address)&&void 0!==H&&H.fullName?null==l||null===(V=l.address)||void 0===V?void 0:V.fullName:"",lastName:null!==(G=null==l||null===(W=l.address)||void 0===W?void 0:W.lastName)&&void 0!==G?G:"",...(null==ne||null===(q=ne.sellerConfig)||void 0===q?void 0:q.genderInAddressEnabled)&&{gender:null!==(z=null==l||null===(Y=l.address)||void 0===Y?void 0:Y.gender)&&void 0!==z?z:""},line1:null!=l&&null!==(Q=l.address)&&void 0!==Q&&Q.line1?null==l||null===(J=l.address)||void 0===J?void 0:J.line1:null!=l&&null!==(K=l.address)&&void 0!==K&&K.fullAddressLine?null==l||null===($=l.address)||void 0===$?void 0:$.fullAddressLine:"",line2:null!==(le=null==l||null===(te=l.address)||void 0===te?void 0:te.line2)&&void 0!==le?le:"",...!(null!=ne&&null!==(oe=ne.sellerConfig)&&void 0!==oe&&oe.removeEmailFromCodForm)&&{email:null!==(ae=null==l||null===(de=l.address)||void 0===de?void 0:de.email)&&void 0!==ae?ae:""},...(null==ne||null===(re=ne.sellerConfig)||void 0===re?void 0:re.landmarkMandatory)&&{landmark:null!==(se=null==l||null===(ue=l.address)||void 0===ue?void 0:ue.landmark)&&void 0!==se?se:""},pincode:null==l||null===(ce=l.address)||void 0===ce?void 0:ce.pincode,...(null==ne||null===(me=ne.sellerConfig)||void 0===me?void 0:me.enableAdrrPhone)&&{phoneNumber:null!==(_e=null==l||null===(xe=l.address)||void 0===xe?void 0:xe.alternatePhone)&&void 0!==_e?_e:""},selectedTag:null!==(be=i)&&void 0!==be?be:"home",tagValue:null!==(Ae=n)&&void 0!==Ae?Ae:"",tags:"others"===i?n:i};Fe({type:"update_delivery_add_cod_form",payload:ee})}}else null==ne||null===(l=ne.sellerConfig)||void 0===l||!l.enabledFeatureCodForm||null!=ee&&ee.verified||ye||((0,C.kf)({name:"ADDRESS_FILLED_MANUALLy",domain:null===(i=ne.sellerConfig)||void 0===i?void 0:i.domainName,payload:{cart_id:null==ie||null===(n=ie.Cart_data)||void 0===n?void 0:n.id}}),fe(!0)),he(!0)}),[y.y.getItem("codFormAddress"),null==ne||null===(N=ne.sellerConfig)||void 0===N?void 0:N.enabledFeatureCodForm,!(null!=ee&&ee.verified),null===(I=ne.initateCheckoutData)||void 0===I||null===(k=I.data)||void 0===k||null===(T=k.cart_create)||void 0===T||null===(P=T.body)||void 0===P||null===(j=P.internalFields)||void 0===j?void 0:j.prefill_address]);const ze=(0,n.useMemo)((()=>X.wrongPincode?"Please enter a valid pincode":""),[X.wrongPincode]);(0,n.useEffect)((()=>{null!==le.failMsg&&(Ne.line1="",Ne.line2="",X.Pincode_data={},X.pincode="",ne.addSilentUserAddress=!1,e.onRender(),$(),de||(m.Z.pincodeFieldDisplayed(),console.log("hi parv")),re(!0))}),[le.failMsg]),(0,n.useEffect)((()=>{null!==le.invalidEmail&&(Ne.email="",ne.addSilentUserAddress=!1,e.onRender())}),[le.invalidEmail]),(0,n.useEffect)((()=>{var l,i,n,t,o,a,d,r,s;null!=le&&le.selectedAddress&&null!=ie&&null!==(l=ie.orderDetails)&&void 0!==l&&l.id&&e.setAddressToShow({name:"".concat(null!==(i=null==le?void 0:le.selectedAddress.firstName)&&void 0!==i?i:"Customer"," ").concat(null!==(n=null==le?void 0:le.selectedAddress.lastName)&&void 0!==n?n:""),email:null==le?void 0:le.selectedAddress.email,address:"".concat(null==le?void 0:le.selectedAddress.line1,", ").concat(null!=le&&null!==(t=le.selectedAddress)&&void 0!==t&&t.line2?(null==le||null===(o=le.selectedAddress)||void 0===o?void 0:o.line2)+",":""," ").concat(null!=le&&null!==(a=le.selectedAddress)&&void 0!==a&&a.landmark?"Landmark-"+(null==le||null===(d=le.selectedAddress)||void 0===d?void 0:d.landmark)+",":""," ").concat(null==le?void 0:le.selectedAddress.city,", ").concat(null==le?void 0:le.selectedAddress.state,", ").concat(null==le?void 0:le.selectedAddress.pincode),address_id:null==le?void 0:le.selectedAddress.addressID,customer_id:ne.userInfo.user_id,count:"",index:"",alternatePhone:null===(r=le.selectedAddress)||void 0===r?void 0:r.alternatePhone,tags:null===(s=le.selectedAddress)||void 0===s?void 0:s.tags})}),[JSON.stringify(null==le?void 0:le.selectedAddress)]);const Ye=e=>{X.wrongPincode=!1,le.fail=!1,X.pincode=e.substring(0,6),$();let l={postcode:e.substring(0,6)};6===e.length&&(m.Z.pincodeAdded(),m.Z.addressFieldsDisplayed(),X.spinner=!0,X.wrongPincode=!1,Fe((0,s.J)(l)))};(0,n.useEffect)((()=>{var e,l,i;null!==(e=X.Pincode_data)&&void 0!==e&&e.success&&(null===(l=document.getElementById("name"))||void 0===l||l.focus(),null!=ee&&ee.verified||null!=ne&&ne.otpSkip||null==ne||null===(i=ne.sellerConfig)||void 0===i||!i.enabledFeatureCodForm||(async()=>{var e,l,i,n,t,o,a,d,r,s,u,v,m,g,p,h,y,f,_,C,x,b,A,E,S;const D={sellerId:ne.sellerConfig.seller_id,codIntent:te.codIntent,address:{phone:null!==(e=null==ne?void 0:ne.mobileNumber)&&void 0!==e?e:"",line1:null!==(l=null==X||null===(i=X.line1)||void 0===i||null===(n=i.replace(/\n/g," "))||void 0===n?void 0:n.trim())&&void 0!==l?l:"",line2:null!==(t=null==X||null===(o=X.line2)||void 0===o||null===(a=o.replace(/\n/g," "))||void 0===a?void 0:a.trim())&&void 0!==t?t:"",gender:null!==(d=null==X?void 0:X.gender)&&void 0!==d?d:"",city:null==X||null===(r=X.city)||void 0===r?void 0:r.trim(),pincode:null==X?void 0:X.pincode,state:null!==(s=null==X||null===(u=X.Pincode_data)||void 0===u||null===(v=u.postcode_details)||void 0===v?void 0:v.state)&&void 0!==s?s:"",country:"IN",sellerID:null===(m=ne.sellerConfig)||void 0===m?void 0:m.seller_id,landmark:null!==(g=null==X||null===(p=X.landmark)||void 0===p?void 0:p.trim())&&void 0!==g?g:"",firstName:null!==(h=null==X||null===(y=X.name)||void 0===y?void 0:y.trim())&&void 0!==h?h:"",lastName:null!==(f=null==X||null===(_=X.lastName)||void 0===_?void 0:_.trim())&&void 0!==f?f:"",email:null!==(C=null==X?void 0:X.email)&&void 0!==C?C:"".concat(null!=ne&&ne.mobileNumber?"".concat(null==ne||null===(x=ne.mobileNumber)||void 0===x?void 0:x.trim(),"@fastrr.com"):""),countryCode:"+91",addressType:["Shipping"],cartId:null==ie||null===(b=ie.Cart_data)||void 0===b?void 0:b.id,...null!=ne&&null!==(A=ne.sellerConfig)&&void 0!==A&&A.enableAdrrPhone?{alternatePhone:null!==(E=null==X?void 0:X.phoneNumber)&&void 0!==E?E:""}:{},tags:"others"===(null==X?void 0:X.selectedTag)?"other: ".concat(null==X?void 0:X.tagValue):null==X?void 0:X.selectedTag,addressID:"random-".concat(null===(S=1e5*Math.random())||void 0===S?void 0:S.toFixed(0))},billingAddress:{}};await Fe((0,c.i)(D,ee.pim_sid_updated,ne.sellerConfig.seller_id)),ie.orderFetched=!1})())}),[X.Pincode_data]),(0,n.useEffect)((()=>{$e("city",X.city)}),[X.city]),(0,n.useEffect)((()=>{try{var e;if(null!=ne&&null!==(e=ne.sellerConfig)&&void 0!==e&&e.addressVerify||null!=le&&le.addressFailMsg){var l,i,n;null===(l=document.getElementById("line1"))||void 0===l||l.focus();const e=(0,_.aW)(Ne.line1,null==ne||null===(i=ne.sellerConfig)||void 0===i?void 0:i.domainName,null==ne||null===(n=ne.sellerConfig)||void 0===n?void 0:n.addressLayoutNew);Be("line1",null==e?void 0:e.errorMessage),He("line1",null==e?void 0:e.activeErrorMessage)}}catch(e){console.log(e)}}),[null==le?void 0:le.addressFailMsg]);const Qe=e=>{e.target.value=e.target.value.replace(/[^0-9]/g,""),e.target.value=e.target.value.substring(0,13);for(var l=document.querySelectorAll('input[type="number"]'),i=l.length;i--;)l[i].setAttribute("pattern","\\d*")},Je=async e=>{let l=e.target.value;Ce(l),X.phoneNumber=l;let i=!1;i=!!(l.length>0&&0===Number(l[0])),0===l.length?Be("phone","Enter your phone number"):Be("phone",""),10!==l.length||i?0===l.length?He("phone",""):He("phone","Please enter valid phone number"):He("phone","")},Ke=(null===(F=X.Pincode_data)||void 0===F||!F.success||X.loader||X.pincode.length<6||X.wrongPincode||"".concat(null!=ie&&ie.cardDesignEnabled?"Delivery_addressTag_selected_card__9f9kI":"Delivery_addressTag_selected__Ie0rx"),!(null!==(R=X.Pincode_data)&&void 0!==R&&R.success)||X.loader||X.pincode.length<6||X.wrongPincode),$e=async(e,l)=>{((e,l)=>{var i,n;const t=null===(i=(null==Ne?void 0:Ne.line1)+(null==Ne?void 0:Ne.line2)+(null==Ne?void 0:Ne.landmark))||void 0===i?void 0:i.match(/[a-zA-Z0-9]/g);if(null!==(n=ne.sellerConfig)&&void 0!==n&&n.addressVerify){var o,a,d;const e=(0,_.r1)(null===(o=ne.sellerConfig)||void 0===o?void 0:o.blockAddressWithInvalidAddressLines,null===(a=ne.sellerConfig)||void 0===a?void 0:a.invalidAddressLineNumber,t,null==ne||null===(d=ne.sellerConfig)||void 0===d?void 0:d.addressLayoutNew);be(null==e?void 0:e.isError),Ee(null==e?void 0:e.isError),De(null==e?void 0:e.errorMessage)}switch(e){case"name":if(!we){var r;if(null!==(r=ne.sellerConfig)&&void 0!==r&&r.addressVerify){var s,u,c,v,m,g;const i=/^(?!\.)([A-Za-z\s.]+)$/,n=/[a-zA-Z0-9]/g,t=l.match(n);""===l?Be(e,"Minimum 1 Character is required"):i.test(l)?" "===(null===(s=l)||void 0===s?void 0:s[0])?Be(e,"Space at the start not allowed"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(u=l)||void 0===u||null===(c=u.toLowerCase())||void 0===c?void 0:c.trim())?Be(e,"Given name is invalid"):"sr-login"===O.get("login")&&l.length>49?Be(e,"First name can’t be longer than 49 characters"):(null==t?void 0:t.length)>60?Be(e,"Character length exceeded"):Be(e,""):Be(e,"Use only alphabets (A-Z, a-z)"),0===l.length?He(e,""):i.test(l)?" "===(null===(v=l)||void 0===v?void 0:v[0])?He(e,"Space at the start not allowed"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(m=l)||void 0===m||null===(g=m.toLowerCase())||void 0===g?void 0:g.trim())?He(e,"Given name is invalid"):"sr-login"===O.get("login")&&l.length>49?Be(e,"First name can’t be longer than 49 characters"):(null==t?void 0:t.length)>60?He(e,"Character length exceeded"):He(e,""):He(e,"Use only alphabets (A-Z, a-z)");break}{const i=/^[A-Za-z\s]+$/;Be(e,""===l?"Enter your first name.":""),0===l.length?He(e,""):"sr-login"===O.get("login")&&l.length<3?Be(e,"First name can’t be smaller than 3 characters"):"sr-login"===O.get("login")&&l.length>49?Be(e,"First name can’t be longer than 49 characters"):" "==l[0]?He(e,"Avoid starting with a space"):i.test(l)?l.length>60?He(e,"First name can’t be longer than 60 characters"):He(e,""):He(e,"Use only alphabets (A-Z, a-z)");break}}""===l.trim()?(Be(e,"First name is required."),He(e,"First name is required.")):(Be(e,""),He(e,""));break;case"lastName":if(!we){var h;if(null!==(h=ne.sellerConfig)&&void 0!==h&&h.addressVerify){var y,C,x,b,A,E,S,D;const i=/^(?!\.)([A-Za-z\s.]+)$/,n=/[a-zA-Z0-9]/g,t=l.match(n);""===l?Be(e,"Minimum 2 character required"):" "==(null===(y=l)||void 0===y?void 0:y[0])?Be(e,"Avoid starting with a space"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(C=l)||void 0===C||null===(x=C.toLowerCase())||void 0===x?void 0:x.trim())?Be(e,"Given name is invalid"):"sr-login"===O.get("login")&&(null===(b=l)||void 0===b?void 0:b.length)<3?Be(e,"Last name can’t be smaller than 3 characters"):"sr-login"===O.get("login")&&(null===(A=l)||void 0===A?void 0:A.length)>49?Be(e,"Last name can’t be longer than 49 characters"):Be(e,""),(null===(E=l)||void 0===E?void 0:E.length)<2?He(e,"Minimum 2 character required"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(S=l)||void 0===S||null===(D=S.toLowerCase())||void 0===D?void 0:D.trim())?He(e,"Given name is invalid"):i.test(l)?(null==t?void 0:t.length)>60?He(e,"Character length exceeded"):He(e,""):He(e,"Use only alphabets (A-Z, a-z)");break}{const i=/^[A-Za-z\s]+$/;Be(e,""===l?"Enter your last name.":""),0===l.length?He(e,""):" "==l[0]?He(e,"Avoid starting with a space"):"sr-login"===O.get("login")&&l.length<3?Be(e,"Last name can’t be smaller than 3 characters"):"sr-login"===O.get("login")&&l.length>49?Be(e,"Last name can’t be longer than 49 characters"):i.test(l)?l.length>60?He(e,"Last name can’t be longer than 60 characters"):He(e,""):He(e,"Use only alphabets (A-Z, a-z)");break}}""===l.trim()?(Be(e,"Last name is required."),He(e,"Last name is required.")):(Be(e,""),He(e,""));break;case"gender":Be(e,""===l?"Select your gender.":"");break;case"landmark":var w,N;if(null!==(w=ne.sellerConfig)&&void 0!==w&&w.addressVerify){var I;const i=(0,_.Ve)(l,null==ne||null===(I=ne.sellerConfig)||void 0===I?void 0:I.landmarkMandatory);Be(e,null==i?void 0:i.errorMessage),He(e,null==i?void 0:i.activeErrorMessage);break}null!=ne&&null!==(N=ne.sellerConfig)&&void 0!==N&&N.landmarkMandatory&&""===l?Be(e,"Enter your landmark"):Be(e,""),""===l?He(e,""):" "==l[0]?He(e,"Avoid starting with a space"):l.length>50?He(e,"Landmark can’t be longer than 50 characters"):He(e,"");break;case"email":var k;if(null!==(k=ne.sellerConfig)&&void 0!==k&&k.addressVerify){var T,P,j,F,R,L;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n=null===(T=l)||void 0===T||null===(P=T.toLowerCase().trim())||void 0===P?void 0:P.split("@")[1];null!==(j=ne.sellerConfig)&&void 0!==j&&j.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?He(e,Re.email):null!==(F=ne.sellerConfig)&&void 0!==F&&F.showEmail&&null!==f.hC&&void 0!==f.hC&&f.hC.includes(n)?He(e,"Invalid email"):He(e,""),null!==(R=ne.sellerConfig)&&void 0!==R&&R.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?Be(e,Re.email):null!==(L=ne.sellerConfig)&&void 0!==L&&L.showEmail&&null!==f.hC&&void 0!==f.hC&&f.hC.includes(n)?Be(e,"Invalid email"):Be(e,"");break}{var M;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;null!==(M=ne.sellerConfig)&&void 0!==M&&M.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?Be(e,Re.email):Be(e,"");break}case"line1":if(!we){var U;if(null!==(U=ne.sellerConfig)&&void 0!==U&&U.addressVerify){var Z,B;le.addressFailMsg=!1;const i=(0,_.aW)(l,null==ne||null===(Z=ne.sellerConfig)||void 0===Z?void 0:Z.domainName,null==ne||null===(B=ne.sellerConfig)||void 0===B?void 0:B.addressLayoutNew);Be(e,null==i?void 0:i.errorMessage),He(e,null==i?void 0:i.activeErrorMessage);break}{var H;const i=/^[ A-Za-z0-9_@./,#&+\-()/\n]{0,255}$/;Te(l.trim().length.toString()),""===l.trim()?Be(e,Re.line1):Be(e,""),""===l.trim()?He(e,""):l.trim().length>255?He(e,"Address line 1 cannot be longer than 255 characters"):i.test(l.trim())?"thehatke.com"===(null==ne||null===(H=ne.sellerConfig)||void 0===H?void 0:H.domainName)&&l.trim().length<4?He(e,"Address line 1 cannot be less than 4 characters"):He(e,""):He(e,"Allowed special characters _ @ . / , # & + - ");break}}""===l.trim()?(Be(e,"Address is required."),He(e,"Address is required.")):(Be(e,""),He(e,""));break;case"line2":if(!we){var V;const i=/^[ A-Za-z0-9_@./,#&+-/\n]{0,170}$/;if(je(l.trim().length.toString()),null!==(V=ne.sellerConfig)&&void 0!==V&&V.addressVerify){const i=(0,_.c2)(l);Be(e,null==i?void 0:i.errorMessage),He(e,null==i?void 0:i.activeErrorMessage);break}var G,W;""===l.replace(/\s/g,"")?Be(e,Re.line2):(null===(G=l)||void 0===G||null===(W=G.trim())||void 0===W?void 0:W.length)<10?Be(e,"Minimum 10 characters required"):Be(e,""),""===l.trim()?He(e,""):l.trim().length>170?He(e,"Address line 2 cannot be longer than 170 characters"):i.test(l.trim())?He(e,""):He(e,"Allowed special characters _ @ . / , # & + - ");break}var q,z;""===l.trim()?(Be(e,"Address is required."),He(e,"Address is required.")):(null===(q=l)||void 0===q||null===(z=q.trim())||void 0===z?void 0:z.length)<10?Be(e,"Minimum 10 characters required"):(Be(e,""),He(e,""));break;case"city":{const i=p.N9;X.city=l,Be(e,""==l?Re.city:""),""==l?He(e,""):" "==l[0]?He(e,"Avoid starting with a space"):i.test(l)?l.length>100?He(e,"City can’t be longer than 100 characters"):He(e,""):He(e,p.bG);break}case"tags":var Y,Q,J;console.log(null===(Y=l)||void 0===Y?void 0:Y.length,"checking input value"),""==(null===(Q=l)||void 0===Q?void 0:Q.trim())&&"others"===me?Be(e,Re.tags):Be(e,""),""===(null===(J=l)||void 0===J?void 0:J.trim())?He(e,""):l.startsWith(" ")?He(e,"Avoid starting with a space"):He(e,"");break;case"contact":""===(l=l.substring(0,10))||10!==l.length?Be(e,Re.contact):Be(e,"")}})(e,l),Ie((i=>({...i,[e]:l}))),X[e]=l},Xe=e=>{var l,i;if(Ne.line1&&Ne.line2&&(null===(l=Ne.line1)||void 0===l?void 0:l.trim())===(null===(i=Ne.line2)||void 0===i?void 0:i.trim()))return be(!0),Ee(!0),void De("Address line1 and address line2 cannot be same");if(!Ve||X.pincode.length<6||X.wrongPincode){var n;if(null===(n=X.Pincode_data)||void 0===n||!n.success||X.loader||X.pincode.length<6||X.wrongPincode){var t;null===(t=document.getElementById("pincode"))||void 0===t||t.focus()}else{var o;const e=["line1","line2","landmark"];var a,d;null!=ne&&null!==(o=ne.sellerConfig)&&void 0!==o&&o.addressVerify&&xe&&!e.includes(We)?(Ee(!0),null===(a=document.getElementById("line2"))||void 0===a||a.focus()):(Ee(!1),null===(d=document.getElementById(We))||void 0===d||d.focus())}}else{var s,u,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D,w,N;te.serviceFetched=!1,ie.orderFetched=!1,e.preventDefault(),le.addingNewAddress=10*Math.random(),ne.addSilentUserAddress=!0,ie.cartAddressUpdated=!1,le.failMsg=null,le.invalidEmail=null,null===(s=document.getElementById("addAddressBtn"))||void 0===s||s.setAttribute("disabled","true");var I=document.getElementById("addAddressBtn");null!=I&&(I.innerHTML="Adding address...");let l=Ne.name,i=Ne.lastName,n={address1:null===(u=Ne.line1)||void 0===u?void 0:u.replace(/[()]/g," "),landmark:Ne.landmark,city:null===(c=X.Pincode_data)||void 0===c||null===(v=c.postcode_details)||void 0===v||null===(m=v.city)||void 0===m||null===(g=m.trim())||void 0===g?void 0:g.replace(/\./g," "),email:Ne.email,fname:l,lname:i,pincode:X.pincode,state:null===(p=X.Pincode_data)||void 0===p||null===(h=p.postcode_details)||void 0===h?void 0:h.state,state_code:"",phone:ne.mobileNumber,mobile:ne.mobileNumber,gender:null!==(y=Ne.gender)&&void 0!==y?y:"",country:"India",country_code:"IN",addressType:["shipping"],seller_id:null===(f=ne.sellerConfig)||void 0===f?void 0:f.seller_id,tags:"others"===me?"other: ".concat(null==Ne?void 0:Ne.tags):me,...(null===(_=ne.sellerConfig)||void 0===_?void 0:_.addressVerify)&&{source:"checkout"}},t={phone:ne.mobileNumber,line1:null===(C=Ne.line1.replace(/\n/g," ").trim())||void 0===C?void 0:C.replace(/[()]/g," "),line2:Ne.line2.replace(/\n/g," ").trim(),gender:null!==(x=Ne.gender)&&void 0!==x?x:"",city:null===(b=X.city.trim())||void 0===b?void 0:b.replace(/\./g," "),pincode:X.pincode,state:null===(A=X.Pincode_data)||void 0===A||null===(E=A.postcode_details)||void 0===E?void 0:E.state,country:"IN",sellerID:null===(S=ne.sellerConfig)||void 0===S?void 0:S.seller_id,landmark:Ne.landmark.trim(),firstName:l.trim(),lastName:i.trim(),addressType:["Shipping"],email:Ne.email,countryCode:"+91",cartId:null==ie||null===(D=ie.Cart_data)||void 0===D?void 0:D.id,alternatePhone:null!=ne&&null!==(w=ne.sellerConfig)&&void 0!==w&&w.enableAdrrPhone&&_e!==ne.mobileNumber&&_e!==ee.mobile_no?_e:null,tags:"others"===me?"other: ".concat(null==Ne?void 0:Ne.tags):me,...(null===(N=ne.sellerConfig)||void 0===N?void 0:N.addressVerify)&&{source:"checkout"}};Ne.completeAdd=Ne.line1+", "+n.city+", "+n.state+", "+X.pincode,ne.AuthTokenGenerated?(le.New_User_Address_Payload=n,ie.showPreferredShipping=!1,Fe((0,r.RQ)(n))):null!=ne&&ne.otpSkip?Fe({type:"SKIP_Otp_Address_add",payload:{...t,emailConfirmed:!0}}):Fe((0,r.Q8)(t,ne.userInfo.user_id,ee.fetchAddressPermission,ne.sellerConfig.seller_id,ne.sellerConfig.blockOldAddress))}};return(0,b.jsx)(b.Fragment,{children:(ne.AuthTokenGenerated&&ie.sendCartInitiate&&(null==ne||null===(il=ne.cartItems)||void 0===il||il.map((e=>({itemId:e.variantId,quantity:e.quantity})))),ne.AuthTokenGenerated&&ie.updateAddressfired&&null!==(el=ie.Cart_data)&&void 0!==el&&el.success&&(()=>{var e,l;let i={cart_id:null===(e=ie.Cart_data)||void 0===e||null===(l=e.data)||void 0===l?void 0:l.cart_id,address_selected:0,address_id:le.Silent_User_Address.data.address_id,customer_id:le.Silent_User_Address.data.customer_id,name:Ne.name,email:Ne.email,address:le.Silent_User_Address.data.address_details,saved_addresses:0};i.address.mobile_no=i.address.mobile,ne.onPage="delivery",i.address.mobile_no||(i.address.mobile_no=ne.mobileNumber)})(),le.addressFetched&&(ne.sellerConfig.seller_id,null===(nl=le.Address_data[0])||void 0===nl||nl.addressID),ne.AuthTokenGenerated&&null!==(ll=ie.UpdatedShipping_data)&&void 0!==ll&&ll.success&&oe&&(ae(!1),e.onRender(),ne.addSilentUserAddress=!1,le.spinner=!1),J?(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{children:[(0===(null==le||null===(tl=le.Address_data)||void 0===tl?void 0:tl.length)||!(null!=le&&le.Address_data))&&(0,b.jsx)(b.Fragment,{children:ne.customLogin?(0,b.jsx)("h4",{style:{margin:"12px 0 8px",fontSize:20,fontWeight:600,paddingBottom:6},children:"Add new address"}):null!=ie&&ie.cardDesignEnabled?(0,b.jsx)("div",{className:"card-main-heading",style:{paddingBottom:"10px"},children:"Add shipping address"}):(0,b.jsx)("h4",{style:{paddingBottom:"10px"},children:"Add shipping address"})}),(null==ne||null===(ol=ne.sellerConfig)||void 0===ol?void 0:ol.enableInternationalAddress)&&(0,b.jsxs)("h5",{style:{paddingBottom:"10px",font:"500 14px/14px var(--font-family)"},children:["Do you like to have your order ",(0,b.jsx)("a",{onClick:()=>(()=>{if(O.get("cart-resume-id")){var e,l;if(p.ZW.wooCommerce===(null==ie||null===(e=ie.platform)||void 0===e?void 0:e.toUpperCase())){var i;let e="http://".concat(null==ne||null===(i=ne.sellerConfig)||void 0===i?void 0:i.domainName,"/checkout");window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:e}}]},"*")}let t="";for(let e of null==ie||null===(n=ie.orderDetails)||void 0===n?void 0:n.lineItems){var n;t=t+e.itemId+":"+e.quantity+","}const o="http://".concat(null==ne||null===(l=ne.sellerConfig)||void 0===l?void 0:l.domainName,"/cart/").concat(t);window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===o[(null==o?void 0:o.length)-1]?null==o?void 0:o.slice(0,(null==o?void 0:o.length)-1):o}}]},"*")}else{var t,o,a,d,r,s,u,c,v;p.ZW.shopify===(null==ne?void 0:ne.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===(null===(t=ne.channel)||void 0===t?void 0:t.redirectUrl[(null===(o=ne.channel)||void 0===o||null===(a=o.redirectUrl)||void 0===a?void 0:a.length)-1])?null===(d=ne.channel)||void 0===d||null===(r=d.redirectUrl)||void 0===r?void 0:r.slice(0,(null===(s=ne.channel)||void 0===s||null===(u=s.redirectUrl)||void 0===u?void 0:u.length)-1):null===(c=ne.channel)||void 0===c?void 0:c.redirectUrl}}]},"*"),p.ZW.wooCommerce===(null==ne?void 0:ne.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null===(v=ne.channel)||void 0===v?void 0:v.redirectUrl}}]},"*")}})(),style:{color:"var(--primary-color)",cursor:"pointer"},children:" shipped outside India?"})]}),(0,b.jsx)("div",{className:null!=ie&&ie.cardDesignEnabled||ne.AuthTokenGenerated?"":"mtNeg-18",children:(0,b.jsx)(o.Z,{label:"Pincode",type:"text",id:"pincode",name:"pincode",value:X.pincode,className:"mt-18",onChange:e=>{e.target.value.match(/^[\d]{0,6}$/g)&&Ye(e.target.value)},disabled:((null==ie?void 0:ie.orderFetching)||te.serviceFetching||X.spinner)&&(null==ne||null===(al=ne.sellerConfig)||void 0===al?void 0:al.enabledFeatureCodForm)&&!(null!=ee&&ee.verified),error:qe,activeErrors:ze,loading:X.spinner,touched:M,autoComplete:"postal-code",mandatory:!0,marginTop:null!=ie&&ie.cardDesignEnabled?"8px":""})}),le.failMsg&&(0,b.jsx)(u.Z,{msg:le.failMsg}),(0,b.jsxs)("div",{children:[(0,b.jsx)(o.Z,{label:"First name",type:"text",id:"name",name:"name",value:Ne.name,className:"mr-10 mt-18",onInput:e=>$e("name",e.target.value),error:Le.name,maxLength:"60",activeErrors:Me.name,disabled:!(null!==(dl=X.Pincode_data)&&void 0!==dl&&dl.success)||X.loader||X.pincode.length<6||X.wrongPincode,autoComplete:"given-name",touched:null==se?void 0:se.includes("name"),setSkipErrorField:ue,mandatory:!0}),(0,b.jsx)(o.Z,{label:"Last name",type:"text",id:"lastName",name:"name",value:Ne.lastName,className:"mr-10 mt-18",maxLength:"60",onInput:e=>$e("lastName",e.target.value),error:Le.lastName,activeErrors:Me.lastName,disabled:!(null!==(rl=X.Pincode_data)&&void 0!==rl&&rl.success)||X.loader||X.pincode.length<6||X.wrongPincode,autoComplete:"family-name",skippedArray:["name"],touched:null==se?void 0:se.includes("lastName"),setSkipErrorField:ue,mandatory:!0}),(null==ne||null===(sl=ne.sellerConfig)||void 0===sl?void 0:sl.genderInAddressEnabled)&&(0,b.jsxs)(h.Z,{id:"gender",label:"Gender",placeholder:"Gender",name:"gender",className:"mt-18",value:Ne.gender,onChange:e=>{$e("gender",e.target.value)},error:Le.gender,disabled:!(null!==(ul=X.Pincode_data)&&void 0!==ul&&ul.success)||X.loader||X.pincode.length<6||X.wrongPincode,touched:null==se?void 0:se.includes("gender"),activeErrors:Me.gender,skippedArray:["name","lastName"],setSkipErrorField:ue,mandatory:!0,children:[(0,b.jsx)("option",{disabled:!0,value:"",hidden:!0,children:null!=ie&&ie.cardDesignEnabled?"":"Select your gender"}),(0,b.jsx)("option",{value:"male",children:"Male"}),(0,b.jsx)("option",{value:"female",children:"Female"})]}),(0,b.jsx)(o.Z,{label:"thehatke.com"!==(null==ne||null===(cl=ne.sellerConfig)||void 0===cl?void 0:cl.domainName)?"Flat, house number, floor, building":"Address line 1 (Flat, house number, floor, building)",type:"textarea",id:"line1",name:"address",value:Ne.line1,onInput:e=>$e("line1",e.target.value),error:Le.line1,activeErrors:Me.line1,lenError:ke,className:"mt-18",disabled:!(null!==(vl=X.Pincode_data)&&void 0!==vl&&vl.success)||X.loader||X.pincode.length<6||X.wrongPincode,autoComplete:"address-line1",maxLength:"255",skippedArray:["name","lastName","gender"],touched:null==se?void 0:se.includes("line1"),setSkipErrorField:ue,mandatory:!0}),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(o.Z,{label:"thehatke.com"!==(null==ne||null===(ml=ne.sellerConfig)||void 0===ml?void 0:ml.domainName)?"Area, street, sector, village":"Address line 2 (Area, street, sector, village)",type:"textarea",id:"line2",name:"address",value:Ne.line2,onInput:e=>$e("line2",e.target.value),error:Le.line2,activeErrors:Me.line2,lenError:Pe,className:"mt-18",disabled:!(null!==(gl=X.Pincode_data)&&void 0!==gl&&gl.success)||X.loader||X.pincode.length<6||X.wrongPincode,autoComplete:"address-line2",maxLength:"170",skippedArray:["name","lastName","line1","gender"],touched:null==se?void 0:se.includes("line2"),setSkipErrorField:ue,mandatory:!0})}),q||null!=ne&&null!==(pl=ne.sellerConfig)&&void 0!==pl&&pl.landmarkMandatory?(0,b.jsx)(o.Z,{error:Le.landmark,activeErrors:Me.landmark,label:"Landmark",type:"text",id:"landmark",name:"landmark",value:Ne.landmark,onInput:e=>$e("landmark",e.target.value),className:"mt-18",maxLength:"50",disabled:!(null!==(hl=X.Pincode_data)&&void 0!==hl&&hl.success)||X.loader||X.pincode.length<6||X.wrongPincode,skippedArray:["name","lastName","line1","line2","gender"],touched:null==se?void 0:se.includes("landmark"),setSkipErrorField:ue,mandatory:!(null==ne||null===(yl=ne.sellerConfig)||void 0===yl||!yl.landmarkMandatory)}):!(null!=ne&&null!==(fl=ne.sellerConfig)&&void 0!==fl&&fl.landmarkMandatory)&&(0,b.jsx)("button",{onClick:()=>z(!0),className:null!=ie&&ie.cardDesignEnabled?"Delivery_LandmarkButtonCard__QHIOa":"Delivery_LandmarkButton__DLKbV",children:"+ Landmark area"}),(null==ne||null===(_l=ne.sellerConfig)||void 0===_l?void 0:_l.enableAdrrPhone)&&(0,b.jsx)(o.Z,{id:"phone",name:"phone",label:"Phone",type:"tel",autoComplete:"tel",className:"mt-18",onChange:Je,onInput:Qe,skippedArray:["name","lastName","line1","line2","landmark","gender"],touched:null==se?void 0:se.includes("phone"),setSkipErrorField:ue,mandatory:!0,activeErrors:Me.phone,error:Le.phone,value:_e,disabled:!(null!==(Cl=X.Pincode_data)&&void 0!==Cl&&Cl.success)||X.loader||X.pincode.length<6||X.wrongPincode}),(0,b.jsxs)("div",{className:t,children:[(0,b.jsx)(o.Z,{label:"City",type:"text",id:"city",name:"city",error:Le.city,activeErrors:Me.city,value:X.city,onInput:e=>$e("city",e.target.value),className:"mr-18",maxLength:"100",disabled:!(null!==(xl=X.Pincode_data)&&void 0!==xl&&xl.success)||X.loader||X.pincode.length<6||X.wrongPincode,autoComplete:"address-level2",skippedArray:["name","lastName","line1","line2","landmark","phone","gender"],touched:null==se?void 0:se.includes("city"),setSkipErrorField:ue,mandatory:!0}),(0,b.jsx)(o.Z,{label:"State",type:"text",id:"state",name:"state",value:X.state,disabled:!0,skippedArray:["name","lastName","line1","line2","landmark","city","phone","gender"],touched:null==se?void 0:se.includes("state"),setSkipErrorField:ue,mandatory:!0,skipPincodeFocus:!(null===(bl=X.Pincode_data)||void 0===bl||!bl.success||X.loader||X.pincode.length<6||X.wrongPincode)})]}),!(null!=ne&&null!==(Al=ne.sellerConfig)&&void 0!==Al&&Al.removeEmailFromCodForm)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.Z,{label:null!==(El=ne.sellerConfig)&&void 0!==El&&El.showEmail?"E-mail":"E-mail (optional)",type:"text",id:"email",name:"email",value:Ne.email,onInput:e=>$e("email",e.target.value),error:Le.email,activeErrors:!(null===(Sl=ne.sellerConfig)||void 0===Sl||!Sl.addressVerify)&&Me.email,className:"mt-18",disabled:!(null!==(Dl=X.Pincode_data)&&void 0!==Dl&&Dl.success)||X.loader||X.pincode.length<6||X.wrongPincode,autoComplete:"email",skippedArray:["name","lastName","line1","line2","landmark","city","phone","gender"],touched:null==se?void 0:se.includes("email"),setSkipErrorField:ue,mandatory:!(null===(wl=ne.sellerConfig)||void 0===wl||!wl.showEmail)}),(0,b.jsx)("div",{className:"Delivery_deliveryLabel__Tj4QK",children:"Order delivery details will be sent here"}),le.invalidEmail&&(0,b.jsx)(u.Z,{msg:le.invalidEmail})]}),(0,b.jsxs)("div",{className:"".concat(t),children:[(0,b.jsx)("div",{}),(0,b.jsxs)("div",{style:{width:"100%",marginTop:8},children:[(0,b.jsx)(x.Z,{selectedTag:me,handleAddressTag:Ze,error:Ke}),ce&&"others"===me?(0,b.jsx)("div",{className:null!=ie&&ie.cardDesignEnabled||ne.AuthTokenGenerated?"":"mtNeg-18",children:(0,b.jsx)(o.Z,{label:"Save address as",type:"text",id:"tags",name:"tags",value:Ne.tags,className:"mr-10 mt-18",onInput:e=>$e("tags",e.target.value),error:Le.tags,maxLength:"25",activeErrors:Me.tags,onChange:e=>X.tagValue=e.target.value,mandatory:"others"===me&&!0})}):""]})]}),(!(null!=ne&&null!==(Nl=ne.sellerConfig)&&void 0!==Nl&&Nl.enabledFeatureCodForm)||(null==ne||null===(Il=ne.sellerConfig)||void 0===Il?void 0:Il.enabledFeatureCodForm)&&((null==ee?void 0:ee.verified)||(null==ne?void 0:ne.otpSkip)))&&(0,b.jsxs)("div",{className:"Delivery_buttonContainer__V3sHu",children:[(0,b.jsx)("div",{style:{marginTop:6},children:Ae&&(0,b.jsx)(u.Z,{msg:Se})}),le.spinner&&(0,b.jsx)(g.Z,{}),(0,b.jsx)(a.Z,{id:"addAddressBtn",type:"button",onClick:Xe,loading:le.addressAdding,className:"mt-30",isCardDesign:null==ie?void 0:ie.cardDesignEnabled,children:le.addressAdding?"Adding address... ":"Add address"})]})]})]})}):J?void 0:(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(v.Z,{})}))});var el,ll,il,nl,tl,ol,al,dl,rl,sl,ul,cl,vl,ml,gl,pl,hl,yl,fl,_l,Cl,xl,bl,Al,El,Sl,Dl,wl,Nl,Il}},7348:(e,l,i)=>{i.d(l,{Z:()=>A});var n=i(7313);const t="DeliveryNew_addressDiv__PQOU5";var o=i(9369),a=i(528),d=i(6352),r=i(6280),s=i(3826),u=i(3624),c=i(5637),v=i(2836),m=i(7075),g=i(2855),p=i(1805),h=i(3366),y=i(1608),f=i(4460),_=i(2183),C=i(7088),x=i(6809),b=i(6417);const A=e=>{var l,i,A,E,S,D,w,N,I,k,T,P,j,F,R,L;const O=window.location.search;let M=new URLSearchParams(O);const[U,Z]=(0,n.useState)(!1),[B,H]=(0,n.useState)(!1),[V,G]=(0,n.useState)(!1),[W,q]=(0,n.useState)(!1),[z,Y]=(0,n.useState)(!1),[Q,J]=(0,n.useState)(0),[K,$]=(0,n.useState)(!0),X=()=>J((e=>1^e)),ee=(0,d.v9)((e=>e.Delivery)),le=((0,d.v9)((e=>e.Coupon)),(0,d.v9)((e=>e.Otp))),ie=(0,d.v9)((e=>e.Address)),ne=(0,d.v9)((e=>e.Cart)),te=(0,d.v9)((e=>e.Login)),oe=(0,d.v9)((e=>e.Shipping)),[ae,de]=(0,n.useState)(!0),[re,se]=(0,n.useState)(!1),[ue,ce]=(0,n.useState)([]),[ve,me]=(0,n.useState)(!1),[ge,pe]=(0,n.useState)(te.mobileNumber?te.mobileNumber:le.mobile_no?le.mobile_no:""),[he,ye]=(0,n.useState)(!1),[fe,_e]=(0,n.useState)("home"),[Ce,xe]=(0,n.useState)(!1),[be,Ae]=(0,n.useState)({city:"",state:"",name:"",gender:"",email:"",line1:"",completeAdd:"",tags:""}),[Ee,Se]=(0,n.useState)(""),[De,we]=(0,n.useState)(""),[Ne,Ie]=(0,n.useState)(!1),[ke,Te]=(0,n.useState)(!1),[Pe,je]=(0,n.useState)(""),Fe=(0,d.I0)(),Re=(null===(l=te.sellerConfig)||void 0===l?void 0:l.addressAllowSpecialCharacter)&&(null==te||null===(i=te.sellerConfig)||void 0===i?void 0:i.enabledFeatureCodForm),Le={pincode:"Please enter a valid 6 digit Pincode",name:"Enter your full name",line1:"Enter required address details",city:"Enter your City",email:"Enter valid email",contact:"Please enter a valid 10 digit phone number",gender:"Please select your gender",tags:"Enter a valid value"},[Oe,Me]=(0,n.useState)({name:Le.name,line1:Le.line1,email:null!=te&&null!==(A=te.sellerConfig)&&void 0!==A&&A.removeEmailFromCodForm?"":null!==(E=te.sellerConfig)&&void 0!==E&&E.showEmail?Le.email:"",city:Le.city,state:"",phone:null!=te&&null!==(S=te.sellerConfig)&&void 0!==S&&S.enableAdrrPhone?null!=te&&te.mobileNumber||le.mobile_no?"":"Enter your phone number":"",gender:null!=te&&null!==(D=te.sellerConfig)&&void 0!==D&&D.genderInAddressEnabled?Le.gender:"",tags:"others"===fe?null==Le?void 0:Le.tags:""}),[Ue,Ze]=(0,n.useState)({name:"",line1:"",email:"",city:"",state:"",phone:"",gender:"",tags:""}),Be=null==te||null===(w=te.sellerConfig)||void 0===w||!w.enableAdrrPhone||!(null!==(N=ee.Pincode_data)&&void 0!==N&&N.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,He=e=>{"others"===e?(ye(!0),Me((e=>({...e,tags:Le.tags})))):(ye(!1),Ae((e=>({...e,tags:""}))),Me((e=>({...e,tags:""}))),Ze((e=>({...e,tags:""})))),_e(e),console.log("it it working or not",e),ee.selectedTag=e},Ve=(e,l)=>{Me((i=>({...i,[e]:l})))},Ge=(e,l)=>{Ze((i=>({...i,[e]:l})))},We=(0,n.useMemo)((()=>{let e=!0,l=!0,i=!0;return Object.values(Oe).forEach((e=>{""!==e&&(l=!1)})),Object.values(Ue).forEach((e=>{""!==e&&(i=!1)})),e=l&&i,Fe({type:"Update_valid_cod_form_address",payload:e}),e}),[Oe,Ue]);function qe(e){return Object.keys(e).find((l=>""!==e[l]))}const ze=(0,n.useMemo)((()=>{var e;let l="pincode",i=qe(Oe),n=qe(Ue);return l=null!==(e=Object.keys(Oe).find((e=>e===i||e===n)))&&void 0!==e?e:"pincode",Fe({type:"Update_first_error_key_address",payload:l}),l}),[Oe,Ue]),Ye=(0,n.useMemo)((()=>ee.pincode?ee.pincode.length<6&&ee.pincode.length>=1||ee.pincode.length>6||B?"Pincode must consist of 6 digit":"":"Enter your pincode"),[ee.pincode,B]),Qe=(0,n.useMemo)((()=>ee.wrongPincode?"Please enter a valid pincode":""),[ee.wrongPincode]);(0,n.useEffect)((()=>{null!==ie.failMsg&&(be.line1="",ee.Pincode_data={},ee.pincode="",te.addSilentUserAddress=!1,e.onRender(),X(),re||(m.Z.pincodeFieldDisplayed(),console.log("hi parv")),se(!0))}),[ie.failMsg]),(0,n.useEffect)((()=>{var e,l,i,n;if(ee.selectedTag="home",console.log(ee.selectedTag,"ashfaksdfhaksfgajfdsg"),y.y.getItem("codFormAddress")&&!ve||M.get("guest-abandon-payload")){if(null!=te&&null!==(e=te.sellerConfig)&&void 0!==e&&e.enabledFeatureCodForm&&(null==le||!le.verified)){var t,o,a,d,r,s,u,c,v,m,g,p,h,f,C,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ie,oe,ae,de,re,se,ue,ce,ge,he,fe,be,Ae,Ee;Ce||((0,_.kf)({name:"ADDRESS_PREFILLED_COOKIE",domain:null===(Ae=te.sellerConfig)||void 0===Ae?void 0:Ae.domainName,payload:{cart_id:null==ne||null===(Ee=ne.Cart_data)||void 0===Ee?void 0:Ee.id}}),xe(!0)),console.log("is it working or not");const e={address:null==te||null===(t=te.initateCheckoutData)||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.cart_create)||void 0===a||null===(d=a.body)||void 0===d||null===(r=d.internalFields)||void 0===r?void 0:r.prefill_address},l=null!=te&&null!==(s=te.initateCheckoutData)&&void 0!==s&&null!==(u=s.data)&&void 0!==u&&null!==(c=u.cart_create)&&void 0!==c&&null!==(v=c.body)&&void 0!==v&&null!==(m=v.internalFields)&&void 0!==m&&m.prefill_address?e:JSON.parse(y.y.getItem("codFormAddress"));var Se,De,we,Ne;if(el("name",null!=l&&null!==(g=l.address)&&void 0!==g&&g.fullName?null==l||null===(p=l.address)||void 0===p?void 0:p.fullName:"".concat(null!==(h=null==l||null===(f=l.address)||void 0===f?void 0:f.firstName)&&void 0!==h?h:""," ").concat(null!==(C=null==l||null===(x=l.address)||void 0===x?void 0:x.lastName)&&void 0!==C?C:"")),el("line1",null!=l&&null!==(b=l.address)&&void 0!==b&&b.fullAddressLine?null==l||null===(A=l.address)||void 0===A?void 0:A.fullAddressLine:"".concat(null!==(E=null==l||null===(S=l.address)||void 0===S?void 0:S.line1)&&void 0!==E?E:""," ").concat(null!==(D=null==l||null===(w=l.address)||void 0===w?void 0:w.line2)&&void 0!==D?D:""," ").concat(null!==(N=null==l||null===(I=l.address)||void 0===I?void 0:I.landmark)&&void 0!==N?N:"")),Je(null==l||null===(k=l.address)||void 0===k?void 0:k.pincode),null!=te&&null!==(T=te.sellerConfig)&&void 0!==T&&T.removeEmailFromCodForm||el("email",null!==(Se=null==l||null===(De=l.address)||void 0===De?void 0:De.email)&&void 0!==Se?Se:""),me(!0),null!=te&&null!==(P=te.sellerConfig)&&void 0!==P&&P.genderInAddressEnabled&&el("gender",null!==(we=null==l||null===(Ne=l.address)||void 0===Ne?void 0:Ne.gender)&&void 0!==we?we:""),null!=te&&null!==(j=te.sellerConfig)&&void 0!==j&&j.enableAdrrPhone){var Ie,ke,Te,Pe,je,Re,Le,Oe,Me,Ue,Ze,Be;pe(null!==(Ie=null==l||null===(ke=l.address)||void 0===ke?void 0:ke.alternatePhone)&&void 0!==Ie?Ie:"");let e=!1;e=!!((null==l||null===(Te=l.address)||void 0===Te||null===(Pe=Te.alternatePhone)||void 0===Pe?void 0:Pe.length)>0&&0===Number(null==l||null===(je=l.address)||void 0===je||null===(Re=je.alternatePhone)||void 0===Re?void 0:Re[0])),0===(null==l||null===(Le=l.address)||void 0===Le||null===(Oe=Le.alternatePhone)||void 0===Oe?void 0:Oe.length)?Ve("phone","Enter your phone number"):Ve("phone",""),10!==(null==l||null===(Me=l.address)||void 0===Me||null===(Ue=Me.alternatePhone)||void 0===Ue?void 0:Ue.length)||e?0===(null==l||null===(Ze=l.address)||void 0===Ze||null===(Be=Ze.alternatePhone)||void 0===Be?void 0:Be.length)?Ge("phone",""):Ge("phone","Please enter valid phone number"):Ge("phone","")}let i;var He,We,qe;let n;var ze,Ye,Qe,Ke;null!=l&&null!==(F=l.address)&&void 0!==F&&F.tags?(i="home"===(null==l||null===(He=l.address)||void 0===He?void 0:He.tags)||"office"===(null==l||null===(We=l.address)||void 0===We?void 0:We.tags)?null==l||null===(qe=l.address)||void 0===qe?void 0:qe.tags:"others",ye(!0)):(i="home",ye(!1)),_e(i),ee.selectedTag=i,n=null!=l&&null!==(R=l.address)&&void 0!==R&&R.tags&&null!=l&&null!==(L=l.address)&&void 0!==L&&null!==(O=L.tags)&&void 0!==O&&O.includes("other")?null==l||null===(ze=l.address)||void 0===ze||null===(Ye=ze.tags)||void 0===Ye||null===(Qe=Ye.split(":"))||void 0===Qe||null===(Ke=Qe[1])||void 0===Ke?void 0:Ke.trim():"",el("tags",null!==(U=n)&&void 0!==U?U:""),ee.tagValue=n;const M={name:null!=l&&null!==(Z=l.address)&&void 0!==Z&&Z.fullName?null==l||null===(B=l.address)||void 0===B?void 0:B.fullName:"".concat(null!==(H=null==l||null===(V=l.address)||void 0===V?void 0:V.firstName)&&void 0!==H?H:""," ").concat(null!==(G=null==l||null===(W=l.address)||void 0===W?void 0:W.lastName)&&void 0!==G?G:""),...(null==te||null===(q=te.sellerConfig)||void 0===q?void 0:q.genderInAddressEnabled)&&{gender:null!==(z=null==l||null===(Y=l.address)||void 0===Y?void 0:Y.gender)&&void 0!==z?z:""},line1:null!=l&&null!==(Q=l.address)&&void 0!==Q&&Q.fullAddressLine?null==l||null===(J=l.address)||void 0===J?void 0:J.fullAddressLine:"".concat(null!==(K=null==l||null===($=l.address)||void 0===$?void 0:$.line1)&&void 0!==K?K:""," ").concat(null!==(X=null==l||null===(ie=l.address)||void 0===ie?void 0:ie.line2)&&void 0!==X?X:""," ").concat(null!==(oe=null==l||null===(ae=l.address)||void 0===ae?void 0:ae.landmark)&&void 0!==oe?oe:""),...!(null!=te&&null!==(de=te.sellerConfig)&&void 0!==de&&de.removeEmailFromCodForm)&&{email:null!==(re=null==l||null===(se=l.address)||void 0===se?void 0:se.email)&&void 0!==re?re:""},pincode:null==l||null===(ue=l.address)||void 0===ue?void 0:ue.pincode,...(null==te||null===(ce=te.sellerConfig)||void 0===ce?void 0:ce.enableAdrrPhone)&&{phoneNumber:null!==(ge=null==l||null===(he=l.address)||void 0===he?void 0:he.alternatePhone)&&void 0!==ge?ge:""},selectedTag:null!==(fe=i)&&void 0!==fe?fe:"home",tagValue:null!==(be=n)&&void 0!==be?be:"",tags:"others"===i?n:i};Fe({type:"update_delivery_add_cod_form",payload:M})}}else null==te||null===(l=te.sellerConfig)||void 0===l||!l.enabledFeatureCodForm||null!=le&&le.verified||Ce||((0,_.kf)({name:"ADDRESS_FILLED_MANUALLy",domain:null===(i=te.sellerConfig)||void 0===i?void 0:i.domainName,payload:{cart_id:null==ne||null===(n=ne.Cart_data)||void 0===n?void 0:n.id}}),xe(!0)),me(!0)}),[y.y.getItem("codFormAddress"),null==te||null===(I=te.sellerConfig)||void 0===I?void 0:I.enabledFeatureCodForm,null==le?void 0:le.verified,null==te||null===(k=te.initateCheckoutData)||void 0===k||null===(T=k.data)||void 0===T||null===(P=T.cart_create)||void 0===P||null===(j=P.body)||void 0===j||null===(F=j.internalFields)||void 0===F?void 0:F.prefill_address]),(0,n.useEffect)((()=>{null!==ie.invalidEmail&&(be.email="",te.addSilentUserAddress=!1,e.onRender())}),[ie.invalidEmail]),(0,n.useEffect)((()=>{var l,i,n,t,o,a,d,r,s,u,c,v;null!=ie&&ie.selectedAddress&&null!=ne&&null!==(l=ne.orderDetails)&&void 0!==l&&l.id&&(null!=te&&te.otpSkip?e.setAddressToShow({name:"".concat(null!==(i=null==ie?void 0:ie.selectedAddress.firstName)&&void 0!==i?i:"Customer"," ").concat(null!==(n=null==ie?void 0:ie.selectedAddress.lastName)&&void 0!==n?n:""),email:null==ie?void 0:ie.selectedAddress.email,address:"".concat(null==ie?void 0:ie.selectedAddress.line1,", ").concat(null!=ie&&null!==(t=ie.selectedAddress)&&void 0!==t&&t.line2?(null==ie||null===(o=ie.selectedAddress)||void 0===o?void 0:o.line2)+",":""," ").concat(null!=ie&&null!==(a=ie.selectedAddress)&&void 0!==a&&a.landmark?"Landmark-"+(null==ie||null===(d=ie.selectedAddress)||void 0===d?void 0:d.landmark)+",":""," ").concat(null==ie?void 0:ie.selectedAddress.city,", ").concat(null==ie?void 0:ie.selectedAddress.state,", ").concat(null==ie?void 0:ie.selectedAddress.pincode),address_id:null==ie?void 0:ie.selectedAddress.addressID,customer_id:te.userInfo.user_id,count:"",index:"",alternatePhone:null===(r=ie.selectedAddress)||void 0===r?void 0:r.alternatePhone,tags:null===(s=ie.selectedAddress)||void 0===s?void 0:s.tags}):e.setAddressToShow({name:"".concat(null!==(u=null==ie?void 0:ie.selectedAddress.fullName)&&void 0!==u?u:"Customer"),email:null==ie?void 0:ie.selectedAddress.email,address:"".concat(null==ie?void 0:ie.selectedAddress.fullAddressLine,", ").concat(null==ie?void 0:ie.selectedAddress.city,", ").concat(null==ie?void 0:ie.selectedAddress.state,", ").concat(null==ie?void 0:ie.selectedAddress.pincode),address_id:null==ie?void 0:ie.selectedAddress.addressID,customer_id:te.userInfo.user_id,count:"",index:"",alternatePhone:null===(c=ie.selectedAddress)||void 0===c?void 0:c.alternatePhone,tags:null===(v=ie.selectedAddress)||void 0===v?void 0:v.tags}))}),[JSON.stringify(null==ie?void 0:ie.selectedAddress)]);const Je=e=>{ee.wrongPincode=!1,ie.fail=!1,ee.pincode=e.substring(0,6),X();let l={postcode:e.substring(0,6)};6===e.length&&(m.Z.pincodeAdded(),m.Z.addressFieldsDisplayed(),ee.spinner=!0,ee.wrongPincode=!1,Fe((0,s.J)(l)))};(0,n.useEffect)((()=>{var e,l,i;null!==(e=ee.Pincode_data)&&void 0!==e&&e.success&&(console.log(ee,"adadasdf"),null===(l=document.getElementById("name"))||void 0===l||l.focus(),null!=le&&le.verified||null!=te&&te.otpSkip||null==te||null===(i=te.sellerConfig)||void 0===i||!i.enabledFeatureCodForm||(async()=>{var e,l,i,n,t,o,a,d,r,s,u,v,m,g;console.log(ee,"checking something rizwan bhai","others"===(null==ee?void 0:ee.selectedTag)?"other: ".concat(null==ee?void 0:ee.tags):null==ee?void 0:ee.selectedTag,null==ee?void 0:ee.tags);const p={sellerId:te.sellerConfig.seller_id,codIntent:oe.codIntent,address:{phone:null!==(e=null==te?void 0:te.mobileNumber)&&void 0!==e?e:"",fullAddressLine:null!==(l=null==ee?void 0:ee.line1)&&void 0!==l?l:"",city:null!==(i=null==ee||null===(n=ee.city)||void 0===n?void 0:n.trim())&&void 0!==i?i:"",pincode:null==ee?void 0:ee.pincode,gender:null!==(t=null==ee?void 0:ee.gender)&&void 0!==t?t:"",state:null==ee||null===(o=ee.state)||void 0===o?void 0:o.trim(),country:"IN",sellerID:null==te||null===(a=te.sellerConfig)||void 0===a?void 0:a.seller_id,fullName:null!==(d=null==ee?void 0:ee.name)&&void 0!==d?d:"",addressType:["Shipping"],email:null!==(r=null==ee?void 0:ee.email)&&void 0!==r?r:"".concat(null!=te&&te.mobileNumber?"".concat(null==te||null===(s=te.mobileNumber)||void 0===s?void 0:s.trim(),"@fastrr.com"):""),countryCode:"+91",cartId:null==ne||null===(u=ne.Cart_data)||void 0===u?void 0:u.id,versionId:"v2",tags:"others"===(null==ee?void 0:ee.selectedTag)?"other: ".concat(null==ee?void 0:ee.tags):null==ee?void 0:ee.selectedTag,...null!=te&&null!==(v=te.sellerConfig)&&void 0!==v&&v.enableAdrrPhone?{alternatePhone:null!==(m=null==ee?void 0:ee.phoneNumber)&&void 0!==m?m:""}:{},addressID:"random-".concat(null===(g=1e5*Math.random())||void 0===g?void 0:g.toFixed(0))},billingAddress:{}};await Fe((0,c.i)(p,le.pim_sid_updated,te.sellerConfig.seller_id)),ne.orderFetched=!1})())}),[ee.Pincode_data]),(0,n.useEffect)((()=>{el("city",ee.city)}),[ee.city]),(0,n.useEffect)((()=>{try{var e;if(null!=te&&null!==(e=te.sellerConfig)&&void 0!==e&&e.addressVerify||null!=ie&&ie.addressFailMsg){var l,i,n;null===(l=document.getElementById("line1"))||void 0===l||l.focus();const e=(0,C.aW)(be.line1,null==te||null===(i=te.sellerConfig)||void 0===i?void 0:i.domainName,null==te||null===(n=te.sellerConfig)||void 0===n?void 0:n.addressLayoutNew);Ve("line1",null==e?void 0:e.errorMessage),Ge("line1",null==e?void 0:e.activeErrorMessage)}}catch(e){console.log(e)}}),[null==ie?void 0:ie.addressFailMsg]);const Ke=e=>{e.target.value=e.target.value.replace(/[^0-9]/g,""),e.target.value=e.target.value.substring(0,13);for(var l=document.querySelectorAll('input[type="number"]'),i=l.length;i--;)l[i].setAttribute("pattern","\\d*")},$e=async e=>{let l=e.target.value;pe(l),ee.phoneNumber=l;let i=!1;i=!!(l.length>0&&0===Number(l[0])),0===l.length?Ve("phone","Enter your phone number"):Ve("phone",""),10!==l.length||i?0===l.length?Ge("phone",""):Ge("phone","Please enter valid phone number"):Ge("phone","")},Xe=(null===(R=ee.Pincode_data)||void 0===R||!R.success||ee.loader||ee.pincode.length<6||ee.wrongPincode||"".concat(null!=ne&&ne.cardDesignEnabled?"DeliveryNew_addressTag_selected_card__NgcYT":"DeliveryNew_addressTag_selected__5F8Sz"),!(null!==(L=ee.Pincode_data)&&void 0!==L&&L.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode),el=async(e,l)=>{((e,l)=>{var i;const n=/[a-zA-Z0-9]/g;if(null!==(i=te.sellerConfig)&&void 0!==i&&i.addressVerify){var t,o,a,d;const e=(0,C.r1)(null===(t=te.sellerConfig)||void 0===t?void 0:t.blockAddressWithInvalidAddressLines,null===(o=te.sellerConfig)||void 0===o?void 0:o.invalidAddressLineNumber,null==be||null===(a=be.line1)||void 0===a?void 0:a.match(n),null==te||null===(d=te.sellerConfig)||void 0===d?void 0:d.addressLayoutNew);Ie(null==e?void 0:e.isError),Te(null==e?void 0:e.isError),je(null==e?void 0:e.errorMessage)}switch(e){case"name":if(!Re){var r;if(null!==(r=te.sellerConfig)&&void 0!==r&&r.addressVerify){var s,u,c,v,m,g,h;const i=/^(?!\.)([A-Za-z\s.]+)$/,n=/[a-zA-Z0-9]/g,t=l.match(n);null===(s=l)||void 0===s||null===(u=s.toLowerCase())||void 0===u||u.split(" "),null===f.TJ||void 0===f.TJ||f.TJ.includes(null===(c=l)||void 0===c||null===(v=c.toLowerCase())||void 0===v?void 0:v.trim()),Ve(e,""===l?"Enter your full name":""),0===l.length?Ge(e,""):i.test(l)?(null==t?void 0:t.length)<3?Ve(e,"Minimum 3 characters required"):" "===(null===(m=l)||void 0===m?void 0:m[0])?Ve(e,"Space at the start not allowed"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(g=l)||void 0===g||null===(h=g.toLowerCase())||void 0===h?void 0:h.trim())?Ve(e,"Given name is invalid"):"sr-login"===M.get("login")&&l.length>49?Ve(e,"First name can’t be longer than 49 characters"):(null==t?void 0:t.length)>120?Ge(e,"Character length exceeded"):Ge(e,""):Ge(e,"Use only alphabets (A-Z, a-z)");break}{const i=/^[A-Za-z\s]+$/;Ve(e,""===l?"Enter your full name.":""),0===l.length?Ge(e,""):" "==l[0]?Ge(e,"Avoid starting with a space"):i.test(l)?l.length>120?Ge(e,"Name can’t be longer than 120 characters"):Ge(e,""):Ge(e,"Use only alphabets (A-Z, a-z)");break}}""===l.trim()?(Ve(e,"Enter your full name"),Ge(e,"Enter your full name")):(Ve(e,""),Ge(e,""));break;case"email":var y;if(null!==(y=te.sellerConfig)&&void 0!==y&&y.addressVerify){var _,x,b,A,E,S;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n=null===(_=l)||void 0===_||null===(x=_.toLowerCase().trim())||void 0===x?void 0:x.split("@")[1];null!==(b=te.sellerConfig)&&void 0!==b&&b.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?Ge(e,Le.email):null!==(A=te.sellerConfig)&&void 0!==A&&A.showEmail&&null!==f.hC&&void 0!==f.hC&&f.hC.includes(n)?Ge(e,"Invalid email"):Ge(e,""),null!==(E=te.sellerConfig)&&void 0!==E&&E.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?Ve(e,Le.email):null!==(S=te.sellerConfig)&&void 0!==S&&S.showEmail&&null!==f.hC&&void 0!==f.hC&&f.hC.includes(n)?Ve(e,"Invalid email"):Ve(e,"");break}{var D;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;null!==(D=te.sellerConfig)&&void 0!==D&&D.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?Ve(e,Le.email):Ve(e,"");break}case"line1":if(!Re){var w;if(null!=te&&null!==(w=te.sellerConfig)&&void 0!==w&&w.addressVerify){var N,I;ie.addressFailMsg=!1;const i=(0,C.aW)(l,null==te||null===(N=te.sellerConfig)||void 0===N?void 0:N.domainName,null==te||null===(I=te.sellerConfig)||void 0===I?void 0:I.addressLayoutNew);Ve(e,null==i?void 0:i.errorMessage),Ge(e,null==i?void 0:i.activeErrorMessage);break}{const i=/^[ A-Za-z0-9_@./,#&+-/\n]{0,475}$/;Se(l.trim().length.toString()),""===l.trim()?Ve(e,Le.line1):l.trim().length<10?Ve(e,"Minimum 10 characters required"):Ve(e,""),""===l.trim()?Ge(e,""):l.trim().length>475?Ge(e,"Address cannot be longer than 475 characters"):i.test(l.trim())?Ge(e,""):Ge(e,"Allowed special characters _ @ . / , # & + - ");break}}var k,T;""===l.trim()?(Ve(e,"Address is required."),Ge(e,"Address is required.")):(null===(k=l)||void 0===k||null===(T=k.trim())||void 0===T?void 0:T.length)<10?Ve(e,"Minimum 10 characters required"):(Ve(e,""),Ge(e,""));break;case"gender":Ve(e,""===l?"Select your gender.":"");break;case"city":{const i=p.N9;ee.city=l,Ve(e,""==l?Le.city:""),""==l?Ge(e,""):" "==l[0]?Ge(e,"Avoid starting with a space"):i.test(l)?l.length>100?Ge(e,"City can’t be longer than 100 characters"):Ge(e,""):Ge(e,p.bG);break}case"tags":var P,j;""==(null===(P=l)||void 0===P?void 0:P.trim())&&"others"===fe?Ve(e,Le.tags):Ve(e,""),""===(null===(j=l)||void 0===j?void 0:j.trim())?Ge(e,""):l.startsWith(" ")?Ge(e,"Avoid starting with a space"):Ge(e,"");break;case"contact":""===(l=l.substring(0,10))||10!==l.length?Ve(e,Le.contact):Ve(e,"")}})(e,l),Ae((i=>({...i,[e]:l}))),ee[e]=l},ll=e=>{if(!We||ee.pincode.length<6||ee.wrongPincode){var l;if(null===(l=ee.Pincode_data)||void 0===l||!l.success||ee.loader||ee.pincode.length<6||ee.wrongPincode){var i;null===(i=document.getElementById("pincode"))||void 0===i||i.focus()}else{var n;const e=["line1"];var t,o;null!=te&&null!==(n=te.sellerConfig)&&void 0!==n&&n.addressVerify&&Ne&&!e.includes(ze)?(Te(!0),null===(t=document.getElementById("line1"))||void 0===t||t.focus()):(Te(!1),null===(o=document.getElementById(ze))||void 0===o||o.focus())}}else{var a,d,s,u,c,v,m,g,p,h,y,f,_,C,x,b,A,E;oe.serviceFetched=!1,ne.orderFetched=!1,e.preventDefault(),ie.addingNewAddress=10*Math.random(),te.addSilentUserAddress=!0,ne.cartAddressUpdated=!1,ie.failMsg=null,ie.invalidEmail=null,null===(a=document.getElementById("addAddressBtn"))||void 0===a||a.setAttribute("disabled","true");var S=document.getElementById("addAddressBtn");null!=S&&(S.innerHTML="Adding address...");let l=be.name,i={address1:be.line1,city:null===(d=ee.Pincode_data)||void 0===d||null===(s=d.postcode_details)||void 0===s||null===(u=s.city)||void 0===u||null===(c=u.trim())||void 0===c?void 0:c.replace(/\./g," "),email:be.email,fname:l,pincode:ee.pincode,state:null===(v=ee.Pincode_data)||void 0===v||null===(m=v.postcode_details)||void 0===m?void 0:m.state,state_code:"",phone:te.mobileNumber,mobile:te.mobileNumber,gender:null!==(g=be.gender)&&void 0!==g?g:"",country:"India",country_code:"IN",addressType:["shipping"],seller_id:null===(p=te.sellerConfig)||void 0===p?void 0:p.seller_id,tags:"others"===fe?"other: ".concat(null==be?void 0:be.tags):fe,...(null===(h=te.sellerConfig)||void 0===h?void 0:h.addressVerify)&&{source:"checkout"}},n={phone:te.mobileNumber,fullAddressLine:be.line1.replace(/\n/g," ").trim(),city:null===(y=ee.city.trim())||void 0===y?void 0:y.replace(/\./g," "),pincode:ee.pincode,gender:null!==(f=be.gender)&&void 0!==f?f:"",state:null===(_=ee.Pincode_data)||void 0===_||null===(C=_.postcode_details)||void 0===C?void 0:C.state,country:"IN",sellerID:null===(x=te.sellerConfig)||void 0===x?void 0:x.seller_id,fullName:l.trim(),addressType:["Shipping"],email:be.email,countryCode:"+91",cartId:null==ne||null===(b=ne.Cart_data)||void 0===b?void 0:b.id,versionId:"v2",alternatePhone:null!=te&&null!==(A=te.sellerConfig)&&void 0!==A&&A.enableAdrrPhone&&ge!==te.mobileNumber&&ge!==le.mobile_no?ge:null,tags:"others"===fe?"other: ".concat(null==be?void 0:be.tags):fe,...(null===(E=te.sellerConfig)||void 0===E?void 0:E.addressVerify)&&{source:"checkout"}};be.completeAdd=be.line1+", "+i.city+", "+i.state+", "+ee.pincode,te.AuthTokenGenerated?(ie.New_User_Address_Payload=i,ne.showPreferredShipping=!1,Fe((0,r.RQ)(i))):null!=te&&te.otpSkip?Fe({type:"SKIP_Otp_Address_add",payload:{...n,emailConfirmed:!0}}):Fe((0,r.Q8)(n,te.userInfo.user_id,le.fetchAddressPermission,te.sellerConfig.seller_id,te.sellerConfig.blockOldAddress))}};return(0,b.jsx)(b.Fragment,{children:(te.AuthTokenGenerated&&ne.sendCartInitiate&&(null==te||null===(tl=te.cartItems)||void 0===tl||tl.map((e=>({itemId:e.variantId,quantity:e.quantity})))),te.AuthTokenGenerated&&ne.updateAddressfired&&null!==(il=ne.Cart_data)&&void 0!==il&&il.success&&(()=>{var e,l;let i={cart_id:null===(e=ne.Cart_data)||void 0===e||null===(l=e.data)||void 0===l?void 0:l.cart_id,address_selected:0,address_id:ie.Silent_User_Address.data.address_id,customer_id:ie.Silent_User_Address.data.customer_id,name:be.name,email:be.email,address:ie.Silent_User_Address.data.address_details,saved_addresses:0};i.address.mobile_no=i.address.mobile,te.onPage="delivery",i.address.mobile_no||(i.address.mobile_no=te.mobileNumber)})(),ie.addressFetched&&(te.sellerConfig.seller_id,null===(ol=ie.Address_data[0])||void 0===ol||ol.addressID),te.AuthTokenGenerated&&null!==(nl=ne.UpdatedShipping_data)&&void 0!==nl&&nl.success&&ae&&(de(!1),e.onRender(),te.addSilentUserAddress=!1,ie.spinner=!1),K?(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{children:[(0===(null==ie||null===(al=ie.Address_data)||void 0===al?void 0:al.length)||!(null!=ie&&ie.Address_data))&&(null!=ne&&ne.cardDesignEnabled?(0,b.jsx)("div",{className:"card-main-heading",style:{paddingBottom:"10px"},children:"Add shipping address"}):(0,b.jsx)("h4",{style:{paddingBottom:"10px"},children:"Add shipping address"})),(null==te||null===(dl=te.sellerConfig)||void 0===dl?void 0:dl.enableInternationalAddress)&&(0,b.jsxs)("h5",{style:{paddingBottom:"10px",font:"500 14px/14px var(--font-family)"},children:["Do you like to have your order ",(0,b.jsx)("a",{onClick:()=>(()=>{if(M.get("cart-resume-id")){var e,l;if(p.ZW.wooCommerce===(null==ne||null===(e=ne.platform)||void 0===e?void 0:e.toUpperCase())){var i;let e="http://".concat(null==te||null===(i=te.sellerConfig)||void 0===i?void 0:i.domainName,"/checkout");window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:e}}]},"*")}let t="";for(let e of null==ne||null===(n=ne.orderDetails)||void 0===n?void 0:n.lineItems){var n;t=t+e.itemId+":"+e.quantity+","}const o="http://".concat(null==te||null===(l=te.sellerConfig)||void 0===l?void 0:l.domainName,"/cart/").concat(t);window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===o[(null==o?void 0:o.length)-1]?null==o?void 0:o.slice(0,(null==o?void 0:o.length)-1):o}}]},"*")}else{var t,o,a,d,r,s,u,c,v;p.ZW.shopify===(null==te?void 0:te.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===(null===(t=te.channel)||void 0===t?void 0:t.redirectUrl[(null===(o=te.channel)||void 0===o||null===(a=o.redirectUrl)||void 0===a?void 0:a.length)-1])?null===(d=te.channel)||void 0===d||null===(r=d.redirectUrl)||void 0===r?void 0:r.slice(0,(null===(s=te.channel)||void 0===s||null===(u=s.redirectUrl)||void 0===u?void 0:u.length)-1):null===(c=te.channel)||void 0===c?void 0:c.redirectUrl}}]},"*"),p.ZW.wooCommerce===(null==te?void 0:te.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null===(v=te.channel)||void 0===v?void 0:v.redirectUrl}}]},"*")}})(),style:{color:"var(--primary-color)",cursor:"pointer"},children:" shipped outside India?"})]}),(0,b.jsx)("div",{className:null!=ne&&ne.cardDesignEnabled||te.AuthTokenGenerated?"":"mtNeg-18",children:(0,b.jsx)(o.Z,{label:"Pincode",type:"text",id:"pincode",name:"pincode",value:ee.pincode,className:"mt-18",onChange:e=>{e.target.value.match(/^[\d]{0,6}$/g)&&Je(e.target.value)},disabled:((null==ne?void 0:ne.orderFetching)||oe.serviceFetching||ee.spinner)&&(null==te||null===(rl=te.sellerConfig)||void 0===rl?void 0:rl.enabledFeatureCodForm)&&!(null!=le&&le.verified),error:Ye,activeErrors:Qe,loading:ee.spinner,touched:U,autoComplete:"postal-code",mandatory:!0,marginTop:null!=ne&&ne.cardDesignEnabled?"8px":""})}),ie.failMsg&&(0,b.jsx)(u.Z,{msg:ie.failMsg}),(0,b.jsxs)("div",{children:[(0,b.jsx)(o.Z,{label:"Full name",type:"text",id:"name",name:"name",value:be.name,className:"mr-10 mt-18",onInput:e=>el("name",e.target.value),error:Oe.name,maxLength:"120",activeErrors:Ue.name,disabled:!(null!==(sl=ee.Pincode_data)&&void 0!==sl&&sl.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,autoComplete:"given-name",touched:null==ue?void 0:ue.includes("name"),setSkipErrorField:ce,mandatory:!0}),(null==te||null===(ul=te.sellerConfig)||void 0===ul?void 0:ul.genderInAddressEnabled)&&(0,b.jsxs)(h.Z,{id:"gender",label:"Gender",placeholder:"Gender",name:"gender",className:"mt-18",value:be.gender,onChange:e=>{el("gender",e.target.value)},error:Oe.gender,disabled:!(null!==(cl=ee.Pincode_data)&&void 0!==cl&&cl.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,touched:null==ue?void 0:ue.includes("gender"),activeErrors:Ue.gender,skippedArray:["name","lastName"],setSkipErrorField:ce,mandatory:!0,children:[(0,b.jsx)("option",{disabled:!0,value:"",hidden:!0,children:null!=ne&&ne.cardDesignEnabled?"":"Select your gender"}),(0,b.jsx)("option",{value:"male",children:"Male"}),(0,b.jsx)("option",{value:"female",children:"Female"})]}),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(o.Z,{label:"Address",type:"text",id:"line1",name:"address",value:be.line1,onInput:e=>el("line1",e.target.value),error:Oe.line1,activeErrors:Ue.line1,lenError:Ee,className:"mt-18",disabled:!(null!==(vl=ee.Pincode_data)&&void 0!==vl&&vl.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,autoComplete:"address-line1",maxLength:"475",skippedArray:["name","gender"],touched:null==ue?void 0:ue.includes("line1"),setSkipErrorField:ce,mandatory:!0})}),!(null!=te&&null!==(ml=te.sellerConfig)&&void 0!==ml&&ml.enabledFeatureCodForm)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.Z,{id:"phone",name:"phone",label:"Receiver’s number",type:"tel",autoComplete:"tel-local",className:"mt-18",onChange:$e,onInput:Ke,skippedArray:["name","line1","gender"],touched:null==ue?void 0:ue.includes("phone"),setSkipErrorField:ce,mandatory:!0,activeErrors:Ue.phone,error:Oe.phone,value:ge,disabled:Be}),(0,b.jsx)("span",{style:{marginLeft:"10px",fontSize:"10px",color:"#616161"},children:" We'll contact you on this number during delivery "})]}),!(null!=te&&null!==(gl=te.sellerConfig)&&void 0!==gl&&gl.removeEmailFromCodForm)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o.Z,{label:null!==(pl=te.sellerConfig)&&void 0!==pl&&pl.showEmail?"E-mail":"E-mail (optional)",type:"text",id:"email",name:"email",value:be.email,onInput:e=>el("email",e.target.value),error:Oe.email,activeErrors:!(null===(hl=te.sellerConfig)||void 0===hl||!hl.addressVerify)&&Ue.email,className:"mt-18",disabled:!(null!==(yl=ee.Pincode_data)&&void 0!==yl&&yl.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,autoComplete:"email",skippedArray:["name","line1","phone","gender"],touched:null==ue?void 0:ue.includes("email"),setSkipErrorField:ce,mandatory:!(null===(fl=te.sellerConfig)||void 0===fl||!fl.showEmail)}),(0,b.jsx)("span",{style:{marginLeft:"10px",fontSize:"10px",color:"#616161"},children:"Order delivery details will be sent here"}),ie.invalidEmail&&(0,b.jsx)(u.Z,{msg:ie.invalidEmail})]}),(0,b.jsxs)("div",{className:"".concat(t),children:[(0,b.jsx)(o.Z,{label:"City",type:"text",id:"city",name:"city",error:Oe.city,activeErrors:Ue.city,value:ee.city,onInput:e=>el("city",e.target.value),className:"mr-18",maxLength:"100",disabled:!(null!==(_l=ee.Pincode_data)&&void 0!==_l&&_l.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,autoComplete:"address-level2",skippedArray:["name","line1","phone","email","gender"],touched:null==ue?void 0:ue.includes("city"),setSkipErrorField:ce,mandatory:!0}),(0,b.jsx)(o.Z,{label:"State",type:"text",id:"state",name:"state",value:ee.state,disabled:!0,skippedArray:["name","lastName","line1","line2","landmark","city","phone","email","gender"],touched:null==ue?void 0:ue.includes("state"),setSkipErrorField:ce,mandatory:!0,skipPincodeFocus:!(null===(Cl=ee.Pincode_data)||void 0===Cl||!Cl.success||ee.loader||ee.pincode.length<6||ee.wrongPincode)})]}),(0,b.jsx)("div",{className:"".concat(t),children:(0,b.jsxs)("div",{style:{width:"100%",marginTop:8},children:[(0,b.jsx)(x.Z,{selectedTag:fe,handleAddressTag:He,error:Xe}),he&&"others"===fe?(0,b.jsx)("div",{className:null!=ne&&ne.cardDesignEnabled||te.AuthTokenGenerated?"":"mtNeg-18",children:(0,b.jsx)(o.Z,{label:"Save address as",type:"text",id:"tags",name:"tags",value:be.tags,className:"mr-10 mt-18",onInput:e=>el("tags",e.target.value),onChange:e=>ee.tagValue=e.target.value,error:Oe.tags,maxLength:"25",activeErrors:Ue.tags,disabled:!(null!==(xl=ee.Pincode_data)&&void 0!==xl&&xl.success)||ee.loader||ee.pincode.length<6||ee.wrongPincode,mandatory:"others"===fe&&!0})}):""]})}),(!(null!=te&&null!==(bl=te.sellerConfig)&&void 0!==bl&&bl.enabledFeatureCodForm)||(null==te||null===(Al=te.sellerConfig)||void 0===Al?void 0:Al.enabledFeatureCodForm)&&((null==le?void 0:le.verified)||(null==te?void 0:te.otpSkip)))&&(0,b.jsxs)("div",{className:"DeliveryNew_buttonContainer__P7dl7",children:[(0,b.jsx)("div",{style:{marginTop:4},children:(0,b.jsx)("div",{style:{marginBottom:4},children:ke&&(0,b.jsx)(u.Z,{msg:Pe})})}),ie.spinner&&(0,b.jsx)(g.Z,{}),(0,b.jsx)(a.Z,{id:"addAddressBtn",type:"button",onClick:ll,loading:ie.addressAdding,className:"mt-30",isCardDesign:null==ne?void 0:ne.cardDesignEnabled,children:ie.addressAdding?"Adding address... ":"Add address"})]})]})]})}):K?void 0:(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(v.Z,{})}))});var il,nl,tl,ol,al,dl,rl,sl,ul,cl,vl,ml,gl,pl,hl,yl,fl,_l,Cl,xl,bl,Al}},9079:(e,l,i)=>{i.r(l),i.d(l,{default:()=>A});var n=i(7313);const t="EditAddress_addressDiv__FZcYs",o="EditAddress_deliveryLabel__47Oir";var a=i(9369),d=i(528),r=i(6352),s=i(6280),u=i(3624),c=i(7075),v=i(2855),m=i(4835),g=i(2718),p=i(1608),h=i(1805),y=i(3366),f=i(4460),_=i(7088),C=i(6809),x=i(6417);const b={pincode:"Please enter a valid 6 digit Pincode",name:"Enter your first name",lastName:"Enter your last name",line1:"Enter required address details",line2:"Enter required address details",landmark:"Enter a landmark",city:"Enter your City",email:"Enter valid email",contact:"Please enter a valid 10 digit phone number",gender:"Please select your gender",tags:"Enter a valid value"},A=e=>{var l,i,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce;const ve=window.location.search;let me=new URLSearchParams(ve);const[ge,pe]=(0,n.useState)(!1),[he,ye]=(0,n.useState)(!1),[fe,_e]=(0,n.useState)(!1),[Ce,xe]=(0,n.useState)(!1),[be,Ae]=(0,n.useState)(!1),[Ee,Se]=(0,n.useState)(0),[De,we]=(0,n.useState)(!0),Ne=()=>Se((e=>1^e)),Ie=(0,r.v9)((e=>e.Delivery)),ke=(0,r.v9)((e=>e.Coupon)),Te=((0,r.v9)((e=>e.Otp)),(0,r.v9)((e=>e.Address))),Pe=(0,r.v9)((e=>e.Cart)),je=(0,r.v9)((e=>e.Login)),Fe=(0,r.v9)((e=>e.Shipping)),[Re,Le]=(0,n.useState)(!0),[Oe,Me]=(0,n.useState)(!1),[Ue,Ze]=(0,n.useState)(!1),[Be,He]=(0,n.useState)(null!==(l=null==e||null===(i=e.editAddressData)||void 0===i?void 0:i.pincode)&&void 0!==l?l:""),[Ve,Ge]=(0,n.useState)(!1),[We,qe]=(0,n.useState)(!1),[ze,Ye]=(0,n.useState)(!0),[Qe,Je]=(0,n.useState)([]),[Ke,$e]=(0,n.useState)("others"===(null==e||null===(A=e.editAddressData)||void 0===A?void 0:A.tags)),[Xe,el]=(0,n.useState)(null!==(E=null==e||null===(S=e.editAddressData)||void 0===S?void 0:S.tags)&&void 0!==E?E:"home"),[ll,il]=(0,n.useState)(null!=je&&null!==(D=je.sellerConfig)&&void 0!==D&&D.enableAdrrPhone?null!=e&&null!==(w=e.editAddressData)&&void 0!==w&&w.alternatePhone?null==e||null===(N=e.editAddressData)||void 0===N?void 0:N.alternatePhone:null==e||null===(I=e.editAddressData)||void 0===I?void 0:I.phone:null==e||null===(k=e.editAddressData)||void 0===k?void 0:k.phone),[nl,tl]=(0,n.useState)(!1),[ol,al]=(0,n.useState)(!1),[dl,rl]=(0,n.useState)("");let sl;var ul,cl,vl,ml;sl=null!=e&&null!==(T=e.editAddressData)&&void 0!==T&&T.tags&&null!=e&&null!==(P=e.editAddressData)&&void 0!==P&&null!==(j=P.tags)&&void 0!==j&&j.includes("other")?null==e||null===(ul=e.editAddressData)||void 0===ul||null===(cl=ul.tags)||void 0===cl||null===(vl=cl.split(":"))||void 0===vl||null===(ml=vl[1])||void 0===ml?void 0:ml.trim():"";const[gl,pl]=(0,n.useState)({city:null!==(F=null==e||null===(R=e.editAddressData)||void 0===R?void 0:R.city)&&void 0!==F?F:"",state:null!==(L=null==e||null===(O=e.editAddressData)||void 0===O?void 0:O.state)&&void 0!==L?L:"",name:null!==(M=null==e||null===(U=e.editAddressData)||void 0===U?void 0:U.firstName)&&void 0!==M?M:"",lastName:null!==(Z=null==e||null===(B=e.editAddressData)||void 0===B?void 0:B.lastName)&&void 0!==Z?Z:"",gender:null!==(H=null==e||null===(V=e.editAddressData)||void 0===V?void 0:V.gender)&&void 0!==H?H:"",email:null!=je&&null!==(G=je.sellerConfig)&&void 0!==G&&G.removeEmailFromCodForm?"":null!=e&&null!==(W=e.editAddressData)&&void 0!==W&&W.email?null==e||null===(q=e.editAddressData)||void 0===q?void 0:q.email:"",line1:null!==(z=(0,_.Oy)(null==e||null===(Y=e.editAddressData)||void 0===Y?void 0:Y.line1,null==je||null===(Q=je.sellerConfig)||void 0===Q?void 0:Q.removeSpecialChrFromAdr))&&void 0!==z?z:"",line2:null!==(J=(0,_.Oy)(null==e||null===(K=e.editAddressData)||void 0===K?void 0:K.line2,null==je||null===($=je.sellerConfig)||void 0===$?void 0:$.removeSpecialChrFromAdr))&&void 0!==J?J:"",landmark:null!==(X=null==e||null===(ee=e.editAddressData)||void 0===ee||null===(le=ee.landmark)||void 0===le?void 0:le.trim())&&void 0!==X?X:"",completeAdd:"",altPhone:null!==(ie=null==e||null===(ne=e.editAddressData)||void 0===ne?void 0:ne.alternatePhone)&&void 0!==ie?ie:"",tags:sl}),[hl,yl]=(0,n.useState)({name:b.name,lastName:b.lastName,line1:b.line1,line2:b.line2,gender:null!=je&&null!==(te=je.sellerConfig)&&void 0!==te&&te.genderInAddressEnabled?null!=e&&null!==(oe=e.editAddressData)&&void 0!==oe&&oe.gender?"":b.gender:"",landmark:null!=je&&null!==(ae=je.sellerConfig)&&void 0!==ae&&ae.landmarkMandatory?b.landmark:"",city:b.city,email:null!=je&&null!==(de=je.sellerConfig)&&void 0!==de&&de.removeEmailFromCodForm?"":null!==(re=je.sellerConfig)&&void 0!==re&&re.showEmail?b.email:"",state:"",phone:null!=je&&null!==(se=je.sellerConfig)&&void 0!==se&&se.enableAdrrPhone?null!=e&&null!==(ue=e.editAddressData)&&void 0!==ue&&ue.alternatePhone||null!=e&&null!==(ce=e.editAddressData)&&void 0!==ce&&ce.phone?"":"Enter your phone number":"",tags:"others"===Xe?null==b?void 0:b.tags:""}),[fl,_l]=(0,n.useState)({name:"",lastName:"",gender:"",line1:"",line2:"",landmark:"",city:"",email:"",state:"",phone:"",tags:""}),[Cl,xl]=(0,n.useState)(""),[bl,Al]=(0,n.useState)(""),[El,Sl]=(0,n.useState)(""),Dl=(0,r.I0)(),wl=(e,l)=>{yl((i=>({...i,[e]:l})))},Nl=(e,l)=>{_l((i=>({...i,[e]:l})))};function Il(e){return Object.keys(e).find((l=>""!==e[l]))}(0,n.useEffect)((()=>{var l;let i;var n,t,o;null!=e&&null!==(l=e.editAddressData)&&void 0!==l&&l.tags?(i="home"===(null==e||null===(n=e.editAddressData)||void 0===n?void 0:n.tags)||"office"===(null==e||null===(t=e.editAddressData)||void 0===t?void 0:t.tags)?null==e||null===(o=e.editAddressData)||void 0===o?void 0:o.tags:"others",$e(!0)):(i="home",$e(!1)),el(i)}),[]),(0,n.useEffect)((()=>{if(Te.addressUpdated){"sr-login"===me.get("login")&&(Te.editAddressCustomCheckout=!1,null==e||e.onRenderLoading()),e.SetIsOpen&&e.SetIsOpen(!1),c.Z.additionalEvents("address-edited",null==Pe?void 0:Pe.Cart_data,ke.couponCode,!!p.y.getItem("refreshToken"),!1);let l=null==Te?void 0:Te.Address_data,i=null==l?void 0:l.map((e=>(null==e?void 0:e.addressID)===(null==Te?void 0:Te.updatedAddress.addressID)?null==Te?void 0:Te.updatedAddress:e));Te.Address_data=i,Te.selectedAddress=null==Te?void 0:Te.updatedAddress,Fe.serviceFetched=!1,Pe.orderFetched=!1,Te.defaultAddressCorrect=!0,null!=e&&e.verifyAddress&&(null==e||e.onRender())}}),[Te.addressUpdated]),(0,n.useEffect)((()=>{let e=!0,l=!0;Object.values(hl).forEach((l=>{""!==l&&(e=!1)})),Object.values(fl).forEach((e=>{""!==e&&(l=!1)})),Ye(e&&l)}),[hl,fl]);const kl=(0,n.useMemo)((()=>{var e;let l="pincode",i=Il(hl),n=Il(fl);return l=null!==(e=Object.keys(hl).find((e=>e===i||e===n)))&&void 0!==e?e:"pincode",l}),[hl,fl]),Tl=(0,n.useMemo)((()=>Be?Be.length<6&&Be.length>=1||Be.length>6||he?"Pincode must consist of 6 digit":"":"Enter your pincode"),[Be,he]),Pl=(0,n.useMemo)((()=>Ue?"Please enter a valid pincode":""),[Ue]);(0,n.useEffect)((()=>{console.log("IaminErrorBlock"),null!==Te.failMsg&&(gl.line1="",gl.line2="",Ie.Pincode_data={},Ie.pincode="",je.addSilentUserAddress=!1,e.onRender(),Ne(),Oe||(c.Z.pincodeFieldDisplayed(),console.log("hi parv")),Me(!0))}),[Te.failMsg]),(0,n.useEffect)((()=>{null!==Te.invalidEmail&&(gl.email="",je.addSilentUserAddress=!1,e.onRender())}),[Te.invalidEmail]),(0,n.useEffect)((()=>{var l,i,n,t,o,a,d,r,s;null!=Te&&Te.selectedAddress&&null!=Pe&&null!==(l=Pe.orderDetails)&&void 0!==l&&l.id&&e.setAddressToShow({name:"".concat(null!==(i=null==Te?void 0:Te.selectedAddress.firstName)&&void 0!==i?i:"Customer"," ").concat(null!==(n=null==Te?void 0:Te.selectedAddress.lastName)&&void 0!==n?n:""),email:null==Te?void 0:Te.selectedAddress.email,address:"".concat(null==Te?void 0:Te.selectedAddress.line1,", ").concat(null!=Te&&null!==(t=Te.selectedAddress)&&void 0!==t&&t.line2?(null==Te||null===(o=Te.selectedAddress)||void 0===o?void 0:o.line2)+",":""," ").concat(null!=Te&&null!==(a=Te.selectedAddress)&&void 0!==a&&a.landmark?"Landmark-"+(null==Te||null===(d=Te.selectedAddress)||void 0===d?void 0:d.landmark)+",":""," ").concat(null==Te?void 0:Te.selectedAddress.city,", ").concat(null==Te?void 0:Te.selectedAddress.state,", ").concat(null==Te?void 0:Te.selectedAddress.pincode),address_id:null==Te?void 0:Te.selectedAddress.addressID,customer_id:je.userInfo.user_id,count:"",index:"",alternatePhone:null===(r=Te.selectedAddress)||void 0===r?void 0:r.alternatePhone,tags:null===(s=Te.selectedAddress)||void 0===s?void 0:s.tags})}),[JSON.stringify(Te.selectedAddress)]);const jl=async e=>{Ze(!1),Te.fail=!1,He(e.slice(0,6)),Ne();let l={postcode:e.substring(0,6)};if(6===e.length){c.Z.pincodeAdded(),c.Z.addressFieldsDisplayed(),Ze(!1);try{qe(!0);const e=await m.Z.getWithParams(g.Z.GET_PINCODE(),l);var i,n,t,o,a,d;qe(!1),e&&(console.log(e),pl({...gl,city:null==e||null===(i=e.data)||void 0===i||null===(n=i.postcode_details)||void 0===n?void 0:n.city,state:null==e||null===(t=e.data)||void 0===t||null===(o=t.postcode_details)||void 0===o?void 0:o.state}),Rl("city",null==e||null===(a=e.data)||void 0===a||null===(d=a.postcode_details)||void 0===d?void 0:d.city),Ge(!0),Ze(!1))}catch(e){console.log(e),Ze(!0),pe(!0),qe(!1)}}};(0,n.useEffect)((()=>{jl(Be)}),[]),(0,n.useEffect)((()=>{try{var e;if(null!=je&&null!==(e=je.sellerConfig)&&void 0!==e&&e.addressVerify||null!=Te&&Te.addressFailMsg){var l,i,n;null===(l=document.getElementById("line1"))||void 0===l||l.focus();const e=(0,_.aW)(gl.line1,null==je||null===(i=je.sellerConfig)||void 0===i?void 0:i.domainName,null==je||null===(n=je.sellerConfig)||void 0===n?void 0:n.addressLayoutNew);wl("line1",null==e?void 0:e.errorMessage),Nl("line1",null==e?void 0:e.activeErrorMessage)}}catch(e){console.log(e)}}),[null==Te?void 0:Te.addressFailMsg]);const Fl=(Be.length<6||Ue||We||"".concat(null!=Pe&&Pe.cardDesignEnabled?"EditAddress_addressTag_selected_card__SKXUe":"EditAddress_addressTag_selected__EFs5s"),Be.length<6||Ue||We),Rl=(e,l)=>{((e,l)=>{var i,n;const t=null===(i=(null==gl?void 0:gl.line1)+(null==gl?void 0:gl.line2)+(null==gl?void 0:gl.landmark))||void 0===i?void 0:i.match(/[a-zA-Z0-9]/g);if(null!==(n=je.sellerConfig)&&void 0!==n&&n.addressVerify){var o,a,d;const e=(0,_.r1)(null===(o=je.sellerConfig)||void 0===o?void 0:o.blockAddressWithInvalidAddressLines,null===(a=je.sellerConfig)||void 0===a?void 0:a.invalidAddressLineNumber,t,null==je||null===(d=je.sellerConfig)||void 0===d?void 0:d.addressLayoutNew);tl(null==e?void 0:e.isError),al(null==e?void 0:e.isError),rl(null==e?void 0:e.errorMessage)}switch(e){case"name":var r;if(null!==(r=je.sellerConfig)&&void 0!==r&&r.addressVerify){var s,u,c,v,m,g;const i=/^(?!\.)([A-Za-z\s.]+)$/,n=/[a-zA-Z0-9]/g,t=l.match(n);""===l?wl(e,"Minimum 1 Character is required"):i.test(l)?" "===(null===(s=l)||void 0===s?void 0:s[0])?wl(e,"Space at the start not allowed"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(u=l)||void 0===u||null===(c=u.toLowerCase())||void 0===c?void 0:c.trim())?wl(e,"Given name is invalid"):"sr-login"===me.get("login")&&l.length>49?wl(e,"First name can’t be longer than 49 characters"):(null==t?void 0:t.length)>60?wl(e,"Character length exceeded"):wl(e,""):wl(e,"Use only alphabets (A-Z, a-z)"),0===l.length?Nl(e,""):i.test(l)?" "===(null===(v=l)||void 0===v?void 0:v[0])?Nl(e,"Space at the start not allowed"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(m=l)||void 0===m||null===(g=m.toLowerCase())||void 0===g?void 0:g.trim())?Nl(e,"Given name is invalid"):"sr-login"===me.get("login")&&l.length>49?wl(e,"First name can’t be longer than 49 characters"):(null==t?void 0:t.length)>60?Nl(e,"Character length exceeded"):Nl(e,""):Nl(e,"Use only alphabets (A-Z, a-z)");break}{const i=/^[A-Za-z\s]+$/;wl(e,""===l?"Enter your first name.":""),0===l.length?Nl(e,""):" "==l[0]?Nl(e,"Avoid starting with a space"):"sr-login"===me.get("login")&&l.length<3?wl(e,"First name can’t be smaller than 3 characters"):"sr-login"===me.get("login")&&l.length>49?wl(e,"First name can’t be longer than 49 characters"):i.test(l)?l.length>60?Nl(e,"First name can’t be longer than 60 characters"):Nl(e,""):Nl(e,"Use only alphabets (A-Z, a-z)");break}case"lastName":var p;if(null!==(p=je.sellerConfig)&&void 0!==p&&p.addressVerify){var y,C,x,A,E,S,D,w;const i=/^(?!\.)([A-Za-z\s.]+)$/,n=/[a-zA-Z0-9]/g,t=l.match(n);""===l?wl(e,"Minimum 2 character required"):" "==(null===(y=l)||void 0===y?void 0:y[0])?wl(e,"Avoid starting with a space"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(C=l)||void 0===C||null===(x=C.toLowerCase())||void 0===x?void 0:x.trim())?wl(e,"Given name is invalid"):"sr-login"===me.get("login")&&(null===(A=l)||void 0===A?void 0:A.length)<3?wl(e,"Last name can’t be smaller than 3 characters"):"sr-login"===me.get("login")&&(null===(E=l)||void 0===E?void 0:E.length)>49?wl(e,"Last name can’t be longer than 49 characters"):wl(e,""),(null===(S=l)||void 0===S?void 0:S.length)<2?Nl(e,"Minimum 2 character required"):null!==f.TJ&&void 0!==f.TJ&&f.TJ.includes(null===(D=l)||void 0===D||null===(w=D.toLowerCase())||void 0===w?void 0:w.trim())?Nl(e,"Given name is invalid"):i.test(l)?(null==t?void 0:t.length)>60?Nl(e,"Character length exceeded"):Nl(e,""):Nl(e,"Use only alphabets (A-Z, a-z)");break}{const i=/^[A-Za-z\s]+$/;wl(e,""===l?"Enter your last name.":""),0===l.length?Nl(e,""):" "==l[0]?Nl(e,"Avoid starting with a space"):"sr-login"===me.get("login")&&l.length<3?wl(e,"Last name can’t be smaller than 3 characters"):"sr-login"===me.get("login")&&l.length>49?wl(e,"Last name can’t be longer than 49 characters"):i.test(l)?l.length>60?Nl(e,"Last name can’t be longer than 60 characters"):Nl(e,""):Nl(e,"Use only alphabets (A-Z, a-z)");break}case"gender":wl(e,""===l?"Select your gender.":"");break;case"landmark":var N,I;if(null!==(N=je.sellerConfig)&&void 0!==N&&N.addressVerify){var k;const i=(0,_.Ve)(l,null==je||null===(k=je.sellerConfig)||void 0===k?void 0:k.landmarkMandatory);wl(e,null==i?void 0:i.errorMessage),Nl(e,null==i?void 0:i.activeErrorMessage);break}null!=je&&null!==(I=je.sellerConfig)&&void 0!==I&&I.landmarkMandatory&&""===l?wl(e,"Enter your landmark"):wl(e,""),""===l?Nl(e,""):" "==l[0]?Nl(e,"Avoid starting with a space"):l.length>50?Nl(e,"Landmark can’t be longer than 50 characters"):Nl(e,"");break;case"email":var T;if(null!==(T=je.sellerConfig)&&void 0!==T&&T.addressVerify){var P,j,F,R,L,O;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n=null===(P=l)||void 0===P||null===(j=P.toLowerCase().trim())||void 0===j?void 0:j.split("@")[1];null!==(F=je.sellerConfig)&&void 0!==F&&F.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?Nl(e,b.email):null!==(R=je.sellerConfig)&&void 0!==R&&R.showEmail&&null!==f.hC&&void 0!==f.hC&&f.hC.includes(n)?Nl(e,"Invalid email"):Nl(e,""),null!==(L=je.sellerConfig)&&void 0!==L&&L.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?wl(e,b.email):null!==(O=je.sellerConfig)&&void 0!==O&&O.showEmail&&null!==f.hC&&void 0!==f.hC&&f.hC.includes(n)?wl(e,"Invalid email"):wl(e,"");break}{var M;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;null!==(M=je.sellerConfig)&&void 0!==M&&M.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?wl(e,b.email):wl(e,"");break}case"line1":var U;if(null!==(U=je.sellerConfig)&&void 0!==U&&U.addressVerify){var Z,B;Te.addressFailMsg=!1;const i=(0,_.aW)(l,null==je||null===(Z=je.sellerConfig)||void 0===Z?void 0:Z.domainName,null==je||null===(B=je.sellerConfig)||void 0===B?void 0:B.addressLayoutNew);wl(e,null==i?void 0:i.errorMessage),Nl(e,null==i?void 0:i.activeErrorMessage);break}{var H;const i=/^[ A-Za-z0-9_@./,#&+\-()/\n]{0,255}$/;xl(l.trim().length.toString()),""===l.trim()?wl(e,b.line1):wl(e,""),""===l.trim()?Nl(e,""):l.trim().length>255?Nl(e,"Address line 1 cannot be longer than 255 characters"):i.test(l.trim())?"thehatke.com"===(null==je||null===(H=je.sellerConfig)||void 0===H?void 0:H.domainName)&&l.trim().length<4?Nl(e,"Address line 1 cannot be less than 4 characters"):Nl(e,""):Nl(e,"Allowed special characters _ @ . / , # & + - ");break}case"line2":{var V;const i=/^[ A-Za-z0-9_@./,#&+-/\n]{0,170}$/;if(Sl(l.trim().length.toString()),null!==(V=je.sellerConfig)&&void 0!==V&&V.addressVerify){const i=(0,_.c2)(l);wl(e,null==i?void 0:i.errorMessage),Nl(e,null==i?void 0:i.activeErrorMessage);break}""===l.replace(/\s/g,"")?wl(e,b.line2):l.trim().length<10?wl(e,"Minimum 10 characters required"):wl(e,""),""===l.trim()?Nl(e,""):l.trim().length>170?Nl(e,"Address line 2 cannot be longer than 170 characters"):i.test(l.trim())?Nl(e,""):Nl(e,"Allowed special characters _ @ . / , # & + - ");break}case"city":{const i=h.N9;Ie.city=l,wl(e,""==l?b.city:""),""==l?Nl(e,""):" "==l[0]?Nl(e,"Avoid starting with a space"):i.test(l)?l.length>100?Nl(e,"City can’t be longer than 100 characters"):Nl(e,""):Nl(e,h.bG);break}case"tags":var G,W;""==(null===(G=l)||void 0===G?void 0:G.trim())&&"others"===Xe?wl(e,b.tags):wl(e,""),""===(null===(W=l)||void 0===W?void 0:W.trim())?Nl(e,""):l.startsWith(" ")?Nl(e,"Avoid starting with a space"):Nl(e,"");break;case"contact":""===(l=l.substring(0,10))||10!==l.length?wl(e,b.contact):wl(e,"")}})(e,l),pl((i=>({...i,[e]:l})))};return(0,n.useEffect)((()=>{var e;Rl("line1",gl.line1),Rl("city",gl.city),Rl("line2",gl.line2),Rl("name",gl.name),Rl("lastName",gl.lastName),null!=je&&null!==(e=je.sellerConfig)&&void 0!==e&&e.removeEmailFromCodForm||Rl("email",gl.email),Rl("landmark",gl.landmark)}),[]),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{children:[!(null!=Te&&Te.defaultAddressCorrect)&&(null!=Pe&&Pe.cardDesignEnabled?(0,x.jsx)("div",{className:"card-main-heading",style:{paddingBottom:"10px"},children:"Add shipping address"}):(0,x.jsx)("h4",{style:{paddingBottom:"10px"},children:"Add shipping address"})),(null==je||null===(Ll=je.sellerConfig)||void 0===Ll?void 0:Ll.enableInternationalAddress)&&(0,x.jsxs)("h5",{style:{paddingBottom:"10px",font:"500 14px/12px var(--font-family)"},children:["Do you like to have your order ",(0,x.jsx)("a",{onClick:()=>(()=>{if(me.get("cart-resume-id")){var e,l;if(h.ZW.shopify===(null==Pe||null===(e=Pe.platform)||void 0===e?void 0:e.toUpperCase())){var i;let e="";for(let l of null==Pe||null===(n=Pe.orderDetails)||void 0===n?void 0:n.lineItems){var n;e=e+l.itemId+":"+l.quantity+","}const l="http://".concat(null==je||null===(i=je.sellerConfig)||void 0===i?void 0:i.domainName,"/cart/").concat(e);window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===l[(null==l?void 0:l.length)-1]?null==l?void 0:l.slice(0,(null==l?void 0:l.length)-1):l}}]},"*")}if(h.ZW.wooCommerce===(null==Pe||null===(l=Pe.platform)||void 0===l?void 0:l.toUpperCase())){var t;let e="http://".concat(null==je||null===(t=je.sellerConfig)||void 0===t?void 0:t.domainName,"/checkout");window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:e}}]},"*")}}else{var o,a,d,r,s,u,c,v,m;h.ZW.shopify===(null==je?void 0:je.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===(null===(o=je.channel)||void 0===o?void 0:o.redirectUrl[(null===(a=je.channel)||void 0===a||null===(d=a.redirectUrl)||void 0===d?void 0:d.length)-1])?null===(r=je.channel)||void 0===r||null===(s=r.redirectUrl)||void 0===s?void 0:s.slice(0,(null===(u=je.channel)||void 0===u||null===(c=u.redirectUrl)||void 0===c?void 0:c.length)-1):null===(v=je.channel)||void 0===v?void 0:v.redirectUrl}}]},"*"),h.ZW.wooCommerce===(null==je?void 0:je.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null===(m=je.channel)||void 0===m?void 0:m.redirectUrl}}]},"*")}})(),style:{color:"var(--primary-color)",cursor:"pointer"},children:" shipped outside India?"})]}),(0,x.jsx)("div",{className:null!=Pe&&Pe.cardDesignEnabled||je.AuthTokenGenerated?"":"mtNeg-18",children:(0,x.jsx)(a.Z,{label:"Pincode",type:"text",id:"pincode",name:"pincode",value:Be,className:"mt-18",onChange:e=>{e.target.value.match(/^[\d]{0,6}$/g)&&jl(e.target.value)},error:Tl,activeErrors:Pl,loading:We,touched:ge,autoComplete:"postal-code",mandatory:!0,marginTop:null!=Pe&&Pe.cardDesignEnabled?"8px":""})}),Te.failMsg&&(0,x.jsx)(u.Z,{msg:Te.failMsg}),(0,x.jsxs)("div",{children:[(0,x.jsx)(a.Z,{label:"First name",type:"text",id:"name",name:"name",value:gl.name,className:"mr-10 mt-18",maxLength:"60",onInput:e=>Rl("name",e.target.value),error:hl.name,activeErrors:fl.name,disabled:Be.length<6||Ue||We,autoComplete:"given-name",touched:null==Qe?void 0:Qe.includes("name"),setSkipErrorField:Je,mandatory:!0}),(0,x.jsx)(a.Z,{label:"Last name",type:"text",id:"lastName",name:"name",value:gl.lastName,className:"mr-10 mt-18",maxLength:"60",onInput:e=>Rl("lastName",e.target.value),error:hl.lastName,activeErrors:fl.lastName,disabled:Be.length<6||Ue||We,autoComplete:"family-name",skippedArray:["name"],touched:null==Qe?void 0:Qe.includes("lastName"),setSkipErrorField:Je,mandatory:!0}),(null==je||null===(Ol=je.sellerConfig)||void 0===Ol?void 0:Ol.genderInAddressEnabled)&&(0,x.jsxs)(y.Z,{id:"gender",label:"Gender",placeholder:"Gender",name:"gender",className:"mt-18",value:gl.gender,onChange:e=>{Rl("gender",e.target.value)},error:hl.gender,disabled:Be.length<6||Ue||We,touched:null==Qe?void 0:Qe.includes("gender"),activeErrors:fl.gender,skippedArray:["name","lastName"],setSkipErrorField:Je,mandatory:!0,children:[(0,x.jsx)("option",{disabled:!0,value:"",hidden:!0,children:null!=Pe&&Pe.cardDesignEnabled?"":"Select your gender"}),(0,x.jsx)("option",{value:"male",children:"Male"}),(0,x.jsx)("option",{value:"female",children:"Female"})]}),(0,x.jsx)(a.Z,{label:"thehatke.com"!==(null==je||null===(Ml=je.sellerConfig)||void 0===Ml?void 0:Ml.domainName)?"Flat, house number, floor, building":"Address line 1 (Flat, house number, floor, building)",type:"textarea",id:"line1",name:"address",value:gl.line1,onInput:e=>Rl("line1","".concat(e.target.value)),error:hl.line1,activeErrors:fl.line1,lenError:Cl,className:"mt-18",defaultValue:gl.line1,disabled:Be.length<6||Ue||We,autoComplete:"address-line1",maxLength:"255",skippedArray:["name","lastName","gender"],touched:null==Qe?void 0:Qe.includes("line1"),setSkipErrorField:Je,mandatory:!0}),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(a.Z,{label:"thehatke.com"!==(null==je||null===(Ul=je.sellerConfig)||void 0===Ul?void 0:Ul.domainName)?"Area, street, sector, village":"Address line 2 (Area, street, sector, village)",type:"textarea",id:"line2",name:"address",value:gl.line2,onInput:e=>Rl("line2","".concat(e.target.value)),error:hl.line2,activeErrors:fl.line2,lenError:El,className:"mt-18",defaultValue:gl.line2,disabled:Be.length<6||Ue||We,autoComplete:"address-line2",maxLength:"170",skippedArray:["name","lastName","line1","gender"],touched:null==Qe?void 0:Qe.includes("line2"),setSkipErrorField:Je,mandatory:!0})}),be||gl.landmark||null!=je&&null!==(Zl=je.sellerConfig)&&void 0!==Zl&&Zl.landmarkMandatory?(0,x.jsx)(a.Z,{label:"Landmark",type:"text",id:"landmark",name:"landmark",value:gl.landmark,onInput:e=>Rl("landmark",e.target.value),className:"mt-18",maxLength:"50",disabled:Be.length<6||Ue||We,error:hl.landmark,activeErrors:fl.landmark,autoComplete:"landmark",skippedArray:["name","lastName","line1","line2","gender"],touched:null==Qe?void 0:Qe.includes("landmark"),setSkipErrorField:Je,mandatory:!(null==je||null===(Bl=je.sellerConfig)||void 0===Bl||!Bl.landmarkMandatory)}):!(null!=je&&null!==(Hl=je.sellerConfig)&&void 0!==Hl&&Hl.landmarkMandatory)&&(0,x.jsx)("button",{onClick:()=>Ae(!0),className:null!=Pe&&Pe.cardDesignEnabled?"EditAddress_LandmarkButtonCard__LVAzG":"EditAddress_LandmarkButton__fSEHp",children:"+ Landmark area"}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a.Z,{id:"phone",name:"phone",label:"Receiver’s number",type:"tel",autoComplete:"tel",className:"mt-18",onChange:async e=>{var l,i;let n=e.target.value;il(n);let t=!1;t=!!(n.length>0&&0===Number(n[0])),null!=je&&null!==(l=je.sellerConfig)&&void 0!==l&&l.enableAdrrPhone&&0===n.length?wl("phone","Enter your phone number"):wl("phone",""),null!=je&&null!==(i=je.sellerConfig)&&void 0!==i&&i.enableAdrrPhone&&(10!==n.length||t)?0===n.length?Nl("phone",""):Nl("phone","Please enter valid phone number"):Nl("phone","")},onInput:e=>{e.target.value=e.target.value.replace(/[^0-9]/g,""),e.target.value=e.target.value.substring(0,13);for(var l=document.querySelectorAll('input[type="number"]'),i=l.length;i--;)l[i].setAttribute("pattern","\\d*")},skippedArray:["name","lastName","line1","line2","landmark","gender"],touched:null==Qe?void 0:Qe.includes("phone"),setSkipErrorField:Je,mandatory:!0,activeErrors:fl.phone,error:hl.phone,value:ll,disabled:null==je||null===(Vl=je.sellerConfig)||void 0===Vl||!Vl.enableAdrrPhone||Be.length<6||Ue||We}),(0,x.jsx)("span",{className:o,children:" We'll contact you on this number during delivery "})]}),(0,x.jsxs)("div",{className:t,children:[(0,x.jsx)(a.Z,{label:"City",type:"text",id:"city",name:"city",value:gl.city,onInput:e=>Rl("city",e.target.value),className:"mr-18",maxLength:"100",error:hl.city,activeErrors:fl.city,autoComplete:"address-level2",disabled:Be.length<6||Ue||We,skippedArray:["name","lastName","line1","line2","landmark","phone","gender"],touched:null==Qe?void 0:Qe.includes("city"),setSkipErrorField:Je,mandatory:!0}),(0,x.jsx)(a.Z,{label:"State",type:"text",id:"state",name:"state",value:gl.state,disabled:!0,skippedArray:["name","lastName","line1","line2","landmark","city","phone","gender"],touched:null==Qe?void 0:Qe.includes("state"),setSkipErrorField:Je,mandatory:!0,skipPincodeFocus:!(Be.length<6||Ue||We)})]}),!(null!=je&&null!==(Gl=je.sellerConfig)&&void 0!==Gl&&Gl.removeEmailFromCodForm)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a.Z,{label:null!==(Wl=je.sellerConfig)&&void 0!==Wl&&Wl.showEmail?"E-mail":"E-mail (optional)",type:"text",id:"email",name:"email",value:gl.email,onInput:e=>Rl("email",e.target.value),error:hl.email,activeErrors:!(null===(ql=je.sellerConfig)||void 0===ql||!ql.addressVerify)&&fl.email,className:"mt-18",disabled:Be.length<6||Ue||We,autoComplete:"email",skippedArray:["name","lastName","line1","line2","landmark","city","phone","gender"],touched:null==Qe?void 0:Qe.includes("email"),setSkipErrorField:Je,mandatory:!(null===(zl=je.sellerConfig)||void 0===zl||!zl.showEmail)}),(0,x.jsx)("div",{className:o,children:"Order delivery details will be sent here"}),Te.invalidEmail&&(0,x.jsx)(u.Z,{msg:Te.invalidEmail})]}),(0,x.jsx)("div",{className:"".concat(t),children:(0,x.jsxs)("div",{style:{width:"100%",marginTop:8},children:[(0,x.jsx)(C.Z,{selectedTag:Xe,handleAddressTag:e=>{Be.length<6||Ue||We||("others"===e?($e(!0),yl((e=>({...e,tags:b.tags})))):($e(!1),pl((e=>({...e,tags:""}))),yl((e=>({...e,tags:""}))),_l((e=>({...e,tags:""})))),el(e))},error:Fl}),Ke&&"others"===Xe?(0,x.jsx)("div",{className:null!=Pe&&Pe.cardDesignEnabled||je.AuthTokenGenerated?"":"mtNeg-18",children:(0,x.jsx)(a.Z,{label:"Save address as",type:"text",id:"tags",name:"tags",value:gl.tags,className:"mr-10 mt-18",onInput:e=>Rl("tags",e.target.value),error:hl.tags,maxLength:"25",activeErrors:fl.tags,mandatory:"others"===Xe&&!0})}):""]})}),(0,x.jsxs)("div",{className:"EditAddress_buttonContainer__CEr0j",children:[(0,x.jsx)("div",{style:{marginTop:6},children:ol&&(0,x.jsx)(u.Z,{msg:dl})}),Te.spinner&&(0,x.jsx)(v.Z,{}),(0,x.jsx)(d.Z,{loading:Te.updatingAddress,id:"addAddressBtn",type:"button",onClick:()=>{console.log("TheBat",gl),(async()=>{var l,i,n,t,o,a,d,r,u,c,v,m,g,p,h,y,f,_,C;if(gl.line1&&gl.line2&&(null===(l=gl.line1)||void 0===l?void 0:l.trim())===(null===(i=gl.line2)||void 0===i?void 0:i.trim()))return tl(!0),al(!0),void rl("Address line1 and address line2 cannot be same");if(!ze||Be.length<6||Te.updatingAddress||Ue)if(Be.length<6||Ue||We){var x;null===(x=document.getElementById("pincode"))||void 0===x||x.focus()}else{var b;const e=["line1","line2","landmark"];var A,E;null!=je&&null!==(b=je.sellerConfig)&&void 0!==b&&b.addressVerify&&nl&&!e.includes(kl)?(al(!0),null===(A=document.getElementById("line2"))||void 0===A||A.focus()):(al(!1),null===(E=document.getElementById(kl))||void 0===E||E.focus())}else null!=je&&je.otpSkip?(await Dl({type:"SKIP_Otp_Address_add",payload:{...e.editAddressData,city:null==gl||null===(n=gl.city.trim())||void 0===n?void 0:n.replace(/\./g," "),state:null==gl?void 0:gl.state,firstName:null==gl?void 0:gl.name.trim(),lastName:null==gl?void 0:gl.lastName.trim(),email:null==gl?void 0:gl.email,line1:null==gl||null===(t=gl.line1.trim())||void 0===t?void 0:t.replace(/[()]/g," "),line2:null==gl?void 0:gl.line2.trim(),gender:null!==(o=gl.gender)&&void 0!==o?o:"",landmark:gl.landmark.trim(),pincode:Be,alternatePhone:ll!==je.mobileNumber?ll:null,country:null!==(a=e.editAddressData)&&void 0!==a&&a.country?null===(d=e.editAddressData)||void 0===d?void 0:d.country:"India",cartId:null==Pe||null===(r=Pe.Cart_data)||void 0===r?void 0:r.id,emailConfirmed:!0,...(null==e||null===(u=e.editAddressData)||void 0===u?void 0:u.addressTag)&&{addressTag:null},tags:"others"===Xe?"other: ".concat(null==gl?void 0:gl.tags):Xe,...(null===(c=je.sellerConfig)||void 0===c?void 0:c.addressVerify)&&{source:"checkout"}}}),e.SetIsOpen(!1),Fe.serviceFetched=!1,Pe.orderFetched=!1,Te.defaultAddressCorrect=!0,null==e||e.onRender()):Dl((0,s.y3)({...e.editAddressData,city:null==gl||null===(v=gl.city.trim())||void 0===v?void 0:v.replace(/\./g," "),state:null==gl?void 0:gl.state,firstName:null==gl?void 0:gl.name.trim(),lastName:null==gl?void 0:gl.lastName.trim(),email:null==gl?void 0:gl.email,line1:null==gl||null===(m=gl.line1)||void 0===m||null===(g=m.trim())||void 0===g?void 0:g.replace(/[()]/g," "),line2:null==gl?void 0:gl.line2.trim(),landmark:gl.landmark.trim(),pincode:Be,gender:null!==(p=gl.gender)&&void 0!==p?p:"",country:null!==(h=e.editAddressData)&&void 0!==h&&h.country?null===(y=e.editAddressData)||void 0===y?void 0:y.country:"India",alternatePhone:ll!==je.mobileNumber?ll:null,cartId:null==Pe||null===(f=Pe.Cart_data)||void 0===f?void 0:f.id,...(null==e||null===(_=e.editAddressData)||void 0===_?void 0:_.addressTag)&&{addressTag:null},tags:"others"===Xe?"other: ".concat(null==gl?void 0:gl.tags):Xe,...(null===(C=je.sellerConfig)||void 0===C?void 0:C.addressVerify)&&{source:"checkout"}},je.userInfo.user_id,je.sellerConfig.seller_id,!(null==e||!e.verifyAddress)))})()},className:"mt-30",isCardDesign:null==Pe?void 0:Pe.cardDesignEnabled,children:Te.updatingAddress?"Saving address... ":"Save and select"}),(0,x.jsx)("input",{type:"hidden",id:"editAddressFastrr"})]})]})]})})});var Ll,Ol,Ml,Ul,Zl,Bl,Hl,Vl,Gl,Wl,ql,zl}},5402:(e,l,i)=>{i.d(l,{Z:()=>x});var n=i(7313);const t="EditAddressNew_addressDiv__OPYbu";var o=i(9369),a=i(528),d=i(6352),r=i(6280),s=i(3624),u=i(7075),c=i(2855),v=i(4835),m=i(2718),g=i(1608),p=i(1805),h=i(3366),y=i(4460),f=i(7088),_=i(6809),C=i(6417);const x=e=>{var l,i,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee;const le=window.location.search;let ie=new URLSearchParams(le);const[ne,te]=(0,n.useState)(!1),[oe,ae]=(0,n.useState)(!1),[de,re]=(0,n.useState)(0),se=()=>re((e=>1^e)),ue=(0,d.v9)((e=>e.Delivery)),ce=(0,d.v9)((e=>e.Coupon)),ve=((0,d.v9)((e=>e.Otp)),(0,d.v9)((e=>e.Address))),me=(0,d.v9)((e=>e.Cart)),ge=(0,d.v9)((e=>e.Login)),pe=(0,d.v9)((e=>e.Shipping)),[he,ye]=(0,n.useState)(!1),[fe,_e]=(0,n.useState)(!1),[Ce,xe]=(0,n.useState)(null!==(l=null==e||null===(i=e.editAddressData)||void 0===i?void 0:i.pincode)&&void 0!==l?l:""),[be,Ae]=(0,n.useState)(!1),[Ee,Se]=(0,n.useState)(!1),[De,we]=(0,n.useState)(!0),[Ne,Ie]=(0,n.useState)([]),[ke,Te]=(0,n.useState)(null!=ge&&null!==(x=ge.sellerConfig)&&void 0!==x&&x.enableAdrrPhone?null!=e&&null!==(b=e.editAddressData)&&void 0!==b&&b.alternatePhone?null==e||null===(A=e.editAddressData)||void 0===A?void 0:A.alternatePhone:null==e||null===(E=e.editAddressData)||void 0===E?void 0:E.phone:null==e||null===(S=e.editAddressData)||void 0===S?void 0:S.phone),[Pe,je]=(0,n.useState)("others"===(null==e||null===(D=e.editAddressData)||void 0===D?void 0:D.tags)),[Fe,Re]=(0,n.useState)(null!==(w=null==e||null===(N=e.editAddressData)||void 0===N?void 0:N.tags)&&void 0!==w?w:"home"),[Le,Oe]=(0,n.useState)(!1),[Me,Ue]=(0,n.useState)(!1),[Ze,Be]=(0,n.useState)("");let He;var Ve,Ge,We,qe;He=null!=e&&null!==(I=e.editAddressData)&&void 0!==I&&I.tags&&null!=e&&null!==(k=e.editAddressData)&&void 0!==k&&null!==(T=k.tags)&&void 0!==T&&T.includes("other")?null==e||null===(Ve=e.editAddressData)||void 0===Ve||null===(Ge=Ve.tags)||void 0===Ge||null===(We=Ge.split(":"))||void 0===We||null===(qe=We[1])||void 0===qe?void 0:qe.trim():"";const[ze,Ye]=(0,n.useState)({city:null!==(P=null==e||null===(j=e.editAddressData)||void 0===j?void 0:j.city)&&void 0!==P?P:"",state:null!==(F=null==e||null===(R=e.editAddressData)||void 0===R?void 0:R.state)&&void 0!==F?F:"",name:null!==(L=null==e||null===(O=e.editAddressData)||void 0===O?void 0:O.fullName)&&void 0!==L?L:"",gender:null!==(M=null==e||null===(U=e.editAddressData)||void 0===U?void 0:U.gender)&&void 0!==M?M:"",email:null!=ge&&null!==(Z=ge.sellerConfig)&&void 0!==Z&&Z.removeEmailFromCodForm?"":null!=e&&null!==(B=e.editAddressData)&&void 0!==B&&B.email?null==e||null===(H=e.editAddressData)||void 0===H?void 0:H.email:"",line1:null!==(V=(0,f.Oy)(null==e||null===(G=e.editAddressData)||void 0===G?void 0:G.fullAddressLine,null==ge||null===(W=ge.sellerConfig)||void 0===W?void 0:W.removeSpecialChrFromAdr))&&void 0!==V?V:"",completeAdd:"",altPhone:null!==(q=null==e||null===(z=e.editAddressData)||void 0===z?void 0:z.alternatePhone)&&void 0!==q?q:"",tags:He}),[Qe,Je]=(0,n.useState)({name:y.oE.name,gender:null!=ge&&null!==(Y=ge.sellerConfig)&&void 0!==Y&&Y.genderInAddressEnabled?null!=e&&null!==(Q=e.editAddressData)&&void 0!==Q&&Q.gender?"":y.oE.gender:"",line1:y.oE.line1,email:null!=ge&&null!==(J=ge.sellerConfig)&&void 0!==J&&J.removeEmailFromCodForm?"":null!==(K=ge.sellerConfig)&&void 0!==K&&K.showEmail?y.oE.email:"",city:y.oE.city,state:"",phone:null!=ge&&null!==($=ge.sellerConfig)&&void 0!==$&&$.enableAdrrPhone?null!=e&&null!==(X=e.editAddressData)&&void 0!==X&&X.alternatePhone||null!=e&&null!==(ee=e.editAddressData)&&void 0!==ee&&ee.phone?"":"Enter your phone number":"",tags:"others"===Fe?null===y.oE||void 0===y.oE?void 0:y.oE.tags:""}),[Ke,$e]=(0,n.useState)({name:"",gender:"",line1:"",email:"",city:"",state:"",phone:"",tags:""}),[Xe,el]=(0,n.useState)(""),ll=(0,d.I0)(),il=(e,l)=>{Je((i=>({...i,[e]:l})))},nl=(e,l)=>{$e((i=>({...i,[e]:l})))};function tl(e){return Object.keys(e).find((l=>""!==e[l]))}(0,n.useEffect)((()=>{var l;let i;var n,t,o;null!=e&&null!==(l=e.editAddressData)&&void 0!==l&&l.tags?(i="home"===(null==e||null===(n=e.editAddressData)||void 0===n?void 0:n.tags)||"office"===(null==e||null===(t=e.editAddressData)||void 0===t?void 0:t.tags)?null==e||null===(o=e.editAddressData)||void 0===o?void 0:o.tags:"others",je(!0)):(i="home",je(!1)),Re(i)}),[]),(0,n.useEffect)((()=>{if(ve.addressUpdated){e.SetIsOpen&&e.SetIsOpen(!1),u.Z.additionalEvents("address-edited",null==me?void 0:me.Cart_data,ce.couponCode,!!g.y.getItem("refreshToken"),!1);let l=null==ve?void 0:ve.Address_data,i=null==l?void 0:l.map((e=>(null==e?void 0:e.addressID)===(null==ve?void 0:ve.updatedAddress.addressID)?null==ve?void 0:ve.updatedAddress:e));ve.Address_data=i,ve.selectedAddress=null==ve?void 0:ve.updatedAddress,pe.serviceFetched=!1,me.orderFetched=!1,ve.defaultAddressCorrect=!0,null!=e&&e.verifyAddress&&(null==e||e.onRender())}}),[ve.addressUpdated]),(0,n.useEffect)((()=>{let e=!0,l=!0;Object.values(Qe).forEach((l=>{""!==l&&(e=!1)})),Object.values(Ke).forEach((e=>{""!==e&&(l=!1)})),we(e&&l)}),[Qe,Ke]);const ol=(0,n.useMemo)((()=>{var e;let l="pincode",i=tl(Qe),n=tl(Ke);return l=null!==(e=Object.keys(Qe).find((e=>e===i||e===n)))&&void 0!==e?e:"pincode",l}),[Qe,Ke]),al=(0,n.useMemo)((()=>Ce?Ce.length<6&&Ce.length>=1||Ce.length>6||oe?"Pincode must consist of 6 digit":"":"Enter your pincode"),[Ce,oe]),dl=(0,n.useMemo)((()=>fe?"Please enter a valid pincode":""),[fe]);(0,n.useEffect)((()=>{console.log("IaminErrorBlock"),null!==ve.failMsg&&(ze.line1="",ue.Pincode_data={},ue.pincode="",ge.addSilentUserAddress=!1,e.onRender(),se(),he||(u.Z.pincodeFieldDisplayed(),console.log("hi parv")),ye(!0))}),[ve.failMsg]),(0,n.useEffect)((()=>{null!==ve.invalidEmail&&(ze.email="",ge.addSilentUserAddress=!1,e.onRender())}),[ve.invalidEmail]),(0,n.useEffect)((()=>{var l,i,n,t,o,a,d,r,s,u,c,v;null!=ve&&ve.selectedAddress&&null!=me&&null!==(l=me.orderDetails)&&void 0!==l&&l.id&&(null!=ge&&ge.otpSkip?e.setAddressToShow({name:"".concat(null!==(i=null==ve?void 0:ve.selectedAddress.fullName)&&void 0!==i?i:"Customer"),email:null==ve?void 0:ve.selectedAddress.email,address:"".concat(null==ve?void 0:ve.selectedAddress.fullAddressLine,", ").concat(null==ve?void 0:ve.selectedAddress.city,", ").concat(null==ve?void 0:ve.selectedAddress.state,", ").concat(null==ve?void 0:ve.selectedAddress.pincode),address_id:null==ve?void 0:ve.selectedAddress.addressID,customer_id:ge.userInfo.user_id,count:"",index:"",alternatePhone:null===(n=ve.selectedAddress)||void 0===n?void 0:n.alternatePhone,tags:null===(t=ve.selectedAddress)||void 0===t?void 0:t.tags}):e.setAddressToShow({name:"".concat(null!==(o=null==ve?void 0:ve.selectedAddress.firstName)&&void 0!==o?o:"Customer"," ").concat(null!==(a=null==ve?void 0:ve.selectedAddress.lastName)&&void 0!==a?a:""),email:null==ve?void 0:ve.selectedAddress.email,address:"".concat(null==ve?void 0:ve.selectedAddress.line1,", ").concat(null!=ve&&null!==(d=ve.selectedAddress)&&void 0!==d&&d.line2?(null==ve||null===(r=ve.selectedAddress)||void 0===r?void 0:r.line2)+",":""," ").concat(null!=ve&&null!==(s=ve.selectedAddress)&&void 0!==s&&s.landmark?"Landmark-"+(null==ve||null===(u=ve.selectedAddress)||void 0===u?void 0:u.landmark)+",":""," ").concat(null==ve?void 0:ve.selectedAddress.city,", ").concat(null==ve?void 0:ve.selectedAddress.state,", ").concat(null==ve?void 0:ve.selectedAddress.pincode),address_id:null==ve?void 0:ve.selectedAddress.addressID,customer_id:ge.userInfo.user_id,count:"",index:"",alternatePhone:null===(c=ve.selectedAddress)||void 0===c?void 0:c.alternatePhone,tags:null===(v=ve.selectedAddress)||void 0===v?void 0:v.tags}))}),[JSON.stringify(ve.selectedAddress)]);const rl=async e=>{_e(!1),ve.fail=!1,xe(e.slice(0,6)),se();let l={postcode:e.substring(0,6)};if(6===e.length){u.Z.pincodeAdded(),u.Z.addressFieldsDisplayed(),_e(!1);try{Se(!0);const e=await v.Z.getWithParams(m.Z.GET_PINCODE(),l);var i,n,t,o,a,d;Se(!1),e&&(console.log(e),Ye({...ze,city:null==e||null===(i=e.data)||void 0===i||null===(n=i.postcode_details)||void 0===n?void 0:n.city,state:null==e||null===(t=e.data)||void 0===t||null===(o=t.postcode_details)||void 0===o?void 0:o.state}),ul("city",null==e||null===(a=e.data)||void 0===a||null===(d=a.postcode_details)||void 0===d?void 0:d.city),Ae(!0),_e(!1))}catch(e){console.log(e),_e(!0),te(!0),Se(!1)}}};(0,n.useEffect)((()=>{rl(Ce)}),[]),(0,n.useEffect)((()=>{try{var e;if(null!=ge&&null!==(e=ge.sellerConfig)&&void 0!==e&&e.addressVerify||null!=ve&&ve.addressFailMsg){var l,i,n;null===(l=document.getElementById("line1"))||void 0===l||l.focus();const e=(0,f.aW)(ze.line1,null==ge||null===(i=ge.sellerConfig)||void 0===i?void 0:i.domainName,null==ge||null===(n=ge.sellerConfig)||void 0===n?void 0:n.addressLayoutNew);il("line1",null==e?void 0:e.errorMessage),nl("line1",null==e?void 0:e.activeErrorMessage)}}catch(e){console.log(e)}}),[null==ve?void 0:ve.addressFailMsg]);const sl=(Ce.length<6||fe||Ee||"".concat(null!=me&&me.cardDesignEnabled?"EditAddressNew_addressTag_selected_card__CvfFW":"EditAddressNew_addressTag_selected__CCz9z"),Ce.length<6||fe||Ee),ul=(e,l)=>{((e,l)=>{var i;Ue(!1),Be({errorMessage:"",activeErrorMessage:""});const n=/[a-zA-Z0-9]/g;if(null!==(i=ge.sellerConfig)&&void 0!==i&&i.addressVerify){var t,o,a,d;const e=(0,f.r1)(null===(t=ge.sellerConfig)||void 0===t?void 0:t.blockAddressWithInvalidAddressLines,null===(o=ge.sellerConfig)||void 0===o?void 0:o.invalidAddressLineNumber,null==ze||null===(a=ze.line1)||void 0===a?void 0:a.match(n),null==ge||null===(d=ge.sellerConfig)||void 0===d?void 0:d.addressLayoutNew);Oe(null==e?void 0:e.isError),Ue(null==e?void 0:e.isError),Be(null==e?void 0:e.errorMessage)}switch(e){case"name":var r;if(null!==(r=ge.sellerConfig)&&void 0!==r&&r.addressVerify){var s,u,c,v,m,g;const i=/^(?!\.)([A-Za-z\s.]+)$/,n=/[a-zA-Z0-9]/g,t=l.match(n),o=null===(s=l)||void 0===s||null===(u=s.toLowerCase())||void 0===u?void 0:u.split(" ");null===(c=o.some)||void 0===c||c.call(o,(e=>null===y.TJ||void 0===y.TJ?void 0:y.TJ.includes(null==e?void 0:e.trim()))),il(e,""===l?"Enter your full name":""),0===l.length?nl(e,""):i.test(l)?(null==t?void 0:t.length)<3?il(e,"Minimum 3 characters required"):" "===(null===(v=l)||void 0===v?void 0:v[0])?il(e,"Space at the start not allowed"):null!==y.TJ&&void 0!==y.TJ&&y.TJ.includes(null===(m=l)||void 0===m||null===(g=m.toLowerCase())||void 0===g?void 0:g.trim())?il(e,"Given name is invalid"):"sr-login"===ie.get("login")&&l.length>49?il(e,"First name can’t be longer than 49 characters"):(null==t?void 0:t.length)>120?nl(e,"Character length exceeded"):nl(e,""):nl(e,"Use only alphabets (A-Z, a-z)");break}{const i=/^[A-Za-z\s]+$/;il(e,""===l?"Enter your full name.":""),0===l.length?nl(e,""):" "==l[0]?nl(e,"Avoid starting with a space"):i.test(l)?l.length>120?nl(e,"Name can’t be longer than 120 characters"):nl(e,""):nl(e,"Use only alphabets (A-Z, a-z)");break}case"gender":il(e,""===l?"Select your gender.":"");break;case"email":var h;if(null!==(h=ge.sellerConfig)&&void 0!==h&&h.addressVerify){var _,C,x,b,A,E;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n=null===(_=l)||void 0===_||null===(C=_.toLowerCase().trim())||void 0===C?void 0:C.split("@")[1];null!==(x=ge.sellerConfig)&&void 0!==x&&x.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?nl(e,y.oE.email):null!==(b=ge.sellerConfig)&&void 0!==b&&b.showEmail&&null!==y.hC&&void 0!==y.hC&&y.hC.includes(n)?nl(e,"Invalid email"):nl(e,""),null!==(A=ge.sellerConfig)&&void 0!==A&&A.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?il(e,y.oE.email):null!==(E=ge.sellerConfig)&&void 0!==E&&E.showEmail&&null!==y.hC&&void 0!==y.hC&&y.hC.includes(n)?il(e,"Invalid email"):il(e,"");break}{var S;const i=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;null!==(S=ge.sellerConfig)&&void 0!==S&&S.showEmail&&(""===l||!i.test(l))||""!==l&&!i.test(l)?il(e,y.oE.email):il(e,"");break}case"line1":var D;if(null!==(D=ge.sellerConfig)&&void 0!==D&&D.addressVerify){var w,N;ve.addressFailMsg=!1;const i=(0,f.aW)(l,null==ge||null===(w=ge.sellerConfig)||void 0===w?void 0:w.domainName,null==ge||null===(N=ge.sellerConfig)||void 0===N?void 0:N.addressLayoutNew);il(e,null==i?void 0:i.errorMessage),nl(e,null==i?void 0:i.activeErrorMessage);break}{const i=/^[ A-Za-z0-9_@./,#&+-/\n]{0,475}$/;el(l.trim().length.toString()),""===l.trim()?il(e,y.oE.line1):l.trim().length<10?il(e,"Minimum 10 characters required"):il(e,""),""===l.trim()?nl(e,""):l.trim().length>475?nl(e,"Address cannot be longer than 475 characters"):i.test(l.trim())?nl(e,""):nl(e,"Allowed special characters _ @ . / , # & + - ");break}case"city":{const i=p.N9;ue.city=l,il(e,""==l?y.oE.city:""),""==l?nl(e,""):" "==l[0]?nl(e,"Avoid starting with a space"):i.test(l)?l.length>100?nl(e,"City can’t be longer than 100 characters"):nl(e,""):nl(e,p.bG);break}case"tags":var I,k;""==(null===(I=l)||void 0===I?void 0:I.trim())&&"others"===Fe?il(e,null===y.oE||void 0===y.oE?void 0:y.oE.tags):il(e,""),""===(null===(k=l)||void 0===k?void 0:k.trim())?nl(e,""):l.startsWith(" ")?nl(e,"Avoid starting with a space"):nl(e,"");break;case"contact":""===(l=l.substring(0,10))||10!==l.length?il(e,y.oE.contact):il(e,"")}})(e,l),Ye((i=>({...i,[e]:l})))};return(0,n.useEffect)((()=>{var e;ul("line1",ze.line1),ul("city",ze.city),ul("name",ze.name),null!=ge&&null!==(e=ge.sellerConfig)&&void 0!==e&&e.removeEmailFromCodForm||ul("email",ze.email)}),[]),(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)("div",{children:[!(null!=ve&&ve.defaultAddressCorrect)&&(null!=me&&me.cardDesignEnabled?(0,C.jsx)("div",{className:"card-main-heading",style:{paddingBottom:"10px"},children:"Add shipping address"}):(0,C.jsx)("h4",{style:{paddingBottom:"10px"},children:"Add shipping address"})),(null==ge||null===(cl=ge.sellerConfig)||void 0===cl?void 0:cl.enableInternationalAddress)&&(0,C.jsxs)("h5",{style:{paddingBottom:"10px",font:"500 14px/12px var(--font-family)"},children:["Do you like to have your order ",(0,C.jsx)("a",{onClick:()=>(()=>{if(ie.get("cart-resume-id")){var e,l;if(p.ZW.shopify===(null==me||null===(e=me.platform)||void 0===e?void 0:e.toUpperCase())){var i;let e="";for(let l of null==me||null===(n=me.orderDetails)||void 0===n?void 0:n.lineItems){var n;e=e+l.itemId+":"+l.quantity+","}const l="http://".concat(null==ge||null===(i=ge.sellerConfig)||void 0===i?void 0:i.domainName,"/cart/").concat(e);window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===l[(null==l?void 0:l.length)-1]?null==l?void 0:l.slice(0,(null==l?void 0:l.length)-1):l}}]},"*")}if(p.ZW.wooCommerce===(null==me||null===(l=me.platform)||void 0===l?void 0:l.toUpperCase())){var t;let e="http://".concat(null==ge||null===(t=ge.sellerConfig)||void 0===t?void 0:t.domainName,"/checkout");window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:e}}]},"*")}}else{var o,a,d,r,s,u,c,v,m;p.ZW.shopify===(null==ge?void 0:ge.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:","===(null===(o=ge.channel)||void 0===o?void 0:o.redirectUrl[(null===(a=ge.channel)||void 0===a||null===(d=a.redirectUrl)||void 0===d?void 0:d.length)-1])?null===(r=ge.channel)||void 0===r||null===(s=r.redirectUrl)||void 0===s?void 0:s.slice(0,(null===(u=ge.channel)||void 0===u||null===(c=u.redirectUrl)||void 0===c?void 0:c.length)-1):null===(v=ge.channel)||void 0===v?void 0:v.redirectUrl}}]},"*"),p.ZW.wooCommerce===(null==ge?void 0:ge.platform)&&window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null===(m=ge.channel)||void 0===m?void 0:m.redirectUrl}}]},"*")}})(),style:{color:"var(--primary-color)",cursor:"pointer"},children:" shipped outside India?"})]}),(0,C.jsx)("div",{className:null!=me&&me.cardDesignEnabled||ge.AuthTokenGenerated?"":"mtNeg-18",children:(0,C.jsx)(o.Z,{label:"Pincode",type:"text",id:"pincode",name:"pincode",value:Ce,className:"mt-18",onChange:e=>{e.target.value.match(/^[\d]{0,6}$/g)&&rl(e.target.value)},error:al,activeErrors:dl,loading:Ee,touched:ne,autoComplete:"postal-code",mandatory:!0,marginTop:null!=me&&me.cardDesignEnabled?"8px":""})}),ve.failMsg&&(0,C.jsx)(s.Z,{msg:ve.failMsg}),(0,C.jsxs)("div",{children:[(0,C.jsx)(o.Z,{label:"Full name",type:"text",id:"name",name:"name",value:ze.name,className:"mr-10 mt-18",maxLength:"120",onInput:e=>ul("name",e.target.value),error:Qe.name,activeErrors:Ke.name,disabled:Ce.length<6||fe||Ee,autoComplete:"given-name",touched:null==Ne?void 0:Ne.includes("name"),setSkipErrorField:Ie,mandatory:!0}),(null==ge||null===(vl=ge.sellerConfig)||void 0===vl?void 0:vl.genderInAddressEnabled)&&(0,C.jsxs)(h.Z,{id:"gender",label:"Gender",placeholder:"Gender",name:"gender",className:"mt-18",value:ze.gender,onChange:e=>{ul("gender",e.target.value)},error:Qe.gender,disabled:Ce.length<6||fe||Ee,touched:null==Ne?void 0:Ne.includes("gender"),activeErrors:Ke.gender,skippedArray:["name","lastName"],setSkipErrorField:Ie,mandatory:!0,children:[(0,C.jsx)("option",{disabled:!0,value:"",hidden:!0,children:null!=me&&me.cardDesignEnabled?"":"Select your gender"}),(0,C.jsx)("option",{value:"male",children:"Male"}),(0,C.jsx)("option",{value:"female",children:"Female"})]}),(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(o.Z,{label:"Address",type:"text",id:"line1",name:"address",value:ze.line1,onInput:e=>ul("line1","".concat(e.target.value)),error:Qe.line1,activeErrors:Ke.line1,lenError:Xe,className:"mt-18",defaultValue:ze.line1,disabled:Ce.length<6||fe||Ee,autoComplete:"address-line1",maxLength:"475",skippedArray:["name","gender"],touched:null==Ne?void 0:Ne.includes("line1"),setSkipErrorField:Ie,mandatory:!0})}),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.Z,{id:"phone",name:"phone",label:"Receiver’s number",type:"tel",autoComplete:"tel-local",className:"mt-18",onChange:async e=>{var l,i;let n=e.target.value;Te(n);let t=!1;t=!!(n.length>0&&0===Number(n[0])),null!=ge&&null!==(l=ge.sellerConfig)&&void 0!==l&&l.enableAdrrPhone&&0===n.length?il("phone","Enter your phone number"):il("phone",""),null!=ge&&null!==(i=ge.sellerConfig)&&void 0!==i&&i.enableAdrrPhone&&(10!==n.length||t)?0===n.length?nl("phone",""):nl("phone","Please enter valid phone number"):nl("phone","")},onInput:e=>{e.target.value=e.target.value.replace(/[^0-9]/g,""),e.target.value=e.target.value.substring(0,13);for(var l=document.querySelectorAll('input[type="number"]'),i=l.length;i--;)l[i].setAttribute("pattern","\\d*")},skippedArray:["name","line1","gender"],touched:null==Ne?void 0:Ne.includes("phone"),setSkipErrorField:Ie,mandatory:!0,activeErrors:Ke.phone,error:Qe.phone,value:ke,disabled:null==ge||null===(ml=ge.sellerConfig)||void 0===ml||!ml.enableAdrrPhone||Ce.length<6||fe||Ee}),(0,C.jsx)("span",{style:{marginLeft:"10px",fontSize:"10px",color:"#616161"},children:" We'll contact you on this number during delivery "})]}),!(null!=ge&&null!==(gl=ge.sellerConfig)&&void 0!==gl&&gl.removeEmailFromCodForm)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.Z,{label:null!==(pl=ge.sellerConfig)&&void 0!==pl&&pl.showEmail?"E-mail":"E-mail (optional)",type:"text",id:"email",name:"email",value:ze.email,onInput:e=>ul("email",e.target.value),error:Qe.email,activeErrors:!(null===(hl=ge.sellerConfig)||void 0===hl||!hl.addressVerify)&&Ke.email,className:"mt-18",disabled:Ce.length<6||fe||Ee,autoComplete:"email",skippedArray:["name","line1","phone","gender"],touched:null==Ne?void 0:Ne.includes("email"),setSkipErrorField:Ie,mandatory:!(null===(yl=ge.sellerConfig)||void 0===yl||!yl.showEmail)}),(0,C.jsx)("span",{style:{marginLeft:"10px",fontSize:"10px",color:"#616161"},children:" Order delivery details will be sent here "}),ve.invalidEmail&&(0,C.jsx)(s.Z,{msg:ve.invalidEmail})]}),(0,C.jsxs)("div",{className:"".concat(t),children:[(0,C.jsx)(o.Z,{label:"City",type:"text",id:"city",name:"city",value:ze.city,onInput:e=>ul("city",e.target.value),className:"mr-18",maxLength:"100",error:Qe.city,activeErrors:Ke.city,autoComplete:"address-level2",disabled:Ce.length<6||fe||Ee,skippedArray:["name","line1","phone","email","gender"],touched:null==Ne?void 0:Ne.includes("city"),setSkipErrorField:Ie,mandatory:!0}),(0,C.jsx)(o.Z,{label:"State",type:"text",id:"state",name:"state",value:ze.state,disabled:!0,skippedArray:["name","line1","phone","email","city","gender"],touched:null==Ne?void 0:Ne.includes("state"),setSkipErrorField:Ie,mandatory:!0,skipPincodeFocus:!(Ce.length<6||fe||Ee)})]}),(0,C.jsx)("div",{className:"".concat(t),children:(0,C.jsxs)("div",{style:{width:"100%",marginTop:8},children:[(0,C.jsx)(_.Z,{selectedTag:Fe,handleAddressTag:e=>{Ce.length<6||fe||Ee||("others"===e?(je(!0),Je((e=>({...e,tags:y.oE.tags})))):(je(!1),Ye((e=>({...e,tags:""}))),Je((e=>({...e,tags:""}))),$e((e=>({...e,tags:""})))),Re(e))},error:sl}),Pe&&"others"===Fe?(0,C.jsx)("div",{className:null!=me&&me.cardDesignEnabled||ge.AuthTokenGenerated?"":"mtNeg-18",children:(0,C.jsx)(o.Z,{label:"Save address as",type:"text",id:"tags",name:"tags",value:ze.tags,className:"mr-10 mt-18",onInput:e=>ul("tags",e.target.value),error:Qe.tags,maxLength:"25",activeErrors:Ke.tags,autoComplete:"tags",mandatory:"others"===Fe&&!0})}):""]})}),(0,C.jsxs)("div",{className:"EditAddressNew_buttonContainer__JeN32",children:[(0,C.jsx)("div",{style:{marginTop:6},children:(0,C.jsx)("div",{style:{marginBottom:4},children:Me&&(0,C.jsx)(s.Z,{msg:Ze})})}),ve.spinner&&(0,C.jsx)(c.Z,{}),(0,C.jsx)(a.Z,{loading:ve.updatingAddress,id:"addAddressBtn",type:"button",onClick:()=>{console.log("TheBat",ze),(async()=>{var l,i,n,t,o,a,d,s,u,c,v,m,g,p;if(!De||Ce.length<6||ve.updatingAddress||fe)if(Ce.length<6||fe||Ee){var h;null===(h=document.getElementById("pincode"))||void 0===h||h.focus()}else{var y;const e=["line1"];var f,_;null!=ge&&null!==(y=ge.sellerConfig)&&void 0!==y&&y.addressVerify&&Le&&!e.includes(ol)?(Ue(!0),null===(f=document.getElementById("line1"))||void 0===f||f.focus()):(Ue(!1),null===(_=document.getElementById(ol))||void 0===_||_.focus())}else null!=ge&&ge.otpSkip?(await ll({type:"SKIP_Otp_Address_add",payload:{...e.editAddressData,city:null==ze||null===(l=ze.city.trim())||void 0===l?void 0:l.replace(/\./g," "),state:null==ze?void 0:ze.state,fullName:null==ze?void 0:ze.name.trim(),email:null==ze?void 0:ze.email,fullAddressLine:null==ze?void 0:ze.line1.trim(),pincode:Ce,gender:null!==(i=ze.gender)&&void 0!==i?i:"",alternatePhone:ke!==ge.mobileNumber?ke:null,cartId:null==me||null===(n=me.Cart_data)||void 0===n?void 0:n.id,versionId:"v2",emailConfirmed:!0,country:null!==(t=e.editAddressData)&&void 0!==t&&t.country?null===(o=e.editAddressData)||void 0===o?void 0:o.country:"India",tags:"others"===Fe?"other: ".concat(null==ze?void 0:ze.tags):Fe,...(null==e||null===(a=e.editAddressData)||void 0===a?void 0:a.addressTag)&&{addressTag:null},...(null===(d=ge.sellerConfig)||void 0===d?void 0:d.addressVerify)&&{source:"checkout"}}}),e.SetIsOpen(!1),pe.serviceFetched=!1,me.orderFetched=!1,ve.defaultAddressCorrect=!0,null==e||e.onRender()):ll((0,r.y3)({...e.editAddressData,city:null==ze||null===(s=ze.city.trim())||void 0===s?void 0:s.replace(/\./g," "),state:null==ze?void 0:ze.state,fullName:null==ze?void 0:ze.name.trim(),email:null==ze?void 0:ze.email,fullAddressLine:null==ze?void 0:ze.line1.trim(),pincode:Ce,gender:null!==(u=ze.gender)&&void 0!==u?u:"",alternatePhone:ke!==ge.mobileNumber?ke:null,cartId:null==me||null===(c=me.Cart_data)||void 0===c?void 0:c.id,country:null!==(v=e.editAddressData)&&void 0!==v&&v.country?null===(m=e.editAddressData)||void 0===m?void 0:m.country:"India",versionId:"v2",...(null==e||null===(g=e.editAddressData)||void 0===g?void 0:g.addressTag)&&{addressTag:null},tags:"others"===Fe?"other: ".concat(null==ze?void 0:ze.tags):Fe,...(null===(p=ge.sellerConfig)||void 0===p?void 0:p.addressVerify)&&{source:"checkout"}},ge.userInfo.user_id,ge.sellerConfig.seller_id,!(null==e||!e.verifyAddress)))})()},className:"mt-30",isCardDesign:null==me?void 0:me.cardDesignEnabled,children:ve.updatingAddress?"Saving address... ":"Save and select"}),(0,C.jsx)("input",{type:"hidden",id:"editAddressFastrr"})]})]})]})})});var cl,vl,ml,gl,pl,hl,yl}},3624:(e,l,i)=>{i.d(l,{Z:()=>a});var n=i(7313);var t=i(6417);const o=e=>(0,t.jsx)("div",{className:"Error_errorDanger__pDH+E",children:(0,t.jsx)("div",{className:"h5",children:e.msg||"Something Went Wrong!"})}),a=n.memo(o)},536:(e,l,i)=>{i.r(l),i.d(l,{default:()=>j});var n=i(7313);const t="Login_icon__3Dojh",o="Login_sr_promise_text__gy58n";var a=i(2878),d=i(3624),r=i(4293),s=i(6352),u=i(7666),c=i(2836),v=i(7965),m=i(7075),g=(i(3052),i(6417));const p=e=>{let{otpDigits:l}=e;const i=window.location.search;let n="shiprocketLogin"==new URLSearchParams(i).get("popupType");const t=e=>{const i=[],n=Number(l);for(let l=0;l{var e,l;const i=(0,s.v9)((e=>e.Login));return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"sr-label",children:[(0,g.jsx)("div",{className:"mt-12 mr-5",children:(0,y.DJ)("var(--primary-color)")}),(0,g.jsxs)("p",{style:{fontSize:"12px",color:"rgba(113, 113, 113, 0.7)",margin:"10px 0px"},children:["By proceeding, you agree to our "," ",(0,g.jsx)("a",{href:"https://checkout.shiprocket.in/terms-conditions/",onClick:()=>{m.Z.additionalEvents("terms-and-conditions","","","",!1)},target:"_blank",style:{color:"#292A2C"},children:"Terms & conditions"})," and",(0,g.jsx)("a",{href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",target:"_blank",onClick:()=>{m.Z.additionalEvents("privacy-policy","","","",!1)},style:{color:"#292A2C"},children:" Privacy policy"})]})]}),"beyoung.in"===(null===(e=i.sellerConfig)||void 0===e?void 0:e.domainName)||"www.beyoung.in"===(null===(l=i.sellerConfig)||void 0===l?void 0:l.domainName)?(0,g.jsxs)("div",{className:"d-flex container2 h6",style:{margin:"4px 0"},children:[(0,g.jsx)("p",{className:"mr-5",children:"Powered by"}),(0,g.jsx)("img",{className:"sr-logo",src:"./assets/images/SRLogoDark.png",alt:"Shiprocket"})]}):""]})};var _=i(528),C=i(1805),x=i(1608);const b=e=>{let{loginTermsConditionsChecked:l,setLoginTermsConditionsChecked:i,html:n}=e;return(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("div",{className:"sr-label",children:[(0,g.jsx)("div",{className:"mt-12 mr-5",children:(0,g.jsx)("input",{id:"termsAndConditions",type:"checkbox",onChange:()=>{x.y.setItem("marketingConsent",!l),i(!l)},checked:l})}),n?(0,g.jsx)("div",{dangerouslySetInnerHTML:{__html:n}}):(0,g.jsxs)("p",{className:"login-terms-text",children:["I agree to receiving marketing communications from the",(0,g.jsx)("a",{href:"https://www.hul.co.in/brands/",className:"login-terms-link",target:"_blank",children:" Trusted Unilever Brands"})," . By proceeding, I agree to HUL",(0,g.jsx)("a",{href:"https://www.theushop.in/pages/terms-and-conditions",target:"_blank",className:"login-terms-link",children:" T&C "})," & ",(0,g.jsx)("a",{href:"https://www.unilevernotices.com/privacy-notices/india-english.html",target:"_blank",className:"login-terms-link",children:" Privacy Notice. "})]})]})})};var A=i(3731),E=i(5381),S=i(2183),D=i(5763),w=i(9563),N=i(804);const I=window.location.search,k=new URLSearchParams(I);let T=null!=k.get("customCheckoutToken")?k.get("customCheckoutToken"):null;const P=e=>{var l,i,y,I,k,P,j,F,R,L,O;const[M,U]=(0,n.useState)(!0),[Z,B]=(0,n.useState)(!1),H=(0,s.v9)((e=>e.Login)),V=(0,s.v9)((e=>e.Otp)),G=(0,s.v9)((e=>e.Cart)),W=(0,s.v9)((e=>e.Address)),q=(0,s.v9)((e=>e.Coupon));H.onLoginPage=!0;const z=(0,s.I0)(),[Y,Q]=(0,n.useState)(!1),[J,K]=(0,n.useState)(""),[$,X]=(0,n.useState)(!1),[ee,le]=(0,n.useState)(!1),[ie,ne]=(0,n.useState)(""),[te,oe]=(0,n.useState)(!1),[ae,de]=(0,n.useState)(!1),[re,se]=(0,n.useState)(!1),[ue,ce]=(0,n.useState)(""),ve=(0,n.useRef)(null),[me,ge]=(0,n.useState)(!1),[pe,he]=(0,n.useState)(null===x.y.getItem("marketingConsent")||void 0===x.y.getItem("marketingConsent")?(null==H||null===(l=H.sellerConfig)||void 0===l||null===(i=l.marketingConsentConfig)||void 0===i?void 0:i.isChecked)||!1:"false"!=x.y.getItem("marketingConsent")),[ye,fe]=(0,n.useState)(!1),_e=(0,n.useRef)(null);let Ce=6;const xe=window.location.search;let be="shiprocketLogin"==new URLSearchParams(xe).get("popupType");const Ae=(0,n.useRef)(null),Ee=(0,n.useRef)(""),Se=(0,n.useRef)(""),De=function(e,l){const[i,t]=(0,n.useState)(!1),o=(0,n.useRef)(null),a=window.location.search;return new URLSearchParams(a),(0,n.useEffect)((()=>{l&&(o.current=new IntersectionObserver((e=>{let[l]=e;return t(l.isIntersecting)})))}),[]),(0,n.useEffect)((()=>{if(l)return o.current.observe(e.current),()=>{o.current.disconnect()}}),[e]),i}(Ae,H.isProductPage),we=function(e){var l;"otpLess-parentScriptLoaded"===e.data.trigger&&(Se.current=(0,D.G)(),ge(null==e||null===(l=e.data)||void 0===l?void 0:l.data),window.removeEventListener("message",we,!1))},Ne=()=>{_e.current&&clearTimeout(_e.current),_e.current=setTimeout((()=>{fe(!0)}),5e3)},Ie=()=>{var e;null!=H&&null!==(e=H.sellerConfig)&&void 0!==e&&e.loginUITest&&(fe(!1),Ne())};(0,n.useEffect)((()=>{var e;if(null!=H&&null!==(e=H.sellerConfig)&&void 0!==e&&e.loginUITest)return Ne(),()=>{_e.current&&clearTimeout(_e.current)}}),[]),(0,n.useEffect)((()=>{var e;return H.otpLess.initiationSuccesful=!1,H.otpLess.initiationResponse={requestID:null,deliveryChannel:null,authType:null,channel:null},H.otpLess.verificationSuccessful=!1,H.otpLess.verificationResponse=null,H.otpLess.token=null,null!=H&&null!==(e=H.sellerConfig)&&void 0!==e&&e.otpLessEnabled&&(Ee.current=(0,D.G)(),window.parent.postMessage({trigger:"mount-otpLess"},"*"),window.addEventListener("message",we,!1)),()=>clearTimeout(ve.current)}),[]),(0,n.useEffect)((()=>{var e;null!==(e=H.sellerConfig)&&void 0!==e&&e.seller_id,B(!0)}),[null===(y=H.sellerConfig)||void 0===y?void 0:y.seller_id]),(0,n.useEffect)((()=>{G.customerMarketingConsent=pe}),[pe]),(0,n.useEffect)((()=>{var e,l;H.AuthTokenGenerated&&(null===(e=document.getElementById("mobile"))||void 0===e||e.removeAttribute("disabled"),m.Z.createUserProfile(H.mobileNumber),m.Z.checkoutStarted({phone:null==H?void 0:H.mobileNumber,total_price:null==H||null===(l=H.cartData)||void 0===l?void 0:l.total_price}))}),[H.NewUser_Token]),(0,n.useEffect)((()=>{H.isProductPage&&z(De?{type:"UPDATE_CART_STATE",payload:{key:"productBuyNowVisible",value:!0}}:{type:"UPDATE_CART_STATE",payload:{key:"productBuyNowVisible",value:!1}})}),[De]),(0,n.useEffect)((()=>{var e;H.user_type_for_text&&(Q("new"===H.user_type_for_text),m.Z.phoneEntered(J,null==G?void 0:G.Cart_data,q.couponCode,H.user_type_for_text,null==H||null===(e=H.sellerConfig)||void 0===e?void 0:e.marketingConfig))}),[H.user_type_for_text]),(0,n.useEffect)((()=>{setTimeout((()=>{var e;null==Fe||null===(e=Fe.current)||void 0===e||e.focus()}))}),[e.phoneNumberFieldFocus]),(0,n.useEffect)((()=>{H.fireShipRocketFallBackOtpRequest&&(H.fireShipRocketFallBackOtpRequest=!1,U(!1),H.mobileNumber&&Re(H.mobileNumber))}),[H.fireShipRocketFallBackOtpRequest]);const ke=null!=H&&null!==(I=H.showFourDigitOtpClients)&&void 0!==I&&I.includes(null===(k=H.sellerConfig)||void 0===k?void 0:k.domainName)?100:C.VY,{initiateOtpLess:Te}=(0,A.y)(e),Pe=e=>{var l,i,n,t,o,a;if("9999999999"===e)return!1;const d=M&&(null==H||null===(l=H.sellerConfig)||void 0===l?void 0:l.otpLessEnabled)&&me&&H.otpLess.otpLessScriptLoaded&&H.otpLess.otplessInitialized;return!d&&null!=H&&null!==(i=H.sellerConfig)&&void 0!==i&&i.otpLessEnabled&&(0,S.kf)({name:"NOT_LOGGING_USING_OTPLESS",domain:null===(n=H.sellerConfig)||void 0===n?void 0:n.domainName,payload:{number:H.mobileNumber,cart_id:null==G||null===(t=G.Cart_data)||void 0===t?void 0:t.id,enableOtpLess:M,otpLessEnabledSellerConfigFlag:null==H||null===(o=H.sellerConfig)||void 0===o?void 0:o.otpLessEnabled,otpLessParentScriptLoaded:me,otpLessParentScriptMountingStartTime:Ee.current,otpLessParentScriptMountingCompleteTime:Se.current,iframeScriptLoadStartTime:H.otpLess.iframeScriptLoadStartTime,iframeScriptLoadCompleteTime:H.otpLess.iframeScriptLoadCompleteTime,otpLessIframeScriptLoaded:H.otpLess.otpLessScriptLoaded,otplessInitialzed:H.otpLess.otplessInitialized,skipOtpEnabled:null==H||null===(a=H.sellerConfig)||void 0===a?void 0:a.enabledFeatureSkipOtp}}),d};(0,n.useEffect)((()=>{var e;"otpLess"===H.loginThrough&&Pe(H.mobileNumber)&&!H.otpSkip&&null!=H&&null!==(e=H.sellerConfig)&&void 0!==e&&e.enabledFeatureSkipOtp&&je()}),[H.loginThrough]);const je=async()=>{var l,i,n;Ce=H.sellerConfig.enableFourDigitOtp&&(0,w.T7)(null==G||null===(l=G.Cart_data)||void 0===l?void 0:l.id,ke)?4:6;const t=await Te(H.mobileNumber,{sellerDisplayName:(null==H||null===(i=H.sellerConfig)||void 0===i?void 0:i.displayName)||"",sellerDomain:(null===(n=H.sellerConfig)||void 0===n?void 0:n.domainName)||""},Ce);!0===(null==t?void 0:t.success)?(H.otpLess.initiationSuccesful=!0,H.otpLess.initiationResponse=null==t?void 0:t.response,e.onRender()):(U(!1),Re(H.mobileNumber,!1))},Fe=(0,n.useRef)(null),Re=async function(l){var i,n,t,o,a,d,s,u,c,v,m;let g=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],p=!1;if(K(l),H.createCustomerFired=!0,H.sendOtpfired=!0,H.NewUser_Token=null,null===(i=document.getElementById("mobile"))||void 0===i||i.setAttribute("disabled","true"),H.customLogin&&("beyoung.in"===(null===(n=H.sellerConfig)||void 0===n?void 0:n.domainName)||"www.beyoung.in"===(null===(t=H.sellerConfig)||void 0===t?void 0:t.domainName))){const e={eventName:"Phone_entered_fastrr",data:{phone:l}};window.parent.postMessage({trigger:"beyoung-analytics",data:e},"*")}H.mobileNumber=l,V.mobile=l;let h={cred:H.mobileNumber,tenant_id:null==H||null===(o=H.sellerConfig)||void 0===o?void 0:o.seller_id,cart_id:H.customLogin?null===(a=H.verifyTokenConfig)||void 0===a||null===(d=a.cart)||void 0===d?void 0:d.id:null===(s=G.Cart_data)||void 0===s?void 0:s.id,skip_existing_address_check:!1},y=g&&Pe(l);var f,_;y&&(0,S.kf)({name:"Phone_entered_for_otpLess_login",domain:null===(f=H.sellerConfig)||void 0===f?void 0:f.domainName,payload:{number:H.mobileNumber,cart_id:null==G||null===(_=G.Cart_data)||void 0===_?void 0:_.id}});try{(0,N.N)("phone_entered",{...T&&{customerToken:T},phoneNumber:H.mobileNumber})}catch(e){console.log(e)}if(y&&(null==H||null===(u=H.sellerConfig)||void 0===u||!u.enabledFeatureSkipOtp)){var C,x,b;Ce=H.sellerConfig.enableFourDigitOtp&&(0,w.T7)(null==G||null===(C=G.Cart_data)||void 0===C?void 0:C.id,ke)?4:6;const l=await Te(H.mobileNumber,{sellerDisplayName:(null==H||null===(x=H.sellerConfig)||void 0===x?void 0:x.displayName)||"",sellerDomain:(null===(b=H.sellerConfig)||void 0===b?void 0:b.domainName)||""},Ce);!0===(null==l?void 0:l.success)?(p=!0,H.otpLess.initiationSuccesful=!0,H.otpLess.initiationResponse=null==l?void 0:l.response,e.onRender()):U(!1)}y&&((null==H||null===(c=H.sellerConfig)||void 0===c||!c.enabledFeatureSkipOtp)&&p||null!=H&&null!==(v=H.sellerConfig)&&void 0!==v&&v.enabledFeatureSkipOtp)&&(h={...h,login_type:"otpLess"}),H.spinner=!0,z((0,r.bl)(h,H.sellerConfig.seller_id,!be&&(null==H||null===(m=H.sellerConfig)||void 0===m?void 0:m.enabledFeatureSkipOtp))),!y&&window.parent.postMessage({trigger:"otp-read-start"},"*"),setTimeout((()=>X(!0)),1e3)},Le=async e=>{var l;Ie();let i=null===(l=e.target.value)||void 0===l?void 0:l.trim();i.length>0?de(!0):de(!1),i.length>=10&&!H.isProductPage&&(/^(\+91|0|91)?[6-9]{1}[0-9]{9}$/.test(i)?(i=i.slice(-10),Re(i),oe(!1)):oe(!0)),H.isProductPage&&i.length>=10&&(i=i.slice(-10),ne(i))};H.fail=!1,(0,n.useCallback)((async e=>{var l,i;let n={mobile:V.mobile,shop_name:null===(l=H.channel)||void 0===l?void 0:l.shop_name,company_id:null===(i=H.channel)||void 0===i?void 0:i.sr_company_id};!H.sendOtpfired&&!H.changeNumber||H.paymentPageReached||(z((0,u.t1)(n)),H.sendOtpfired=!1,H.changeNumber=!1)}),[]);const Oe=null==H||null===(P=H.sellerConfig)||void 0===P?void 0:P.id,Me=null==G||null===(j=G.Cart_data)||void 0===j?void 0:j.id,Ue={"63ca3519eec3ea4de4d8e2f6":"100/0","630752c3c6d67e44d5687487":"80/20","6436c5a8e9a93249f17bc96b":"50/50","6333fb454f354c57324887c0":"50/50"},Ze=e=>{e.target.value=e.target.value.replace(/[^0-9]/g,""),e.target.value=e.target.value.substring(0,13);for(var l=document.querySelectorAll('input[type="number"]'),i=l.length;i--;)l[i].setAttribute("pattern","\\d*")};return(0,g.jsx)(g.Fragment,{children:H.enteredNumber&&Pe(H.mobileNumber)&&!(null!=H&&null!==(nl=H.otpLess)&&void 0!==nl&&nl.initiationSuccesful||V.verified)||H.enteredNumber&&!H.loginSuccess||H.enteredNumber&&H.loginSuccess&&"ONETAP"===(null==H||null===(F=H.otpLess)||void 0===F||null===(R=F.initiationResponse)||void 0===R?void 0:R.authType)&&!V.userLoggedIn?null!=G&&G.cardDesignEnabled?(0,g.jsx)("div",{className:"card-container",children:(0,g.jsx)(p,{otpDigits:H.sellerConfig.enableFourDigitOtp&&(0,w.T7)(null==G||null===(O=G.Cart_data)||void 0===O?void 0:O.id,ke)&&Pe(H.mobileNumber)?4:6})}):(0,g.jsx)(p,{otpDigits:H.sellerConfig.enableFourDigitOtp&&(0,w.T7)(null==G||null===(L=G.Cart_data)||void 0===L?void 0:L.id,ke)&&Pe(H.mobileNumber)?4:6}):H.newUserAdd?(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(v.Z,{onRender:e.onRender,onRenderLoading:e.onRenderLoading})}):1!==H.loader&&!H.fail&&"new"!==H.user_type||W.newUserAddressAdded?(null!=H&&null!==(el=H.otpLess)&&void 0!==el&&el.initiationSuccesful&&"OTP"===(null==H||null===(ll=H.otpLess)||void 0===ll||null===(il=ll.initiationResponse)||void 0===il?void 0:il.authType)||0===H.loader&&"known"===H.user_type||H.AuthTokenGenerated&&W.newUserAddressAdded)&&!H.otpSkip?(H.spinner=!1,(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(c.Z,{onRender:e.onRender,onError:e.onError,onRenderLoading:e.onRenderLoading,otpFieldFocus:e.phoneNumberFieldFocus})})):void 0:(0!==H.loader||H.fail||"new"!==H.user_type||H.mobileNumber,(0,g.jsxs)(g.Fragment,{children:[H.addSilentUserAddress&&(0,g.jsx)("div",{className:"Login_disablenew__e9tGZ"}),!H.enteredNumber&&(0,g.jsxs)("section",{className:"".concat(null!=G&&G.cardDesignEnabled?"card-container login":"login"),style:{background:null!=G&&G.cardDesignEnabled?"none":"",display:"flex",flexDirection:"column",alignItems:"center",boxShadow:"none",border:"none"},children:[!be&&(0,g.jsx)("p",{className:null!=G&&G.cardDesignEnabled?"headingCard":"heading",style:{marginBottom:"4px",fontSize:H.customLogin?20:"",fontWeight:H.customLogin?500:""},children:H.customLogin&&!H.isProductPage?"Get started ":H.isProductPage?"Shipping Details":"Enter mobile number"}),!be&&(0,g.jsx)("p",{className:null!=G&&G.cardDesignEnabled?"contentCard":"content",children:null!=H&&null!==(Be=H.sellerConfig)&&void 0!==Be&&Be.loginUITest?"Just one more step to complete your order":"Provide your mobile number to continue"}),(0,g.jsxs)("div",{style:{position:"relative",width:null!=H&&null!==(He=H.sellerConfig)&&void 0!==He&&He.loginUITest?"80%":"100%"},children:[(0,g.jsxs)("form",{autoComplete:"off",onSubmit:e=>e.preventDefault(),style:null!=H&&null!==(Ve=H.sellerConfig)&&void 0!==Ve&&Ve.loginUITest?{marginTop:"16px",position:"relative"}:{width:"100%"},children:[(0,g.jsxs)("div",{className:"Login_inputGroup__+sX5Y",children:[(0,g.jsxs)("span",{className:"Login_inputAddon__Lmise",children:[(0,g.jsx)("img",{src:"./assets/images/indian_flag.svg",alt:"India",className:"w-16"})," ",(0,g.jsx)("span",{className:"code",style:{fontSize:"16px",fontWeight:"400"},children:"+91"})]}),(0,g.jsx)("input",{maxLength:H.isProductPage?10:15,ref:Fe,id:"mobile",type:"tel",autoComplete:"tel",autoFocus:!0,placeholder:"10-digit mobile number",className:be?"form-control h3 pl-74 pr-68 ".concat("Login_inputLoginPopup__xnzam"):null!=G&&G.cardDesignEnabled&&!te?"form-control h3 pl-74 ".concat("Login_inputCard__o5LDD"):"form-control h3 pl-74",onChange:Le,onInput:Ze,style:{fontSize:"15px",fontWeight:"400",border:te||re&&(null==Fe||null===(Ge=Fe.current)||void 0===Ge||null===(We=Ge.value)||void 0===We?void 0:We.length)>0?"1px solid red":"",color:"#8f8f8f"},onClick:()=>{var e;ee||m.Z.additionalEvents("started-phone-entry",G.orderDetails,null==q?void 0:q.couponCode,null==W||null===(e=W.Address_data)||void 0===e?void 0:e.length),le(!0)},onFocus:()=>{var e;null!=H&&null!==(e=H.sellerConfig)&&void 0!==e&&e.loginUITest&&Ie(),clearTimeout(ve.current),se(!1),ce("")},onBlur:()=>{(()=>{const e=/^[6-9]\d{9}$/;ve.current=setTimeout((()=>{var l,i;if(!e.test(null==Fe||null===(l=Fe.current)||void 0===l?void 0:l.value))return se(!0),ce("Enter valid 10 digit mobile number"),void(ae&&null!=H&&null!==(i=H.sellerConfig)&&void 0!==i&&i.loginUITest&&fe(!1))}),4e3)})()}}),ae&&re&&(0,g.jsx)("div",{style:{color:"#FF4545",fontSize:"12px",marginTop:"6px",textAlign:"center"},children:ue}),be&&(0,g.jsx)("span",{className:"Login_inputAddonRight__ptvZb",children:"Login"}),!1]}),H.isProductPage&&(0,g.jsxs)(g.Fragment,{children:[!1,(0,g.jsx)("div",{style:{marginTop:"10px"},ref:Ae,children:(0,g.jsx)(_.Z,{id:"productPageBuyNowAction",isCardDesign:!0,disabled:G.productSelectionOutStock<=0,onClick:()=>{10!==ie.length||G.updatingCart||Re(ie)},children:"Buy Now"})}),(0,g.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",marginTop:"5px"},children:[(0,g.jsx)("div",{style:{marginTop:1},children:(0,g.jsx)(E.sz,{color:"var(--primary-color)"})}),(0,g.jsx)("p",{className:"Login_info_text__uelTE",children:"By proceeding, you are agreeing to our Terms & conditions and Privacy policy."})]})]}),be&&(0,g.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",margin:"8px",justifyContent:"center"},children:[(0,g.jsx)("img",{src:"./assets/images/info-icon-black.svg",alt:"info-icon",height:11,width:11,style:{filter:be?"var(--login-popup-svg-filter)":""}}),(0,g.jsxs)("p",{className:"Login_info_text_login_popup__VEjKC",style:{color:"#717171"},children:["By proceeding, you are agreeing to our ",(0,g.jsx)("a",{href:"https://checkout.shiprocket.in/terms-conditions/",target:"_blank",style:{textDecoration:"underline",fontWeight:700,color:"#717171"},children:"T&C"})," and ",(0,g.jsx)("a",{href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",target:"_blank",style:{textDecoration:"underline",fontWeight:700,color:"#717171"},children:"Privacy policy"}),"."]})]}),H.AuthTokenGenerated&&(null!=H&&null!==(qe=H.sellerConfig)&&void 0!==qe&&qe.landmarkMandatory||null==H||null===(ze=H.sellerConfig)||void 0===ze||!ze.addressLayoutNew?(0,g.jsx)(a.Z,{setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading}):(0,g.jsx)(h.Z,{setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading}))]}),ye&&(null==H||null===(Ye=H.sellerConfig)||void 0===Ye?void 0:Ye.loginUITest)&&(0,g.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,g.jsxs)("div",{className:"Login_customTooltip__bwR66",children:[(0,g.jsx)("div",{className:"Login_tooltipArrow__wUaJh"}),"Please enter your mobile number to proceed."]})})]}),(null==H||null===(Qe=H.sellerConfig)||void 0===Qe?void 0:Qe.loginUITest)&&(0,g.jsxs)("button",{id:"ctaFake",type:"button",onClick:()=>{var e;null===(e=document.getElementById("mobile"))||void 0===e||e.focus()},className:e.isCardDesign?"Login_buttonCard__lDlcH":"Login_button__OdYu-",children:["Continue to payment",(0,g.jsx)("img",{src:"./assets/images/svg/arrowCtaRight.svg",alt:"arrow",height:20})]}),H.customLogin?(0,g.jsxs)("div",{className:"mt-24",children:[" ",(0,g.jsx)(f,{})," "]}):(null==H||null===(Je=H.sellerConfig)||void 0===Je||null===(Ke=Je.marketingConsentConfig)||void 0===Ke?void 0:Ke.isEnabled)&&(0,g.jsxs)("div",{className:"mt-24",children:[" ",(0,g.jsx)(b,{loginTermsConditionsChecked:pe,setLoginTermsConditionsChecked:he,html:null==H||null===($e=H.sellerConfig)||void 0===$e||null===(Xe=$e.marketingConsentConfig)||void 0===Xe?void 0:Xe.text})]})]}),!H.isProductPage&&!be&&(e=>{var l;if(!e)return!1;switch(e){case"50/50":return C.Q6["50/50"].test(null==Me?void 0:Me.slice(-1));case"80/20":return null===(l=C.Q6["80/20"])||void 0===l?void 0:l.test(null==Me?void 0:Me.slice(-1));case"100/0":return!0;default:return!1}})(Ue[Oe])&&(0,g.jsxs)("div",{className:null!=G&&G.cardDesignEnabled?"card-container":"Login_card_sr_promise__zhQkq",style:{background:null!=G&&G.cardDesignEnabled?"transparent":"",border:null!=G&&G.cardDesignEnabled?"none":"",boxShadow:null!=G&&G.cardDesignEnabled?"none":""},children:[(0,g.jsx)("div",{className:null!=G&&G.cardDesignEnabled?"Login_header_icon_card__i8ThP":"Login_header_icon__yJZnJ",children:(0,g.jsx)("img",{src:"./assets/images/sr_checkout_promise/sr_promise.svg",alt:"SR Promise",height:"20"})}),!(null!=G&&G.cardDesignEnabled)&&(0,g.jsx)("hr",{className:"Login_hr__2Mvoq"}),(0,g.jsxs)("ul",{className:"Login_bgCheckoutFeature__7kO-D",style:{marginTop:null!=G&&G.cardDesignEnabled?"0px":"35px",marginBottom:null!=G&&G.cardDesignEnabled?"0px":"",fontSize:"12px"},children:[(0,g.jsxs)("li",{children:[(0,g.jsx)("span",{className:t,children:(0,g.jsx)("img",{src:"./assets/images/sr_checkout_promise/rupee.svg",alt:"Delivery Guaranteed"})}),(0,g.jsxs)("span",{className:o,children:["Delivery ",(0,g.jsx)("br",{}),"Guranteed"]})]}),(0,g.jsxs)("li",{children:[(0,g.jsx)("span",{className:t,children:(0,g.jsx)("img",{src:"./assets/images/sr_checkout_promise/card.svg",alt:"Secure Transactions"})}),(0,g.jsxs)("span",{className:o,children:["Secure ",(0,g.jsx)("br",{}),"Transactions"]})]}),(0,g.jsxs)("li",{children:[(0,g.jsx)("span",{className:t,children:(0,g.jsx)("img",{src:"./assets/images/sr_checkout_promise/store.svg",alt:"7 Days Easy Return & Refund"})}),(0,g.jsxs)("span",{className:o,children:["7 Days Easy ",(0,g.jsx)("br",{})," Return"]})]}),(0,g.jsxs)("li",{children:[(0,g.jsx)("span",{className:t,children:(0,g.jsx)("img",{src:"./assets/images/sr_checkout_promise/ship_box_location.svg",alt:"Easy Order Tracking"})}),(0,g.jsxs)("span",{className:o,children:["Easy Order ",(0,g.jsx)("br",{})," Tracking"]})]})]})]}),H.fail&&(0,g.jsx)(d.Z,{error:H.error})," "]}))});var Be,He,Ve,Ge,We,qe,ze,Ye,Qe,Je,Ke,$e,Xe,el,ll,il,nl},j=n.memo(P)},2836:(e,l,i)=>{i.d(l,{Z:()=>x});var n=i(7313);var t=i(3624),o=i(6352),a=i(7666),d=i(536),r=i(2878),s=i(7075),u=i(455),c=i(6119),v=i(1608),m=i(7348),g=i(2183),p=i(3731),h=i(5381),y=i(6417);const f=n.lazy((()=>Promise.all([i.e(422),i.e(526),i.e(367),i.e(478)]).then(i.bind(i,1367)))),_=i(1318);new _("","");const C=e=>{const[l,i]=(0,n.useState)(30),[C,x]=(0,n.useState)(30),[b,A]=(0,n.useState)(!1),E=(0,o.v9)((e=>e.Otp)),S=(0,o.v9)((e=>e.Login)),D=(0,o.v9)((e=>e.Address)),w=(0,o.v9)((e=>e.Shipping)),N=(0,o.v9)((e=>e.Cart)),I=(0,o.v9)((e=>e.Coupon)),k=(0,o.I0)(),[T,P]=(0,n.useState)(0);S.onLoginPage=!1;const j=window.location.search;let F="shiprocketLogin"==new URLSearchParams(j).get("popupType");var R=new _("","");let L=R.getResult().device.type;const{verifyOtpLess:O}=(0,p.y)(e),M=l=>{l.target.checked?(E.fetchAddressPermission=!0,E.SSOPermission=!0):(E.fetchAddressPermission=!1,E.SSOPermission=!1),e.onRenderLoading()};let U,Z="";function B(e){const l=e.slice(0,5),i=e.slice(5);return"+91 ".concat(l," ").concat(i)}(0,n.useEffect)((()=>{}),[w.selected_service_data]),(0,n.useEffect)((()=>{E.otpLessOtpValue&&G(E.otpLessOtpValue)}),[E.otpLessOtpValue]),(0,n.useEffect)((()=>{null!=E&&E.verified&&window.parent.postMessage({trigger:"otp-read-stop"},"*")}),[null==E?void 0:E.verified]);const H=(0,n.useRef)(null);(0,n.useEffect)((()=>{null==H||H.current.focusInput(0)}),[e.otpFieldFocus]);const V=function(e){var l;"otp-autofill"===e.data.trigger&&(S.otpSkip||G(null==e||null===(l=e.data)||void 0===l?void 0:l.data),window.removeEventListener("message",V,!1))};(0,n.useEffect)((()=>{window.addEventListener("message",V,!1)}),[]);const G=async l=>{if(E.otpValue=l.substring(0,E.otpDigits),E.wrongOtp=!1,E.fail=!1,P((e=>1^e)),l.length===E.otpDigits){var n,t,o,d;s.Z.otpAdded(),null===(n=document.getElementById("otp"))||void 0===n||n.setAttribute("disabled","true");let c={otp:l,authentication_token:D.newUserAddressAdded?D.authentication_token_for_otp:S.authentication_token};if(E.spinner=!0,E.wrongOtp=!1,null!=S&&null!==(t=S.otpLess)&&void 0!==t&&t.initiationSuccesful&&"OTP"==(null==S||null===(o=S.otpLess)||void 0===o||null===(d=o.initiationResponse)||void 0===d?void 0:d.authType)&&!E.verifyFired){var r;E.verifyFired=!0;const l=await O(S.mobileNumber,E.otpValue);if(1==(null==l?void 0:l.success))S.otpLess.verificationSuccessful=!0,S.otpLess.verificationResponse=null==l?void 0:l.response,e.onRender();else if(0==(null==l?void 0:l.success)&&"FAILED"===(null==l||null===(r=l.response)||void 0===r?void 0:r.verification)){var u;k((0,a.PG)(null==l||null===(u=l.response)||void 0===u?void 0:u.errorMessage)),i(0),x(0)}}else k((0,a.Mu)(c,S.sellerConfig.seller_id))}};(0,n.useEffect)((()=>{S.fireShipRocketFallBackOtpRequest&&(S.fireShipRocketFallBackOtpRequest=!1,W(!1))}),[S.fireShipRocketFallBackOtpRequest]);const W=async l=>{var i,n,t,o;S.otpLess={initiationSuccesful:!1,initiationResponse:{requestID:null,deliveryChannel:null,authType:null,channel:null},verificationSuccessful:!1,verificationResponse:null,token:null},S.user_type="known",E.otpDigits=6,e.onRender(),window.parent.postMessage({trigger:"otp-read-start"},"*"),s.Z.otpRequested(),s.Z.additionalEvents("resend-otp",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1);let d={authentication_token:S.authentication_token,mobile_no:S.mobileNumber,channel:"SMS",resend_via_whatsapp:l,engage_whatsapp_opted:null===(i=S.sellerConfig)||void 0===i||null===(n=i.notifications)||void 0===n?void 0:n.engageWhatsappOpted,company_id:null===(t=S.sellerConfig)||void 0===t?void 0:t.companyId,cart_id:null==N||null===(o=N.Cart_data)||void 0===o?void 0:o.id};k((0,a.qF)(d,S.sellerConfig.seller_id)),l?z():q()},q=()=>{i(30);const e=setInterval((()=>{i((l=>l<=1&&(clearInterval(e),0===l)?l:l-1))}),1e3)},z=()=>{x(30);const e=setInterval((()=>{x((l=>l<=1&&(clearInterval(e),0===l)?l:l-1))}),1e3)};return(0,n.useEffect)((()=>{z(),q(),b||(s.Z.addOtpScreenOpened(),s.Z.otpRequested(),A(!0))}),[]),(0,n.useEffect)((()=>{0===C&&S.whatsappHidden&&(S.whatsappHidden=!1,e.onRenderLoading())}),[C]),"known"===S.user_type_for_text||"otpLess"===S.user_type_for_text?(Z=S.customLogin?"Verify your phone number":"Verify phone number",U=(0,y.jsxs)("div",{className:F?"content login-popup-private-color align-v-center":null!=N&&N.cardDesignEnabled?"mb-10 content align-v-center ".concat("Otp_cardSubHeading__opER5"):"mb-10 content grey-dark align-v-center",style:F?{display:"flex",fontSize:"12px",lineHeight:"12px"}:{display:"flex"},children:[(0,y.jsx)("span",{style:null!=N&&N.cardDesignEnabled?{color:"var(--body-text-secondary)"}:{},children:F?"OTP sent to":"Enter OTP sent to"}),(0,y.jsxs)("span",{className:"semi-bold",style:{fontWeight:"600",fontSize:null!=N&&N.cardDesignEnabled?"14px":"",marginLeft:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,y.jsx)("span",{style:{color:"var(--body-text-primary)"},children:B(S.mobileNumber)})," ",(0,y.jsx)("span",{style:{display:"flex",color:F?"var(--login-popup-primary-color)":null!=N&&N.cardDesignEnabled||S.customLogin?"var(--primary-color)":"rgb(111, 87, 233)",cursor:"pointer",border:"1px solid var(--secondary-color)",borderRadius:"6px",alignItems:"center",justifyContent:"center"},onClick:async()=>{var e,l,i;await(0,g.kf)({name:null!=N&&N.cardDesignEnabled?"CHANGE_NUMBER_VIA_OTP_SCREEN_CARD":"CHANGE_NUMBER_VIA_OTP_SCREEN",domain:null===(e=S.sellerConfig)||void 0===e?void 0:e.domainName,payload:{cart_id:null==N||null===(l=N.Cart_data)||void 0===l?void 0:l.id,otpLess:null==S||null===(i=S.sellerConfig)||void 0===i?void 0:i.enabledFeatureCodForm}}),s.Z.additionalEvents("edit-phone-before-otp",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1),v.y.removeItem("refreshToken"),v.y.removeItem("refreshTokenValue"),v.y.removeItem("user_id"),v.y.removeItem("seller_id"),v.y.removeItem("pim_sid"),v.y.removeItem("expireTime"),window.location.reload()},children:(0,y.jsx)(h.dY,{color:"var(--primary-color)"})})]})]})):(Z=S.customLogin?"Verify your mobile number":"Verify mobile number",U=(0,y.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,y.jsxs)("span",{className:F?"login-popup-private-color":"",style:F?{fontSize:"12px",lineHeight:"12px"}:{},children:[F?"OTP sent to":"".concat(E.otpDigits,"-digit OTP sent to")," "]}),(0,y.jsxs)("span",{className:"semi-bold ".concat(F?"login-popup-private-color":""),style:F?{fontWeight:"600",fontSize:"12px",lineHeight:"12px",display:"flex",justifyContent:"center",alignItems:"center"}:{fontWeight:"600",display:"flex",justifyContent:"center",alignItems:"center"},children:[B(S.mobileNumber)," ",(0,y.jsx)("span",{style:{display:"flex",color:F?"var(--login-popup-primary-color)":null!=N&&N.cardDesignEnabled||S.customLogin?"var(--primary-color)":"rgb(111, 87, 233)",cursor:"pointer",border:"1px solid var(--secondary-color)",borderRadius:"6px",alignItems:"center",justifyContent:"center"},children:(0,y.jsx)(h.dY,{color:"var(--primary-color)"})})]})]})),(0,y.jsx)(y.Fragment,{children:(N.fail||E.fail||w.fail||D.fail)&&!E.wrongOtp?(e.onError(),(0,y.jsx)(y.Fragment,{})):S.changeNumber?(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(d.default,{onRender:e.onRender,onRenderLoading:e.onRenderLoading})}):D.addAddress&&!E.verified?(0,y.jsx)(y.Fragment,{children:null!=S&&null!==(Q=S.sellerConfig)&&void 0!==Q&&Q.landmarkMandatory||null==S||null===(J=S.sellerConfig)||void 0===J||!J.addressLayoutNew?(0,y.jsx)(r.Z,{setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading}):(0,y.jsx)(m.Z,{setAddressToShow:e.setAddressToShow,onRender:e.onRender,onRenderLoading:e.onRenderLoading})}):E.verified&&D.selectedAddress?(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(f,{onRender:e.onRender,onRenderLoading:e.onRenderLoading})}):1!==E.loader&&E.verified?void 0:(0===E.loader&&E.fail?(E.spinner=!1,null===(Y=document.getElementById("otp"))||void 0===Y||Y.removeAttribute("disabled"),E.wrongOtp=!0):E.verified&&(E.spinner=!1),(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"".concat(null!=N&&N.cardDesignEnabled?"card-container":""),style:{background:null!=N&&N.cardDesignEnabled?"none":"",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",boxShadow:"none",border:"none",marginTop:F?"20px":""},children:[(0,y.jsxs)("div",{className:"OtpLargeScreen",children:[!F&&(0,y.jsx)("div",{className:null!=N&&N.cardDesignEnabled?"headingCard":"heading",style:{marginBottom:"4px",fontSize:S.customLogin?20:"",fontWeight:S.customLogin?500:""},children:Z}),(0,y.jsx)("div",{className:null!=N&&N.cardDesignEnabled?"contentCard":"content",style:{marginBottom:F||S.customLogin?0:16},children:U})]}),(0,y.jsxs)("div",{style:{width:"100%"},children:[(0,y.jsx)("div",{id:F?"otpBoxLoginPopup":null!=N&&N.cardDesignEnabled?"otpboxCard":"otpbox",style:{width:6===E.otpDigits?"100%":"67%",margin:"auto",marginTop:"8px"},children:(0,y.jsx)(u.Z,{ref:H,onChange:e=>{G(e)},numInputs:E.otpDigits,value:E.otpValue,inputStyle:{border:F?"var(--login-popup-primary-color)":null!=N&&N.cardDesignEnabled?"1px solid var(--secondary-color)":"1px solid #DFE0EB",flex:1,height:"40px",background:null!=N&&N.cardDesignEnabled?"var(--card-backgorund-cta-button-text, #FFF)":"#F9F9F9",fontSize:"16px"},containerStyle:{justifyContent:"space-around",gap:6===E.otpDigits?"5%":"10%"},isInputNum:!0,isDisabled:E.verifyFired,autoComplete:"one-time-code",shouldAutoFocus:"mobile"!==R.getResult().device.type})}),E.wrongOtp&&E.errorMessage&&!E.resendErrorMessage&&(0,y.jsx)(t.Z,{msg:E.errorMessage}),E.resendErrorMessage&&(0,y.jsxs)("div",{style:{marginBottom:"10px"},children:[(0,y.jsx)(t.Z,{msg:E.resendErrorMessage,type:"resend"})," "]}),!E.resendErrorMessage&&(0,y.jsx)("div",{className:F?"Otp_resendTextLoginPopup__sNFXY":"Otp_resendText__Lqja4",style:{display:"flex",alignItems:"center",justifyContent:"center",color:"var(--body-text-secondary)"},children:l>0||C>0?(0,y.jsxs)(y.Fragment,{children:["Resend OTP in",C>0||l>0?(0,y.jsxs)("div",{style:{display:"flex",alignItems:"flex-start"},children:[(0,y.jsx)("div",{style:{marginRight:4},children:(0,y.jsx)(h.AN,{color:"var(--primary-color)"})}),(0,y.jsxs)("span",{className:null!=N&&N.cardDesignEnabled?"Otp_timerCard__E6OmO":"Otp_timer__u-Exy",children:[C>0?C<10?"0"+C:C:l>0?l<10?"0"+l:l:"","s"]})]}):""]}):(0,y.jsxs)(y.Fragment,{children:["Resend OTP via ",(0,y.jsx)("span",{className:null!=N&&N.cardDesignEnabled?"resend-button-card":"",onClick:()=>W(!1),style:{color:F?"var(--login-popup-primary-color)":null!=N&&N.cardDesignEnabled||S.customLogin?"var(--primary-color)":"rgb(111, 87, 233)",cursor:"pointer",border:"1px solid var(--secondary-color)",padding:"5px 6px",borderRadius:"6px"},children:"SMS"}),!S.whatsappHidden&&(0,y.jsxs)(y.Fragment,{children:[" OR ",(0,y.jsx)("span",{className:null!=N&&N.cardDesignEnabled?"resend-button-card":"",onClick:()=>W(!0),style:{display:"flex",color:F?"var(--login-popup-primary-color)":null!=N&&N.cardDesignEnabled||S.customLogin?"var(--primary-color)":"rgb(111, 87, 233)",cursor:"pointer",border:"1px solid var(--secondary-color)",padding:"5px 6px",borderRadius:"6px",alignItems:"center",justifyContent:"center"},children:(0,y.jsx)("img",{src:"./assets/images/whatsapp.svg",alt:"whatsapp-icon",height:"15px",style:{marginTop:"-2px",marginLeft:"3px"}})})]})]})})]}),F&&(0,y.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",marginTop:"8px",justifyContent:"center"},children:[(0,y.jsx)("img",{src:"./assets/images/info-icon-black.svg",alt:"info-icon",height:11,width:11,style:{filter:F?"var(--login-popup-svg-filter)":""}}),(0,y.jsxs)("p",{className:"Otp_info_text_login_popup__KKReb",style:{color:"#717171"},children:["By proceeding, you are agreeing to our ",(0,y.jsx)("a",{href:"https://checkout.shiprocket.in/terms-conditions/",target:"_blank",style:{textDecoration:"underline",fontWeight:700,color:"#717171"},children:"T&C"})," and ",(0,y.jsx)("a",{href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",target:"_blank",style:{textDecoration:"underline",fontWeight:700,color:"#717171"},children:"Privacy policy"}),"."]})]}),"new"===S.user_type_for_text&&!F&&(0,y.jsxs)("p",{style:{fontSize:"12px",color:"rgba(113, 113, 113, 0.7)",margin:"10px 0px"},children:["By proceeding, you are agreeing to our"," ",(0,y.jsx)("a",{href:"https://checkout.shiprocket.in/terms-conditions/",onClick:()=>{s.Z.additionalEvents("terms-and-conditions",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)},target:"_blank",style:{color:"#292A2C"},children:"Terms & conditions"})," and",(0,y.jsx)("a",{href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",target:"_blank",onClick:()=>{s.Z.additionalEvents("privacy-policy",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)},style:{color:"#292A2C"},children:" Privacy policy"})]}),"mobile"!==L&&"known"===S.user_type_for_text&&!0!==S.Login_data.fetch_address_flag&&!F&&(0,y.jsxs)("div",{style:{display:"flex",marginTop:"10px",alignItems:"flex-start"},children:[(0,y.jsx)("input",{id:"fetchAddress",type:"checkbox",onChange:M,style:{accentColor:"var(--primary-color)",marginTop:null!=N&&N.cardDesignEnabled?"":"4px",height:null!=N&&N.cardDesignEnabled?"18px":"",width:null!=N&&N.cardDesignEnabled?"18px":""},checked:E.fetchAddressPermission}),(0,y.jsx)("p",{style:{marginLeft:"5px",fontSize:"12px",color:null!=N&&N.cardDesignEnabled?"var(--Checkout-Primary-Color, #292929)":"rgba(113, 113, 113, 0.7)",fontWeight:null!=N&&N.cardDesignEnabled?"500":""},children:"Fetch my shipping addresses based on past orders"}),(0,y.jsx)("p",{"data-tooltip-id":"otpToolTip2",children:(0,y.jsx)("img",{src:"https://d10srchmli830n.cloudfront.net/1663766402357_bf67f4db-5e4f-4632-9d62-6e992bdccd99_Group-27666tooltip.svg",alt:"info",style:{marginLeft:"5px",marginTop:"3px"},height:"15px"})}),(0,y.jsxs)(c.u,{id:"otpToolTip2",className:"Otp_tooltipDesktop__eViId",arrowColor:"transparent",clickable:!0,delayHide:1e3,children:["Based on my past purchases, I hereby provide my consent to fetch my previous addresses. I understand that usage of this Shiprocket service is subject to our"," ",(0,y.jsx)("a",{href:"https://checkout.shiprocket.in/terms-conditions/",style:{color:"white"},onClick:()=>{s.Z.additionalEvents("terms-and-conditions",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)},target:"_blank",children:"Terms & conditions"})," and "," ",(0,y.jsx)("a",{href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",style:{color:"white"},onClick:()=>{s.Z.additionalEvents("privacy-policy",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)},target:"_blank",children:"Privacy policy"}),"."]})]}),"mobile"===L&&"known"===S.user_type_for_text&&!0!==S.Login_data.fetch_address_flag&&!F&&(0,y.jsxs)("div",{style:{display:"flex",marginTop:"10px",alignItems:"flex-start"},children:[(0,y.jsx)("input",{id:"fetchAddress",type:"checkbox",onChange:M,style:{accentColor:null!=N&&N.cardDesignEnabled?"var(--primary-color)":"#EFEFEF",marginTop:null!=N&&N.cardDesignEnabled?"":"4px",height:null!=N&&N.cardDesignEnabled?"18px":"",width:null!=N&&N.cardDesignEnabled?"18px":""},checked:E.fetchAddressPermission}),(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,y.jsx)("p",{style:{marginLeft:"5px",fontSize:"12px",color:null!=N&&N.cardDesignEnabled?"var(--Checkout-Primary-Color, #292929)":"rgba(113, 113, 113, 0.7)",fontWeight:null!=N&&N.cardDesignEnabled?500:""},children:"Fetch my shipping addresses based"}),(0,y.jsxs)("div",{style:{display:"flex",position:"relative"},children:[(0,y.jsx)("p",{style:{marginLeft:"5px",fontSize:"12px",color:null!=N&&N.cardDesignEnabled?"var(--Checkout-Primary-Color, #292929)":"rgba(113, 113, 113, 0.7)",fontWeight:null!=N&&N.cardDesignEnabled?500:""},children:"on past orders"}),(0,y.jsx)("p",{"data-tooltip-id":"otpToolTip1",children:(0,y.jsx)("img",{src:"https://d10srchmli830n.cloudfront.net/1663766402357_bf67f4db-5e4f-4632-9d62-6e992bdccd99_Group-27666tooltip.svg",alt:"info",style:{marginLeft:"5px",marginTop:"3px"},height:"15px"})}),(0,y.jsxs)(c.u,{id:"otpToolTip1",className:"Otp_tooltip__7xs2R",arrowColor:"transparent",clickable:!0,delayHide:1e3,children:["Based on my past purchases, I hereby provide my consent to fetch my previous addresses. I understand that usage of this Shiprocket service is subject to our"," ",(0,y.jsx)("a",{href:"https://checkout.shiprocket.in/terms-conditions/",style:{color:"white"},onClick:()=>{s.Z.additionalEvents("terms-and-conditions",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)},target:"_blank",children:"Terms & conditions"})," and "," ",(0,y.jsx)("a",{href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",style:{color:"white"},onClick:()=>{s.Z.additionalEvents("privacy-policy",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)},target:"_blank",children:"Privacy policy"}),"."]})]})]})]}),!(null!==(K=S.sellerConfig)&&void 0!==K&&K.ssoBlock)&&!F&&(0,y.jsxs)("div",{style:{display:"flex",marginTop:"5px",height:"20px",alignItems:"center"},children:[(0,y.jsx)("input",{disabled:!E.fetchAddressPermission,id:"ssoPermission",type:"checkbox",onChange:l=>{l.target.checked?(E.SSOPermission=!0,s.Z.additionalEvents("sso-reenabled",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)):(E.SSOPermission=!1,s.Z.additionalEvents("sso-disabled",null==N?void 0:N.Cart_data,I.couponCode,!!v.y.getItem("refreshToken"),!1)),e.onRenderLoading()},style:{accentColor:"var(--primary-color)",height:null!=N&&N.cardDesignEnabled?"18px":"",width:null!=N&&N.cardDesignEnabled?"18px":""},checked:E.SSOPermission}),(0,y.jsx)("p",{style:{marginLeft:"5px",fontSize:"12px",color:null!=N&&N.cardDesignEnabled?"var(--body-text-secondary, #292929)":"rgba(113, 113, 113, 0.7)",fontWeight:"500"},children:"Keep me logged in on this device."})]}),null!=S&&null!==($=S.sellerConfig)&&void 0!==$&&$.enabledFeatureSkipOtp&&null!=S&&null!==(X=S.sellerConfig)&&void 0!==X&&X.featureCheckoutAsGuest&&!F?(0,y.jsxs)("div",{style:{display:"flex",width:"100%",justifyContent:"flex-end",marginTop:"8px",flexDirection:"column"},children:[(0,y.jsx)("div",{style:{display:"flex",marginRight:"20px",justifyContent:"center",marginBottom:"8px",color:"var(--body-text-primary)"},children:"OR"}),(0,y.jsx)("button",{className:null!=N&&N.cardDesignEnabled?"modal_button_white":"modal_button",onClick:()=>{window.parent.postMessage({trigger:"otp-read-stop"},"*"),window.removeEventListener("message",V,!1),k({type:"SKIP_OTP_SUCCESS"}),e.onRender(),e.onRenderLoading()},style:{marginRight:"20px",color:null!=N&&N.cardDesignEnabled?"var(--primary-color)":"#6F57E9",fontWeight:500,cursor:"pointer"},children:"Continue as guest"})]}):null!=S&&null!==(ee=S.sellerConfig)&&void 0!==ee&&ee.loginUITest?(0,y.jsxs)("button",{id:"ctaFake",type:"button",onClick:()=>{},className:e.isCardDesign?"Otp_fakeCtaButtonCard__6U8JU":"Otp_fakeCtaButton__lObgk",children:["Continue to payment",(0,y.jsx)("img",{src:"./assets/images/svg/arrowCtaRight.svg",alt:"arrow",height:20})]}):null]})}))});var Y,Q,J,K,$,X,ee},x=n.memo(C)},5504:(e,l,i)=>{i.d(l,{Z:()=>g});const n="modal_backDrop__K0MUS",t="modal_modalCard__fw0ob",o="modal_closeWrapper__8fcc2",a="modal_close__dW+iB",d="modal_title__Td4A0",r="modal_bgWhite__Mp2CW";var s=i(3061),u=i(7313),c=i(6352),v=i(6417);const m=e=>{let{scarcityFeatureChoice:l,totalDiscount:i,scarcityDisplayText:n}=e;const t=(0,c.v9)((e=>e.Cart)),o=0===i||(null==l?void 0:l.includes("LIMITED_STOCK"))||t.hasAnyFreebie,a={"Products in huge demand might run Out of Stock":"Products in huge demand might run Out of Stock","Offer ends in 02:55:59":"Offer ends in 02:55:59","Grab your X% discount before it's gone!":"Grab your ₹".concat(i," discount before it's gone!"),"You might miss out on savings of ₹X":"You might miss out on savings of ₹".concat(i)};return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)("div",{className:"modal_scarcityBanner__CnZqy",style:o?{background:"linear-gradient(to right,#fff9ef,#ffd4c6)",color:"#e95123"}:{background:"linear-gradient(to right,#f3fdf5,#adf3bb)",color:"#248018"},children:t.hasAnyFreebie?(0,v.jsxs)("div",{style:{display:"flex",gap:"4px",color:"#777777"},children:[(0,v.jsx)("img",{src:"./assets/images/redGiftBox.png",height:20,width:18,style:{marginTop:"-4px"},alt:"hourGlass"}),"You might miss out on ",(0,v.jsx)("span",{style:{fontWeight:"bold",color:"#248018"},children:"FREE GIFT!"})]}):o?(0,v.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[(0,v.jsx)("img",{src:"./assets/images/hourglassRed.gif",height:15,width:13,style:{marginTop:"-2px"},alt:"hourGlass"}),null!=l&&l.includes("ENABLED")?null==a?void 0:a[n]:(0,v.jsxs)(v.Fragment,{children:["Products in huge demand might run ",(0,v.jsx)("span",{style:{fontWeight:"bold"},children:" Out of Stock"})]})]}):(0,v.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[(0,v.jsx)("img",{src:"./assets/images/HourglassGreen.gif",height:15,width:11,style:{marginTop:"-2px"},alt:"hourGlass"}),(0,v.jsx)("span",{children:null!=l&&l.includes("ENABLED")?null==a?void 0:a[n]:(0,v.jsxs)(v.Fragment,{children:["You might miss out on savings of ",(0,v.jsxs)("span",{style:{fontWeight:"bold",fontSize:"14px"},children:["₹",i]})]})})]})})})};function g(e){var l,i,g,p,h,y,f;const _=(0,c.v9)((e=>e.Address)),C=(0,c.v9)((e=>e.Cart)),x=(null==C||null===(l=C.Cart_data)||void 0===l?void 0:l.totalDiscount)||0,b=(0,c.v9)((e=>e.Login)),[A,E]=(0,u.useState)(!1),S=null===(i=b.sellerConfig)||void 0===i||null===(g=i.scarcityFeatureChoice)||void 0===g?void 0:g.toUpperCase(),D=null===(p=b.sellerConfig)||void 0===p?void 0:p.scarcityDisplayText;return(0,u.useEffect)((()=>{e.open?(document.body.style.overflow="hidden",b.isAnyModalOpen=!0):(document.body.style.overflow="scroll",b.isAnyModalOpen=!1)}),[e.open]),(0,u.useEffect)((()=>{if("Edit address"===e.title&&!0!==_.addressUpdateFail&&!_.updatingAddress){const e=document.getElementById("modalBodyFastrr");null==e||e.scrollTo({top:0,left:0,behavior:"auto"})}}),[e.children]),e.open?(0,v.jsx)(v.Fragment,{children:null!=C&&C.cardDesignEnabled||e.showNewModal?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:(0,s.Z)(n,!0===A&&"modal_closeBackDrop__7AjyW"),onClick:()=>{!e.notshowInteract&&E(!0),!e.notshowInteract&&setTimeout((()=>{e.onClose(),E(!1)}),320)},id:"modalOpened"}),(0,v.jsxs)("div",{className:(0,s.Z)(t,!0===A&&"modal_closeModalCard__d35Q+"),style:{backgroundColor:"".concat(null!=e&&e.backgroundColor?null==e?void 0:e.backgroundColor:"grey"===e.bg?"#F2F4F7":"#fffff")},children:[(0,v.jsxs)("div",{className:(0,s.Z)(null==e?void 0:e.headerCardStyle,"white"===e.couponHeading&&r,"modal_HeaderCard__xbQC+"),style:e.titleCenter?{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:null!=C&&C.cardDesignEnabled?"":"1px solid #dcdcdc"}:{},children:[(null==e?void 0:e.title)&&(0,v.jsx)("div",{className:null!=e&&e.titleClassName?null==e?void 0:e.titleClassName:d,children:null==e?void 0:e.title}),(null==e?void 0:e.textSubtitle)&&(0,v.jsx)("div",{className:"mt-10",children:null==e?void 0:e.textSubtitle}),(null==e?void 0:e.showClose)&&(0,v.jsx)("div",{className:o,children:(0,v.jsx)("div",{onClick:()=>{E(!0),setTimeout((()=>{e.onClose(),E(!1)}),320)},className:a})})]}),(null==e?void 0:e.showBanner)&&(S&&!(null!=S&&S.includes("DISABLED"))||C.hasAnyFreebie)&&(0,v.jsx)("div",{style:{marginBottom:"12px"},children:(0,v.jsx)(m,{scarcityFeatureChoice:S,totalDiscount:x,scarcityDisplayText:D})}),(0,v.jsx)("div",{className:"modal_bodyCard__LVtrf",id:"modalBodyFastrr",style:{height:e.height?e.height:"",background:null!==(h=b.sellerConfig)&&void 0!==h&&null!==(y=h.uiConfig)&&void 0!==y&&null!==(f=y.customConfig)&&void 0!==f&&f.bodyBgColor?"var(--modal-bg-color)":null!=e&&e.backgroundColor?null==e?void 0:e.backgroundColor:"grey"===e.bg?"#F2F4F7":"white",...e.style},children:null==e?void 0:e.children})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:n,onClick:e.onClose,id:"modalOpened"}),(0,v.jsxs)("div",{className:(0,s.Z)(t,{modal_modalSm__xCRlJ:"sm"===(null==e?void 0:e.size),modal_modalSmExtra__SJHFr:"smx"===(null==e?void 0:e.size),modal_modalMd__qgfYa:"md"===(null==e?void 0:e.size),modal_modalMid__Dloj4:"mid"===(null==e?void 0:e.size),"modal_modalMdExtra__bE8+8":"mdx"===(null==e?void 0:e.size),modal_modalLg__d0hG1:"lg"===(null==e?void 0:e.size)}),style:{backgroundColor:"".concat("grey"===e.bg?"#F2F4F7":"#fffff")},children:[(0,v.jsxs)("div",{className:"\n ".concat("modal_Header__+Gtt-"," \n ").concat("white"===e.couponHeading&&r),style:!e.showBanner||!S||null!=S&&S.includes("DISABLED")?e.titleCenter?{display:"flex",alignItems:"center",justifyContent:"center"}:{}:{border:"none"},children:[(null==e?void 0:e.title)&&(0,v.jsx)("div",{className:null!=e&&e.titleClassName?null==e?void 0:e.titleClassName:d,children:null==e?void 0:e.title}),(null==e?void 0:e.textSubtitle)&&(0,v.jsx)("div",{className:"mt-10",children:null==e?void 0:e.textSubtitle}),(null==e?void 0:e.showClose)&&(0,v.jsx)("div",{className:o,children:(0,v.jsx)("div",{onClick:e.onClose,className:a})})]}),e.showBanner&&(S&&"DISABLED"!==S||C.hasAnyFreebie)&&(0,v.jsx)(m,{scarcityFeatureChoice:S,totalDiscount:x,scarcityDisplayText:D}),(0,v.jsx)("div",{className:"modal_body__t765M",id:"modalBodyFastrr",style:{height:e.height?e.height:"",...e.style},children:null==e?void 0:e.children})]})]})}):null}},470:(e,l,i)=>{i.d(l,{Z:()=>d});var n=i(7313);var t=i(6352),o=i(528),a=i(6417);const d=e=>{var l,i,d,r;const s=(0,t.v9)((e=>e.Cart)),u=(0,t.v9)((e=>e.Login)),c=window.location.search;let v=new URLSearchParams(c),m=null!=v.get("seller")?v.get("seller"):null;const g={"staging.agribegri.com":"https://staging.agribegri.com/declined.php?payment_status=0","agribegri.com":"https://agribegri.com/declined.php?payment_status=0"},p=()=>{var l,i;e.isHeadless&&(m||null!==(l=u.sellerConfig)&&void 0!==l&&l.domainName)||null!=g&&g[u.sellerConfig.domainName]?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null!=g&&g[u.sellerConfig.domainName]?null==g?void 0:g[u.sellerConfig.domainName]:null!==(i=u.sellerConfig)&&void 0!==i&&i.domainName?"https://".concat(u.sellerConfig.domainName):"https://".concat(m)}}]},"*"):window.parent.postMessage({trigger:"headless-close"},"*")};(0,n.useEffect)((()=>{s.verifyingPayment=!1,window.scrollTo(0,0)}),[]);const h=null!=u&&null!==(l=u.sellerConfig)&&void 0!==l&&null!==(i=l.uiConfig)&&void 0!==i&&null!==(d=i.customConfig)&&void 0!==d&&d.bodyBgColor?"var(--whole-body-color)":"var(--body-bg-color)";return(0,a.jsx)(a.Fragment,{children:null!=s&&s.cardDesignEnabled?(0,a.jsx)("div",{className:"NotificationScreen_wholeContainerCard__HaSxk",children:(0,a.jsxs)("div",{className:"card-container",style:{display:"flex",alignItems:"center",height:"-webkit-fill-available",justifyContent:"center",width:"100%",gap:"8px"},children:[(0,a.jsx)("div",{className:"NotificationScreen_subheading1Card__2U12J",children:null==e?void 0:e.heading}),e.svgImage?e.svgImage("var(--primary-color)"):(0,a.jsx)("img",{src:""+"./assets/images/".concat(null==e?void 0:e.image,"Card.svg"),alt:"error"}),(0,a.jsx)("div",{className:"NotificationScreen_container1Card__YB7Ab",style:{display:"flex",justifyContent:"center"},children:(0,a.jsx)("p",{style:{width:"90%"},children:null==e?void 0:e.subheading})}),!e.showButton&&(0,a.jsx)("div",{style:{width:"60%",margin:"12px auto"},children:e.isHeadless?u.sellerConfig.domainName&&(0,a.jsx)(o.Z,{onClick:p,isCardDesign:!0,children:"Back To Home"}):(0,a.jsx)(o.Z,{onClick:p,isCardDesign:!0,children:e.ctaText?e.ctaText:"Continue Shopping"})})]})}):(0,a.jsx)("div",{className:"NotificationScreen_wholeContainer__ws7Mo",style:{height:null!==(r=e.height)&&void 0!==r?r:"90vh",backgroundColor:h},children:(0,a.jsxs)("div",{className:"NotificationScreen_orderSummaryContainer__U3ZOm",children:[(0,a.jsx)("img",{src:""+"./assets/images/".concat(null==e?void 0:e.image,".svg"),style:{marginBottom:"32px",width:"140px"},alt:"error"}),(0,a.jsx)("div",{className:"NotificationScreen_subheading1__NVbdt",children:null==e?void 0:e.heading}),(0,a.jsx)("div",{className:"NotificationScreen_container1__jflhD",style:{display:"flex",justifyContent:"center"},children:(0,a.jsx)("p",{style:{width:"50%"},children:null==e?void 0:e.subheading})}),!e.showButton&&(0,a.jsx)("div",{style:{width:"60%",margin:"auto"},children:e.isHeadless?u.sellerConfig.domainName&&(0,a.jsx)("button",{className:"btn white full-width primary mb-10",onClick:p,children:"Back To Home"}):(0,a.jsx)("button",{className:"btn white full-width primary mb-10",onClick:p,children:e.ctaText?e.ctaText:"Continue Shopping"})})]})})})}},7674:(e,l,i)=>{i.d(l,{Z:()=>K});var n=i(7313);const t="OrderSummary_title__W2qdS",o="OrderSummary_titleCard__WCcUA",a="OrderSummary_total__hqcW-",d="OrderSummary_summaryLabel__xVk1n",r="OrderSummary_summaryLabelCard__VjCe0",s="OrderSummary_item__f32xN",u="OrderSummary_itemImage__9Qjll",c="OrderSummary_itemPrice__PNqU6",v="OrderSummary_itemTitle__2EVT9",m="OrderSummary_itemQuantity__WZhwm",g="OrderSummary_itemDetails__3xt4z",p="OrderSummary_orderItems__vYUWl",h="OrderSummary_orderItemsCard__AkhQk",y="OrderSummary_itemTitleCard__ZM07y",f="OrderSummary_itemQuantityCard__66y8v",_="OrderSummary_itemPriceCard__6GAIR",C="OrderSummary_selectGiftRow__eTlPB",x="OrderSummary_singleGiftText__yIOn8",b="OrderSummary_singleGiftTextCard__ID10X",A="OrderSummary_cardPrevTotal__iV1eQ",E="OrderSummary_freebieTag__4Bbpc",S="OrderSummary_iconContainer__a+CJi";var D=i(3061),w=i(6352),N=i(7075),I=i(1608),k=i(5504),T=i(3960);var P=i(6417);const j=e=>{let{item:l,modifyCart:i,setShowRemoveItemModal:n,setCurrentQtyModifyingItem:t}=e;return(0,P.jsx)("div",{className:"modifyQuantity_selectQtyRow__yMlve",onClick:e=>e.stopPropagation(),children:(0,P.jsxs)("div",{className:"modifyQuantity_qtyContainer__WIY1R",children:[(0,P.jsx)("span",{onClick:()=>{1===l.quantity?(n(!0),t(l)):l.quantity>0&&i({...l,quantity:l.quantity-1},"QTY")},style:{cursor:"pointer",color:"var(--primary-color)",fontWeight:"400"},children:"-"}),(0,P.jsx)("h4",{style:{fontWeight:"400"},children:l.quantity}),(0,P.jsx)("span",{onClick:()=>{i({...l,quantity:l.quantity+1},"QTY")},style:{cursor:"pointer",color:"var(--primary-color)",fontWeight:"400"},children:"+"})]})})};var F=i(9369);const R=e=>{var l,i,n,t,o;const a=(0,w.v9)((e=>e.Cart)),d=!(null==a||null===(l=a.Cart_data)||void 0===l||null===(i=l.cartAttributes)||void 0===i||!i.gift_text);return(0,P.jsxs)("div",{className:"OrderSummary_giftMsgContainer__9Y6Lc",style:{margin:null!=a&&a.cardDesignEnabled?"":"0px 16px 8px 16px",padding:null!=a&&a.cardDesignEnabled?"8px":"12px"},children:[(0,P.jsxs)("div",{className:"OrderSummary_giftMsgBox__IaQrz",onClick:()=>{var l,i;e.setIsGiftMsgBoxOpen(!e.isGiftMsgBoxOpen),d&&!e.isGiftMsgBoxOpen&&e.setGiftMsgText(null==a||null===(l=a.Cart_data)||void 0===l||null===(i=l.cartAttributes)||void 0===i?void 0:i.gift_text)},children:[(0,P.jsxs)("div",{className:"OrderSummary_giftNoteTextContainer__KUMlJ",children:[(0,P.jsx)("img",{src:"/assets/images/svg/gift_msg.svg",alt:"gift",style:{marginRight:"4px"},height:24}),(0,P.jsx)("div",{className:"OrderSummary_giftNoteMsg__ZSQ37",children:e.isGiftMsgBoxOpen||!d?"Add Gift Note":null==a||null===(n=a.Cart_data)||void 0===n||null===(t=n.cartAttributes)||void 0===t?void 0:t.gift_text})]}),e.giftMsgText&&!e.isGiftMsgBoxOpen&&d?(0,P.jsxs)("div",{style:{display:"flex"},children:[(0,P.jsx)("div",{className:S,onClick:()=>e.setIsGiftMsgBoxOpen(!0),children:(0,P.jsx)("img",{src:"/assets/images/svg/editIconGrey.svg",alt:"gift",style:{marginRight:"10px"}})}),(0,P.jsx)("div",{className:S,onClick:l=>(l=>{l.stopPropagation(),e.setShowRemoveGiftMsgModal(!0)})(l),children:(0,P.jsx)("img",{src:"/assets/images/svg/deleteIconGrey.svg",alt:"gift",style:{marginRight:"4px"}})})]}):(0,P.jsx)("img",{src:"./assets/images/arrowIconCard.svg",alt:"arrow",style:{transform:e.isGiftMsgBoxOpen?"rotate(-90deg)":"rotate(90deg)"},height:10})]}),e.isGiftMsgBoxOpen&&(0,P.jsxs)("div",{children:[(0,P.jsx)(F.Z,{label:"",type:"textarea",name:"sr-gift-msg",id:"sr-gift-msg",value:e.giftMsgText,onInput:l=>{l.stopPropagation(),e.setGiftMsgText(l.target.value)},maxLength:255,showCount:!0,autoSize:{maxRows:2}}),(0,P.jsx)("button",{type:"button",className:"OrderSummary_saveGiftMsgBtn__0FXbx",onClick:()=>{e.addRemoveGiftNote(e.giftMsgText,"ADD")},disabled:!(null!==(o=e.giftMsgText)&&void 0!==o&&o.trim())||e.giftMsgLoading,children:"Save"})]})]})},L=e=>{var l,i,n,t,a,s,c,v,m,p,A,S,D,F,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce,ve,me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe,je,Fe,Re,Le,Oe,Me,Ue,Ze,Be,He,Ve,Ge,We,qe,ze,Ye,Qe,Je,Ke,$e,Xe,el,ll,il,nl,tl,ol,al,dl,rl,sl,ul,cl,vl,ml,gl,pl,hl,yl,fl,_l,Cl,xl,bl,Al,El,Sl,Dl,wl,Nl,Il,kl,Tl,Pl,jl,Fl,Rl,Ll,Ol;const Ml=(0,w.v9)((e=>e.Login)),Ul=(0,w.v9)((e=>e.Address)),Zl=(0,w.v9)((e=>e.Cart)),Bl=(0,w.v9)((e=>e.Coupon)),Hl=(0,w.v9)((e=>e.Shipping)),Vl=(0,w.v9)((e=>e.Otp)),Gl=window.location.search;new URLSearchParams(Gl);const Wl=null!==(l=null===(i=Ml.sellerConfig)||void 0===i||null===(n=i.giftWrapDetails)||void 0===n?void 0:n.txt)&&void 0!==l?l:null,ql=e=>(null==e?void 0:e.length)>20?"".concat(null==e?void 0:e.slice(0,20),"..."):e,zl=null!=Zl&&null!==(t=Zl.orderDetails)&&void 0!==t&&null!==(a=t.lineItems)&&void 0!==a&&a.length&&Ul.selectedAddress?null==Zl||null===(s=Zl.orderDetails)||void 0===s||null===(c=s.lineItems)||void 0===c?void 0:c.reduce(((e,l)=>e+l.quantity),0):(null==Zl||null===(v=Zl.Cart_data)||void 0===v||null===(m=v.items)||void 0===m?void 0:m.reduce(((e,l)=>e+l.quantity),0))||(null==Zl||null===(p=Zl.initialCartData)||void 0===p?void 0:p.reduce(((e,l)=>e+l.quantity),0));return(0,P.jsxs)(k.Z,{open:e.orderSummaryModalVisible,title:(0,P.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,P.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,P.jsx)("div",{className:o,style:{color:"var(--drawer-text-color)"},children:"Order summary"}),(0,P.jsxs)("div",{className:"OrderSummary_labelCard__YzRQc",style:{color:"var(--drawer-text-color)"},children:["(",zl," Item",1===zl?"":"s",")"]})]}),!(null===(Yl=Ml.sellerConfig)||void 0===Yl||null===(Ql=Yl.giftWrapDetails)||void 0===Ql||!Ql.enabled||null===(Jl=Ml.sellerConfig)||void 0===Jl||null===(Kl=Jl.giftWrapDetails)||void 0===Kl||!Kl.variantId||Zl.orderPending||null!=Zl&&Zl.hasBundleProduct)&&(null===($l=Ml.sellerConfig)||void 0===$l||null===(Xl=$l.giftWrapDetails)||void 0===Xl||!Xl.customGiftWrapCheck||!(null==Zl||null===(ei=Zl.Cart_data)||void 0===ei||null===(li=ei.cartAttributes)||void 0===li||!li.gift_wrap_eligible))&&(e.giftWrapLoading||Bl.loader||Hl.serviceFetching||Ul.fetchingAllAddress||Zl.orderFetching?(0,P.jsx)("div",{className:"skeleton__text__small width30",style:{marginLeft:"16px",marginBottom:"12px"}}):(0,P.jsxs)("div",{className:C,onClick:e=>{e.stopPropagation()},children:[(0,P.jsx)("input",{id:"selectAllGift",type:"checkbox",onChange:l=>{e.giftWrapLoading||Bl.loader||Hl.serviceFetching||Ul.fetchingAllAddress||Zl.orderFetching||(l.target.checked?e.GiftWrap("ALL","APPLY"):e.GiftWrap("ALL","REMOVE"))},disabled:null==Hl?void 0:Hl.orderBlock,style:{accentColor:"var(--primary-color)",marginTop:"4px",cursor:"pointer"},checked:e.checkIfAllGiftWrap()}),Wl?(0,P.jsxs)("h3",{className:b,style:{color:"var(--drawer-text-color)"},children:[Wl," ₹",e.getPriceForGiftWrap()]}):e.checkIfAllGiftWrap()?(0,P.jsxs)("h3",{className:b,style:{color:"var(--drawer-text-color)"},children:["Your order is gift wrapped at ₹",e.getPriceForGiftWrap()]}):(0,P.jsxs)("h3",{className:b,style:{color:"var(--drawer-text-color)"},children:["Select all for gift wrapping at ₹",e.getPriceForGiftWrap()]})]}))]}),onClose:()=>{var l,i;N.Z.orderSummaryCollapsed(),N.Z.additionalEvents("order-summary-collapsed",null==Zl?void 0:Zl.Cart_data,Bl.couponCode,!!I.y.getItem("refreshToken"),!1),e.setOrderSummaryModalVisible(!1),e.setIsGiftMsgBoxOpen(!1),null!=Zl&&null!==(l=Zl.Cart_data)&&void 0!==l&&null!==(i=l.cartAttributes)&&void 0!==i&&i.gift_text||e.setGiftMsgText("")},showClose:!0,children:[(0,P.jsx)("div",{style:{transition:"all .5s",paddingTop:e.checkIfAnyGiftWrap()?"10px":""},children:(null==Zl||null===(A=Zl.orderDetails)||void 0===A||null===(S=A.lineItems)||void 0===S?void 0:S.length)>0&&Ul.selectedAddress||null!=Ml&&null!==(D=Ml.sellerConfig)&&void 0!==D&&D.enabledFeatureCodForm&&(null==Vl||!Vl.verified)&&Zl.orderFetched&&(null==Hl||!Hl.orderBlock)?null==Zl||null===(F=Zl.orderDetails)||void 0===F||null===(L=F.lineItems)||void 0===L?void 0:L.map(((l,i)=>{var n,t,o,a,d,r,s,c,v,m,p,x,A,S,D,w,N,I,k,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de;return(0,P.jsxs)("div",{style:{overflow:"visible",position:"relative"},children:[(null==l||null===(n=l.customAttributes)||void 0===n?void 0:n.gift_wrap)&&(0,P.jsx)("img",{src:"/assets/images/svg/gift-ribbon.svg",style:{zIndex:"10",position:"absolute",top:"-4px",right:"-6px",transform:"rotate(45deg)"},width:24}),(0,P.jsx)("div",{className:h,style:{background:null==l||null===(t=l.customAttributes)||void 0===t||!t.freebie||null!=l&&null!==(o=l.customAttributes)&&void 0!==o&&o.prepaidFreebie?null!=l&&null!==(a=l.customAttributes)&&void 0!==a&&a.freebie&&null!=l&&null!==(d=l.customAttributes)&&void 0!==d&&d.prepaidFreebie?"linear-gradient(88.49deg, #FFFFFF 30.57%, #DEFFE2 78.28%)":null!=l&&null!==(r=l.customAttributes)&&void 0!==r&&r.gift_wrap?"linear-gradient(93.08deg, #FFF8F7 34.26%, #FFFFFF 100%)":"":"linear-gradient(87.87deg, #FFFFFF 0.98%, #EDF2FC 99.48%)",border:null!=l&&null!==(s=l.customAttributes)&&void 0!==s&&s.gift_wrap?"1px solid #DDAF6A":""},children:(0,P.jsxs)("div",{className:"d-flex ml-15",style:{width:null!==(c=Ml.sellerConfig)&&void 0!==c&&c.editQuantityEnabled?"100%":""},children:[(0,P.jsx)("div",{className:u,children:"myxtur.com"===Ml.sellerConfig.domainName?(0,P.jsx)("img",{src:null!==(v=null==l||null===(m=l.customAttributes)||void 0===m?void 0:m.image)&&void 0!==v?v:null==l?void 0:l.imageUrl,alt:null==l?void 0:l.name}):(0,P.jsx)("img",{src:null==l?void 0:l.imageUrl,alt:null==l?void 0:l.name})}),(0,P.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,P.jsxs)("div",{className:g,children:[(0,P.jsx)("div",{className:y,children:null==l?void 0:l.name}),"everlasting.shop"===(null==Ml||null===(p=Ml.sellerConfig)||void 0===p?void 0:p.domainName)&&(null==l?void 0:l.customAttributes)&&(0,P.jsx)("div",{className:y,children:Object.keys(null==l?void 0:l.customAttributes).map(((e,i)=>"For COD orders team will ask you for an advance payment of INR 200"!==e&&"contentId"!==e?"".concat(null==l?void 0:l.customAttributes[e]," / "):""))}),"etchcraftemporium.in"===(null==Ml||null===(x=Ml.sellerConfig)||void 0===x?void 0:x.domainName)&&(null==l||null===(A=l.item_meta_data)||void 0===A?void 0:A.properties)&&Object.keys(null==l||null===(S=l.item_meta_data)||void 0===S?void 0:S.properties).map(((e,i)=>{var n;return(0,P.jsx)("div",{className:y,children:"".concat(e,': "').concat(null==l||null===(n=l.item_meta_data)||void 0===n?void 0:n.properties[e],'"')})})),(!(null!==(D=Ml.sellerConfig)&&void 0!==D&&D.editQuantityEnabled)||(null==Zl?void 0:Zl.hasBundleProduct))&&(0,P.jsxs)("div",{className:f,children:["Qty: ",null==l?void 0:l.quantity]}),(null==Hl||null===(w=Hl.selected_service_data)||void 0===w||null===(N=w.nonDeliverableItems)||void 0===N?void 0:N.find((e=>(null==e?void 0:e.variantId)==(null==l?void 0:l.itemId))))&&(0,P.jsx)(T.Z,{type:"error",alertMessage:"Product unavailable at selected pincode"}),(0,P.jsxs)("div",{className:_,children:[l.price>0&&(null===(I=l.customAttributes)||void 0===I||!I.freebie)?"₹".concat(null==l||null===(k=l.price)||void 0===k?void 0:k.toFixed(2)):(0,P.jsx)("span",{style:{color:"#238017",marginLeft:"3px"},children:"FREE"}),!(null!=l&&null!==(F=l.customAttributes)&&void 0!==F&&F.freebie)&&(null===(R=Ml.sellerConfig)||void 0===R?void 0:R.showCompareAtPrice)&&(null==l?void 0:l.compareAtPrice)>(null==l?void 0:l.price)&&(0,P.jsxs)("span",{style:{fontWeight:400,color:"#909090",textDecoration:"line-through",marginLeft:"4px"},children:["₹",null==l||null===(L=l.compareAtPrice)||void 0===L?void 0:L.toFixed(2)]})]}),(null===(O=Ml.sellerConfig)||void 0===O||null===(M=O.giftWrapDetails)||void 0===M?void 0:M.enabled)&&(null===(U=Ml.sellerConfig)||void 0===U||null===(Z=U.giftWrapDetails)||void 0===Z?void 0:Z.variantId)&&String(null===(B=Ml.sellerConfig)||void 0===B||null===(H=B.giftWrapDetails)||void 0===H?void 0:H.variantId)!==String(l.itemId)&&!Zl.orderPending&&!(null!=Ml&&null!==(V=Ml.sellerConfig)&&void 0!==V&&null!==(G=V.giftWrapDetails)&&void 0!==G&&G.singleGiftWrap)&&!Zl.hasBundleProduct&&(e.giftWrapLoading||Bl.loader||Hl.serviceFetching||Ul.fetchingAllAddress||Zl.orderFetching||null!=l&&null!==(W=l.customAttributes)&&void 0!==W&&W.freebie||null!=l&&null!==(q=l.customAttributes)&&void 0!==q&&q.is_add_on?!(null!=l&&null!==(K=l.customAttributes)&&void 0!==K&&K.freebie)&&!(null!=l&&null!==($=l.customAttributes)&&void 0!==$&&$.is_add_on)&&(0,P.jsx)("div",{className:"skeleton__text__small",style:{width:"100px"}}):(0,P.jsxs)("div",{style:{marginTop:"4px"},className:C,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)("input",{id:"selectGift",type:"checkbox",onChange:i=>{e.giftWrapLoading||Bl.loader||Hl.serviceFetching||Ul.fetchingAllAddress||Zl.orderFetching||(i.target.checked?e.GiftWrap("PRODUCT","APPLY",l.itemId):e.GiftWrap("PRODUCT","REMOVE",l.itemId))},disabled:null==Hl?void 0:Hl.orderBlock,style:{accentColor:"var(--primary-color)",cursor:"pointer"},checked:!(null==l||null===(z=l.customAttributes)||void 0===z||!z.gift_wrap)}),(0,P.jsxs)("h3",{className:b,style:{marginTop:"0px"},children:[Wl||"Gift wrap at"," ₹",null===(Y=l.quantity*(null===(Q=Ml.sellerConfig)||void 0===Q||null===(J=Q.giftWrapDetails)||void 0===J?void 0:J.price))||void 0===Y?void 0:Y.toFixed(2)]})]})),null==l||null===(X=l.customAttributes)||void 0===X||!X.freebie||null!=l&&null!==(ee=l.customAttributes)&&void 0!==ee&&ee.prepaidFreebie?null!=l&&null!==(le=l.customAttributes)&&void 0!==le&&le.freebie&&null!=l&&null!==(ie=l.customAttributes)&&void 0!==ie&&ie.prepaidFreebie?(0,P.jsxs)("div",{className:E,style:{background:"linear-gradient(90.34deg, rgba(255, 255, 255, 0.4026) 4.48%, rgba(193, 255, 199, 0.61) 89.76%)"},children:[(0,P.jsx)("img",{src:"assets/images/gift.gif",alt:"gift gif",height:30,style:{marginLeft:"-8px"}}),"Prepaid Exclusive Gift"]}):null:(0,P.jsxs)("div",{className:E,style:{background:"linear-gradient(90.34deg, rgba(255, 255, 255, 0.4026) 20.11%, rgba(230, 239, 255, 0.61) 76.33%)"},children:[(0,P.jsx)("img",{src:"assets/images/gift.gif",alt:"gift gif",height:30,style:{marginLeft:"-8px"}}),"Free Gift"]})]}),(null===(ne=Ml.sellerConfig)||void 0===ne?void 0:ne.editQuantityEnabled)&&String(null===(te=Ml.sellerConfig)||void 0===te||null===(oe=te.giftWrapDetails)||void 0===oe?void 0:oe.variantId)!==String(l.itemId)&&!Zl.orderPending&&!(null!=l&&null!==(ae=l.customAttributes)&&void 0!==ae&&ae.freebie)&&!(null!=Zl&&Zl.hasBundleProduct)&&!(null!=l&&null!==(de=l.customAttributes)&&void 0!==de&&de.is_add_on)&&(null==l?void 0:l.price)>0&&(0,P.jsx)(j,{item:l,modifyCart:e.modifyCart,setShowRemoveItemModal:e.setShowRemoveItemModal,setCurrentQtyModifyingItem:e.setCurrentQtyModifyingItem})]})]})},i)]})})):(null==Ml?void 0:Ml.cartItems)&&(null==Ml||null===(O=Ml.cartItems)||void 0===O?void 0:O.map(((l,i)=>{var n,t,o,a,d,r,s,c,v,m,p,b,A,S,D,w,N,I,k,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe;return(0,P.jsxs)("div",{style:{overflow:"visible",position:"relative"},children:[(null==l||null===(n=l.customAttributes)||void 0===n?void 0:n.gift_wrap)&&(0,P.jsx)("img",{src:"/assets/images/svg/gift-ribbon.svg",style:{zIndex:"10",position:"absolute",top:"-6px",right:"-6px",transform:"rotate(45deg)"},width:24}),(0,P.jsx)("div",{className:h,style:{background:null==l||null===(t=l.customAttributes)||void 0===t||!t.freebie||null!=l&&null!==(o=l.customAttributes)&&void 0!==o&&o.prepaidFreebie?null!=l&&null!==(a=l.customAttributes)&&void 0!==a&&a.freebie&&null!=l&&null!==(d=l.customAttributes)&&void 0!==d&&d.prepaidFreebie?"linear-gradient(88.49deg, #FFFFFF 30.57%, #DEFFE2 78.28%)":null!=l&&null!==(r=l.customAttributes)&&void 0!==r&&r.gift_wrap?"linear-gradient(93.08deg, #FFF8F7 34.26%, #FFFFFF 100%)":"":"linear-gradient(87.87deg, #FFFFFF 0.98%, #EDF2FC 99.48%)",border:null!=l&&null!==(s=l.customAttributes)&&void 0!==s&&s.gift_wrap?"1px solid #DDAF6A":""},children:(0,P.jsxs)("div",{className:"d-flex ml-15",style:{width:null!==(c=Ml.sellerConfig)&&void 0!==c&&c.editQuantityEnabled?"100%":""},children:[(0,P.jsx)("div",{className:u,children:(0,P.jsx)("img",{src:(null==l?void 0:l.image)||(null==l?void 0:l.imageUrl),alt:null==l?void 0:l.name})}),(0,P.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,P.jsxs)("div",{className:g,children:[(0,P.jsx)("div",{className:y,children:(null==l?void 0:l.title)||(null==l?void 0:l.name)}),"everlasting.shop"===(null==Ml||null===(v=Ml.sellerConfig)||void 0===v?void 0:v.domainName)&&(null==l?void 0:l.customAttributes)&&(0,P.jsx)("div",{className:y,children:Object.keys(null==l?void 0:l.customAttributes).map(((e,i)=>"For COD orders team will ask you for an advance payment of INR 200"!==e?"".concat(null==l?void 0:l.customAttributes[e]," / "):""))}),"etchcraftemporium.in"===(null==Ml||null===(m=Ml.sellerConfig)||void 0===m?void 0:m.domainName)&&(null==l||null===(p=l.item_meta_data)||void 0===p?void 0:p.properties)&&Object.keys(null==l||null===(b=l.item_meta_data)||void 0===b?void 0:b.properties).map(((e,i)=>{var n;return(0,P.jsx)("div",{className:y,children:"".concat(e,': "').concat(null==l||null===(n=l.item_meta_data)||void 0===n?void 0:n.properties[e],'"')})})),!(null!==(A=Ml.sellerConfig)&&void 0!==A&&A.editQuantityEnabled)&&(0,P.jsxs)("div",{className:f,children:["Qty: ",null==l?void 0:l.quantity]}),(null==Hl||null===(S=Hl.selected_service_data)||void 0===S||null===(D=S.nonDeliverableItems)||void 0===D?void 0:D.find((e=>(null==e?void 0:e.variantId)==(null==l?void 0:l.itemId))))&&(0,P.jsx)(T.Z,{type:"error",alertMessage:"Product unavailable at selected pincode"}),(0,P.jsxs)("div",{className:_,children:[l.price>0&&(null===(w=l.customAttributes)||void 0===w||!w.freebie)?"₹".concat(null==l||null===(N=l.price)||void 0===N?void 0:N.toFixed(2)):(0,P.jsx)("span",{style:{color:"#238017",marginLeft:"3px"},children:"FREE"}),!(null!=l&&null!==(I=l.customAttributes)&&void 0!==I&&I.freebie)&&(null===(k=Ml.sellerConfig)||void 0===k?void 0:k.showCompareAtPrice)&&(null==l?void 0:l.compareAtPrice)>(null==l?void 0:l.price)&&(0,P.jsxs)("span",{style:{fontWeight:400,color:"#909090",textDecoration:"line-through",marginLeft:"4px"},children:["₹",null==l||null===(F=l.compareAtPrice)||void 0===F?void 0:F.toFixed(2)]})]}),(null===(R=Ml.sellerConfig)||void 0===R||null===(L=R.giftWrapDetails)||void 0===L?void 0:L.enabled)&&(null===(O=Ml.sellerConfig)||void 0===O||null===(M=O.giftWrapDetails)||void 0===M?void 0:M.variantId)&&String(null===(U=Ml.sellerConfig)||void 0===U||null===(Z=U.giftWrapDetails)||void 0===Z?void 0:Z.variantId)!==String(l.itemId)&&!Zl.orderPending&&!(null!=Ml&&null!==(B=Ml.sellerConfig)&&void 0!==B&&null!==(H=B.giftWrapDetails)&&void 0!==H&&H.singleGiftWrap)&&!Zl.hasBundleProduct&&(e.giftWrapLoading||Bl.loader||Hl.serviceFetching||Ul.fetchingAllAddress||Zl.orderFetching||null!=l&&null!==(V=l.customAttributes)&&void 0!==V&&V.freebie||null!=l&&null!==(G=l.customAttributes)&&void 0!==G&&G.is_add_on?!(null!=l&&null!==(Q=l.customAttributes)&&void 0!==Q&&Q.freebie)&&!(null!=l&&null!==(J=l.customAttributes)&&void 0!==J&&J.is_add_on)&&(0,P.jsx)("div",{className:"skeleton__text__small",style:{width:"100px"}}):(0,P.jsxs)("div",{style:{marginTop:"4px"},className:C,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)("input",{id:"selectGift",type:"checkbox",onChange:i=>{e.giftWrapLoading||Bl.loader||Hl.serviceFetching||Ul.fetchingAllAddress||Zl.orderFetching||(i.target.checked?e.GiftWrap("PRODUCT","APPLY",l.itemId):e.GiftWrap("PRODUCT","REMOVE",l.itemId))},disabled:null==Hl?void 0:Hl.orderBlock,style:{accentColor:"var(--primary-color)",cursor:"pointer"},checked:!(null==l||null===(W=l.customAttributes)||void 0===W||!W.gift_wrap)}),(0,P.jsxs)("h3",{className:x,style:{marginTop:"0px"},children:[Wl||"Gift wrap at"," ₹",null===(q=l.quantity*(null===(z=Ml.sellerConfig)||void 0===z||null===(Y=z.giftWrapDetails)||void 0===Y?void 0:Y.price))||void 0===q?void 0:q.toFixed(2)]})]})),null==l||null===(K=l.customAttributes)||void 0===K||!K.freebie||null!=l&&null!==($=l.customAttributes)&&void 0!==$&&$.prepaidFreebie?null!=l&&null!==(X=l.customAttributes)&&void 0!==X&&X.freebie&&null!=l&&null!==(ee=l.customAttributes)&&void 0!==ee&&ee.prepaidFreebie?(0,P.jsxs)("div",{className:E,style:{background:"linear-gradient(90.34deg, rgba(255, 255, 255, 0.4026) 4.48%, rgba(193, 255, 199, 0.61) 89.76%)"},children:[(0,P.jsx)("img",{src:"assets/images/gift.gif",alt:"gift gif",height:30,style:{marginLeft:"-8px"}}),"Prepaid Exclusive Gift"]}):null:(0,P.jsxs)("div",{className:E,style:{background:"linear-gradient(90.34deg, rgba(255, 255, 255, 0.4026) 20.11%, rgba(230, 239, 255, 0.61) 76.33%)"},children:[(0,P.jsx)("img",{src:"assets/images/gift.gif",alt:"gift gif",height:30,style:{marginLeft:"-8px"}}),"Free Gift"]})]}),(null===(le=Ml.sellerConfig)||void 0===le?void 0:le.editQuantityEnabled)&&String(null===(ie=Ml.sellerConfig)||void 0===ie||null===(ne=ie.giftWrapDetails)||void 0===ne?void 0:ne.variantId)!==String(l.itemId)&&!Zl.orderPending&&!(null!=l&&null!==(te=l.customAttributes)&&void 0!==te&&te.freebie)&&!(null!=Zl&&Zl.hasBundleProduct)&&!(null!=l&&null!==(oe=l.customAttributes)&&void 0!==oe&&oe.is_add_on)&&(null==l?void 0:l.price)>0&&(0,P.jsx)(j,{item:l,modifyCart:e.modifyCart,setShowRemoveItemModal:e.setShowRemoveItemModal,setCurrentQtyModifyingItem:e.setCurrentQtyModifyingItem})]})]})},i)]})})))}),(null===(M=Ml.sellerConfig)||void 0===M||null===(U=M.giftWrapDetails)||void 0===U?void 0:U.allowGiftMessage)&&e.checkIfAnyGiftWrap()&&(0,P.jsx)(R,{giftMsgText:e.giftMsgText,setGiftMsgText:e.setGiftMsgText,addRemoveGiftNote:e.addRemoveGiftNote,setShowRemoveGiftMsgModal:e.setShowRemoveGiftMsgModal,isGiftMsgBoxOpen:e.isGiftMsgBoxOpen,setIsGiftMsgBoxOpen:e.setIsGiftMsgBoxOpen,giftMsgLoading:e.giftMsgLoading}),(0,P.jsx)("div",{className:"OrderSummary_subHeading__uK9Cg",children:"Bill summary"}),null!==(Z=Zl.orderDetails)&&void 0!==Z&&Z.totalPrice||null!==(B=Zl.Cart_data)&&void 0!==B&&B.totalPrice?(0,P.jsxs)("div",{className:r,children:[(0,P.jsxs)("div",{children:["Sub total","arabianaroma.co.in"===(null==Ml||null===(H=Ml.sellerConfig)||void 0===H?void 0:H.domainName)||"arabianaroma.in"===(null==Ml||null===(V=Ml.sellerConfig)||void 0===V?void 0:V.domainName)?(0,P.jsx)("span",{children:"  (incl. of all taxes)"}):""]}),(0,P.jsxs)("div",{children:["₹",null!=Ml&&null!==(G=Ml.sellerConfig)&&void 0!==G&&G.showCompareAtPrice&&null!=e&&e.isOrderMRPGreater?Number(null!==(W=Zl.orderDetails)&&void 0!==W&&W.totalPrice?null==e?void 0:e.totalOrderDetailsMRP:null==e?void 0:e.totalCartDetailsMRP).toFixed(2):Number(null!==(q=Zl.orderDetails)&&void 0!==q&&q.totalPrice?null===(z=Zl.orderDetails)||void 0===z?void 0:z.totalPrice:null===(Y=Zl.Cart_data)||void 0===Y?void 0:Y.totalPrice).toFixed(2)]})]}):null,(!(null!==(Q=Zl.orderDetails)&&void 0!==Q&&Q.id)||null===Ul.selectedAddress)&&!(null!=Ml&&null!==(J=Ml.sellerConfig)&&void 0!==J&&J.enabledFeatureCodForm&&(null==Vl||!Vl.verified)&&Zl.orderFetched&&(null==Hl||!Hl.orderBlock))&&!(null!==(K=Ml.sellerConfig)&&void 0!==K&&K.nativeShopifyCheckout)&&(0,P.jsxs)(P.Fragment,{children:[(null===($=Ml.sellerConfig)||void 0===$?void 0:$.taxInOrderSummary)&&(null===(X=Zl.Cart_data)||void 0===X?void 0:X.totalTax)>0&&(0,P.jsxs)("div",{className:r,children:[(0,P.jsx)("div",{children:"Tax"}),(0,P.jsxs)("div",{children:["₹",null===(ee=Zl.Cart_data)||void 0===ee||null===(le=ee.totalTax)||void 0===le?void 0:le.toFixed(2)]})]}),(null==Ml||null===(ie=Ml.sellerConfig)||void 0===ie?void 0:ie.showCompareAtPrice)&&(null==e?void 0:e.isOrderMRPGreater)&&(0,P.jsxs)("div",{className:r,style:{color:"#238017"},children:[(0,P.jsx)("div",{children:"Discount on MRP"}),(0,P.jsxs)("div",{children:["- ₹ ",Number(null!==(ne=Zl.orderDetails)&&void 0!==ne&&ne.totalPrice?(null==e?void 0:e.totalOrderDetailsMRP)-(null===(te=Zl.orderDetails)||void 0===te?void 0:te.totalPrice):(null==e?void 0:e.totalCartDetailsMRP)-(null===(oe=Zl.Cart_data)||void 0===oe?void 0:oe.totalPrice)).toFixed(2)]})]}),(null===(ae=Zl.Cart_data)||void 0===ae||null===(de=ae.discountDetail)||void 0===de||null===(re=de.discount_data)||void 0===re||null===(se=re.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===se?void 0:se.length)>0&&(null===(ue=Zl.Cart_data)||void 0===ue||null===(ce=ue.discountDetail)||void 0===ce||null===(ve=ce.discount_data)||void 0===ve||null===(me=ve.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===me?void 0:me.map((e=>{var l;return(0,P.jsxs)("div",{className:r,style:{color:"#238017"},children:[(0,P.jsxs)("div",{children:["Coupon discount (",ql(null==e?void 0:e.discount_code),")"]}),(0,P.jsxs)("div",{style:{color:"#238017"},children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),(null===(ge=Zl.Cart_data)||void 0===ge||null===(pe=ge.discountDetail)||void 0===pe||null===(he=pe.discount_data)||void 0===he||null===(ye=he.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===ye?void 0:ye.length)>0&&(null===(fe=Zl.Cart_data)||void 0===fe||null===(_e=fe.discountDetail)||void 0===_e||null===(Ce=_e.discount_data)||void 0===Ce||null===(xe=Ce.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===xe?void 0:xe.map((e=>{var l;return(0,P.jsxs)("div",{className:r,style:{color:"#238017"},children:[(0,P.jsxs)("div",{children:["Auto discount",(null==e?void 0:e.discount_code)&&" (".concat(null==e?void 0:e.discount_code,")")]}),(0,P.jsxs)("div",{style:{color:"#238017"},children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})})))]}),(null===(be=Zl.orderDetails)||void 0===be?void 0:be.id)&&((null==Ul?void 0:Ul.selectedAddress)||(null==Ml||null===(Ae=Ml.sellerConfig)||void 0===Ae?void 0:Ae.enabledFeatureCodForm)&&!(null!=Vl&&Vl.verified)&&Zl.orderFetched&&!(null!=Hl&&Hl.orderBlock))&&!(null!==(Ee=Ml.sellerConfig)&&void 0!==Ee&&Ee.nativeShopifyCheckout)&&(0,P.jsxs)(P.Fragment,{children:[(null===(Se=Ml.sellerConfig)||void 0===Se?void 0:Se.taxInOrderSummary)&&(null===(De=Zl.orderDetails)||void 0===De?void 0:De.totalTax)>0&&(0,P.jsxs)("div",{className:r,children:[(0,P.jsx)("div",{children:"Tax"}),(0,P.jsxs)("div",{children:["₹",null===(we=Zl.orderDetails)||void 0===we||null===(Ne=we.totalTax)||void 0===Ne?void 0:Ne.toFixed(2)]})]}),(null==Ml||null===(Ie=Ml.sellerConfig)||void 0===Ie?void 0:Ie.showCompareAtPrice)&&(null==e?void 0:e.isOrderMRPGreater)&&(0,P.jsxs)("div",{className:r,style:{color:"#238017"},children:[(0,P.jsx)("div",{children:"Discount on MRP"}),(0,P.jsxs)("div",{children:["- ₹ ",Number(null!==(ke=Zl.orderDetails)&&void 0!==ke&&ke.totalPrice?(null==e?void 0:e.totalOrderDetailsMRP)-(null===(Te=Zl.orderDetails)||void 0===Te?void 0:Te.totalPrice):(null==e?void 0:e.totalCartDetailsMRP)-(null===(Pe=Zl.Cart_data)||void 0===Pe?void 0:Pe.totalPrice)).toFixed(2)]})]}),(null===(je=Zl.orderDetails)||void 0===je||null===(Fe=je.discountDetail)||void 0===Fe||null===(Re=Fe.discount_data)||void 0===Re||null===(Le=Re.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===Le?void 0:Le.length)>0&&(null===(Oe=Zl.orderDetails)||void 0===Oe||null===(Me=Oe.discountDetail)||void 0===Me||null===(Ue=Me.discount_data)||void 0===Ue||null===(Ze=Ue.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===Ze?void 0:Ze.map((e=>{var l;return(0,P.jsxs)("div",{className:r,style:{color:"#238017"},children:[(0,P.jsxs)("div",{children:["Coupon discount (",ql(null==e?void 0:e.discount_code),")"]}),(0,P.jsxs)("div",{style:{color:"#238017"},children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),(null===(Be=Zl.orderDetails)||void 0===Be||null===(He=Be.discountDetail)||void 0===He||null===(Ve=He.discount_data)||void 0===Ve||null===(Ge=Ve.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Ge?void 0:Ge.length)>0&&(null===(We=Zl.orderDetails)||void 0===We||null===(qe=We.discountDetail)||void 0===qe||null===(ze=qe.discount_data)||void 0===ze||null===(Ye=ze.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Ye?void 0:Ye.map((e=>{var l;return(0,P.jsxs)("div",{className:r,style:{color:"#238017"},children:[(0,P.jsxs)("div",{children:["Auto discount",(null==e?void 0:e.discount_code)&&" (".concat(null==e?void 0:e.discount_code,")")]}),(0,P.jsxs)("div",{style:{color:"#238017"},children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),"APPLIED"===(null===(Qe=Zl.loyaltyPointDetails)||void 0===Qe?void 0:Qe.status)&&(null===(Je=Zl.loyaltyPointDetails)||void 0===Je?void 0:Je.applicable_credits)>0&&(0,P.jsxs)("div",{style:{paddingLeft:"0px",paddingRight:"0px",color:"#238017"},className:d,children:[null!=Ml&&null!==(Ke=Ml.sellerConfig)&&void 0!==Ke&&Ke.gyftrrEnabled?(0,P.jsx)("div",{children:"Gift voucher - ePay"}):(0,P.jsx)("div",{children:"Rewards & Loyalty Points"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null===($e=Zl.loyaltyPointDetails)||void 0===$e||null===(Xe=$e.applicable_credits)||void 0===Xe?void 0:Xe.toFixed(2)]})]}),"APPLIED"===(null===(el=Zl.giftVoucherDetails)||void 0===el||null===(ll=el.EASYREWARD)||void 0===ll||null===(il=ll.status)||void 0===il?void 0:il.toUpperCase())&&(0,P.jsxs)("div",{style:{paddingLeft:"0px",color:"#238017",paddingRight:"0px"},className:d,children:[(0,P.jsx)("div",{children:"Gift Card"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null===(nl=Zl.giftVoucherDetails)||void 0===nl||null===(tl=nl.EASYREWARD)||void 0===tl?void 0:tl.amount_redeemed.toFixed(2)]})]}),"APPLIED"===(null===(ol=Zl.giftVoucherDetails)||void 0===ol||null===(al=ol.SHOPIFY)||void 0===al||null===(dl=al.status)||void 0===dl?void 0:dl.toUpperCase())&&(0,P.jsxs)("div",{style:{paddingLeft:"0px",color:"#238017",paddingRight:"0px"},className:d,children:[(0,P.jsx)("div",{children:"Gift Card"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null===(rl=Zl.giftVoucherDetails)||void 0===rl||null===(sl=rl.SHOPIFY)||void 0===sl?void 0:sl.amount_redeemed.toFixed(2)]})]})]}),"COD"===Ul.selectedPaymentMode&&(null===(ul=Zl.orderDetails)||void 0===ul?void 0:ul.codCharges)>0?(0,P.jsxs)("div",{className:r,children:[(0,P.jsx)("div",{children:"COD charges"}),(0,P.jsxs)("div",{children:["₹",null===(cl=Zl.orderDetails)||void 0===cl||null===(vl=cl.codCharges)||void 0===vl?void 0:vl.toFixed(2)]})]}):null,null==Zl||null===(ml=Zl.orderDetails)||void 0===ml||!ml.shippingCharges||!Ul.selectedAddress&&(null==Ml||null===(gl=Ml.sellerConfig)||void 0===gl||!gl.enabledFeatureCodForm||null!=Vl&&Vl.verified||!Zl.orderFetched||null!=Hl&&Hl.orderBlock)?null:(0,P.jsxs)("div",{className:r,children:[(0,P.jsx)("div",{children:"Delivery charges"}),(0,P.jsx)("div",{className:(null==Zl||null===(pl=Zl.orderDetails)||void 0===pl?void 0:pl.shippingCharges)<0?"ascent-green":"",children:(null==Zl||null===(hl=Zl.orderDetails)||void 0===hl?void 0:hl.shippingCharges)>0?(0,P.jsxs)(P.Fragment,{children:["₹",Number(null===(yl=Zl.orderDetails)||void 0===yl?void 0:yl.shippingCharges).toFixed(2)," "]}):"FREE"})]}),(null===(fl=Zl.orderDetails)||void 0===fl?void 0:fl.additionalCharge)>0&&(Ul.selectedAddress||(null==Ml||null===(_l=Ml.sellerConfig)||void 0===_l?void 0:_l.enabledFeatureCodForm)&&!(null!=Vl&&Vl.verified)&&Zl.orderFetched&&!(null!=Hl&&Hl.orderBlock))&&(0,P.jsxs)("div",{className:r,children:[(0,P.jsx)("div",{children:(null==Hl?void 0:Hl.additional_charge_text)||"Additional Charges"}),(0,P.jsxs)("div",{children:["₹",null===(Cl=Zl.orderDetails)||void 0===Cl||null===(xl=Cl.additionalCharge)||void 0===xl?void 0:xl.toFixed(2)]})]}),(0,P.jsxs)("div",{className:"OrderSummary_summaryTotalAmountCard__hqZm-",children:[(0,P.jsxs)("div",{children:["Total amount",null!==(bl=Zl.taxIncludedNoteSellers)&&void 0!==bl&&bl.includes(null===(Al=Ml.sellerConfig)||void 0===Al?void 0:Al.domainName)?" (incl. of all taxes)":""]}),Object.keys(Zl.orderDetails).length>0&&Ul.selectedAddress||null!=Ml&&null!==(El=Ml.sellerConfig)&&void 0!==El&&El.enabledFeatureCodForm&&(null==Vl||!Vl.verified)&&Zl.orderFetched&&(null==Hl||!Hl.orderBlock)?(0,P.jsxs)("div",{children:["₹","COD"===Ul.selectedPaymentMode?null===(Sl=Zl.orderDetails)||void 0===Sl||null===(Dl=Sl.codPrice)||void 0===Dl?void 0:Dl.toFixed(2):(null!==(wl=(null===(Nl=Zl.orderDetails)||void 0===Nl?void 0:Nl.totalAmount)+(null===(Il=Zl.orderDetails)||void 0===Il?void 0:Il.prepaidDiscount))&&void 0!==wl?wl:0).toFixed(2)]}):(0,P.jsxs)("div",{children:["₹",null!==(kl=Zl.Cart_data)&&void 0!==kl&&kl.totalDiscount?((null===(Tl=Zl.Cart_data)||void 0===Tl?void 0:Tl.totalPrice)-(null===(Pl=Zl.Cart_data)||void 0===Pl?void 0:Pl.totalDiscount)).toFixed(2):null!==(jl=Zl.Cart_data)&&void 0!==jl&&jl.totalPrice?null===(Fl=Zl.Cart_data)||void 0===Fl||null===(Rl=Fl.totalPrice)||void 0===Rl?void 0:Rl.toFixed(2):null==e?void 0:e.finalPriceLoginPage.toFixed(2)]})]}),(null==Hl||null===(Ll=Hl.selected_service_data)||void 0===Ll||null===(Ol=Ll.nonDeliverableItems)||void 0===Ol?void 0:Ol.length)&&!e.showItems&&!Ml.isProductPage&&(0,P.jsxs)("div",{style:{width:"90%",margin:"auto",display:"flex",flexDirection:"column",gap:"8px",textAlign:"center"},children:[(0,P.jsx)("span",{style:{fontWeight:"400",fontSize:"12px",lineHeight:"14px"},children:"You can continue checkout without that item"}),(0,P.jsx)("button",{className:"modal_button_blue full-width",onClick:()=>{e.isHeadless?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:"https://".concat(Ml.sellerConfig.domainName,"/")}}]},"*"):window.parent.postMessage({trigger:"headless-close"},"*")},style:{fontWeight:500,cursor:"pointer"},children:"Edit items in cart"})]})]});var Yl,Ql,Jl,Kl,$l,Xl,ei,li};var O=i(2718),M=i(7083),U=i(1902),Z=i(1805),B=i(8595),H=i(2855),V=i(9741);const G="styles_productName__4ybal",W="styles_productTitle__dO7YB",q=e=>{var l,i,n,t;const o=(0,w.v9)((e=>e.Cart)),a=(0,w.v9)((e=>e.Login)),d=null==o||null===(l=o.Cart_data)||void 0===l||null===(i=l.items)||void 0===i?void 0:i.filter((l=>{var i,n,t,o;return!(null!=l&&null!==(i=l.customAttributes)&&void 0!==i&&i.freebie)&&String(l.itemId)!==String(null===(n=a.sellerConfig)||void 0===n||null===(t=n.giftWrapDetails)||void 0===t?void 0:t.variantId)&&String(l.itemId)!==String(null===(o=e.currentQtyModifyingItem)||void 0===o?void 0:o.itemId)}));return(0,P.jsx)("div",{className:"styles_backDrop__e5WX1",onClick:()=>e.setShowRemoveItemModal(!1),children:(0,P.jsxs)("div",{className:"styles_modalCard__DPoSt",onClick:e=>{e.stopPropagation()},children:[null!=d&&d.length?(0,P.jsxs)("div",{className:W,children:["Are you sure you want to remove",(0,P.jsxs)("span",{className:G,children:[" ",null===(n=e.currentQtyModifyingItem)||void 0===n?void 0:n.name]}),"?"]}):(0,P.jsxs)("div",{className:W,children:["Removing",(0,P.jsxs)("span",{className:G,children:[" ",null===(t=e.currentQtyModifyingItem)||void 0===t?void 0:t.name]})," will exit checkout."]}),(0,P.jsxs)("div",{className:"styles_buttonContainer__48AYx",children:[(0,P.jsx)("button",{onClick:()=>{e.modifyCart({...e.currentQtyModifyingItem,quantity:e.currentQtyModifyingItem.quantity-1},"QTY"),e.setShowRemoveItemModal(!1)},className:"styles_removeItemBtn__KfUrV",children:null!=d&&d.length?"Remove item":"Remove item & exit"}),(0,P.jsx)("button",{className:"styles_continueBtn__xzZG-",onClick:()=>e.setShowRemoveItemModal(!1),style:{border:"1px solid var(--primary-color)"},children:"Continue checkout"})]})]})})};var z=i(8805);const Y=e=>(0,P.jsx)("div",{className:"OrderSummary_removeGiftMsgBackdrop__-ZsGT",onClick:()=>e.setShowRemoveGiftMsgModal(!1),children:(0,P.jsxs)("div",{className:"OrderSummary_modalCard__6b3lz",onClick:e=>{e.stopPropagation()},children:[(0,P.jsx)("div",{className:"OrderSummary_productTitle__wGWYS",children:"Are you sure you want to remove your gift note?"}),(0,P.jsxs)("div",{className:"OrderSummary_buttonContainer__xGzbB",children:[(0,P.jsx)("button",{onClick:()=>{e.addRemoveGiftNote("","REMOVE"),e.setShowRemoveGiftMsgModal(!1)},className:"OrderSummary_removeMsgBtn__j6Xpn",children:"Remove"}),(0,P.jsx)("button",{className:"OrderSummary_continueBtn__kYk56",onClick:()=>e.setShowRemoveGiftMsgModal(!1),style:{border:"1px solid var(--primary-color)"},children:"Keep Gift Note"})]})]})});var Q=i(8515);let J=new(i(1318))("","");const K=e=>{var l,i,r,h,y,f,_,b,E,S,k,F,G,W,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce,ve,me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe,je,Fe,Re,Le,Oe,Me,Ue,Ze,Be,He,Ve,Ge,We,qe,ze,Ye,Qe,Je,Ke,$e,Xe,el,ll,il,nl,tl,ol,al,dl,rl,sl,ul,cl,vl,ml,gl,pl,hl,yl,fl,_l,Cl,xl,bl,Al,El,Sl,Dl,wl,Nl,Il,kl,Tl,Pl,jl,Fl,Rl,Ll,Ol,Ml,Ul,Zl,Bl,Hl,Vl,Gl,Wl,ql,zl,Yl,Ql,Jl,Kl,$l,Xl,ei,li,ii,ni,ti,oi,ai,di,ri,si,ui,ci,vi,mi,gi,pi,hi,yi,fi,_i,Ci,xi,bi,Ai,Ei,Si,Di,wi,Ni,Ii,ki,Ti,Pi,ji,Fi,Ri,Li,Oi,Mi,Ui,Zi,Bi,Hi,Vi,Gi,Wi,qi,zi,Yi,Qi,Ji,Ki,$i,Xi,en,ln,nn,tn,on,an,dn,rn,sn,un,cn,vn,mn,gn,pn,hn,yn,fn,_n,Cn,xn,bn,An,En,Sn,Dn,wn,Nn,In;const kn=(0,w.I0)(),Tn=(0,w.v9)((e=>e.Login)),[Pn,jn]=(0,n.useState)(0),[Fn,Rn]=(0,n.useState)(0),Ln=(0,w.v9)((e=>e.Address)),On=(0,w.v9)((e=>e.Shipping)),Mn=(0,w.v9)((e=>e.Cart)),Un=(0,w.v9)((e=>e.Coupon)),[Zn,Bn]=(0,n.useState)(!1),Hn=(0,w.v9)((e=>e.Otp)),Vn=null!==(l=null===(i=Tn.sellerConfig)||void 0===i||null===(r=i.giftWrapDetails)||void 0===r?void 0:r.txt)&&void 0!==l?l:null,[Gn,Wn]=(0,n.useState)(!1),[qn,zn]=(0,n.useState)(!1),[Yn,Qn]=(0,n.useState)(!1),Jn=!(null===(h=Mn.itemImageObjectFitSellers)||void 0===h||!h.includes(Tn.sellerConfig.domainName)),Kn=window.location.search;let $n=new URLSearchParams(Kn),Xn=null!=$n.get("cartToken")?$n.get("cartToken"):null,et=null!=$n.get("application")?$n.get("application"):null;const lt=()=>{var e,l,i,n,t,o;let a=0;var d,r,s,u,c;return a=null!==(e=Mn.orderDetails)&&void 0!==e&&e.id?null==Mn||null===(d=Mn.orderDetails)||void 0===d||null===(r=d.lineItems)||void 0===r||null===(s=r.filter((e=>{var l,i,n,t;return!(String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on)})))||void 0===s?void 0:s.reduce(((e,l)=>e+l.quantity),0):null==Tn||null===(u=Tn.cartItems)||void 0===u||null===(c=u.filter((e=>{var l,i,n,t;return!(String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on)})))||void 0===c?void 0:c.reduce(((e,l)=>e+l.quantity),0),a>0&&null!=Tn&&null!==(l=Tn.sellerConfig)&&void 0!==l&&null!==(i=l.giftWrapDetails)&&void 0!==i&&i.singleGiftWrap&&(a=1),null===(n=a*(null===(t=Tn.sellerConfig)||void 0===t||null===(o=t.giftWrapDetails)||void 0===o?void 0:o.price))||void 0===n?void 0:n.toFixed(2)},it=async(l,i,n)=>{try{var t,o,a,d,r,s,u,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D;e.setGiftWrapLoading(!0);let Le=[],Oe=0;var w,N,I,k,T,P,j,F,R;if(Le="ALL"===l?(null!=Hn&&Hn.verified||null!=Tn&&Tn.userDetailsFetched||null!=Tn&&Tn.otpSkip)&&null!=Ln&&Ln.selectedAddress&&null!=Ln&&Ln.defaultAddressCorrect||null!=Tn&&null!==(w=Tn.sellerConfig)&&void 0!==w&&w.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock)?null===(N=Mn.orderDetails.lineItems)||void 0===N?void 0:N.map((e=>{var l,n,t,o;return String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(n=l.giftWrapDetails)||void 0===n?void 0:n.variantId)||null!==(t=e.customAttributes)&&void 0!==t&&t.freebie||null!=e&&null!==(o=e.customAttributes)&&void 0!==o&&o.is_add_on?e:{...e,customAttributes:{...e.customAttributes,gift_wrap:"APPLY"===i}}})):null===(I=Mn.Cart_data.items)||void 0===I?void 0:I.map((e=>{var l,n,t,o;return String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(n=l.giftWrapDetails)||void 0===n?void 0:n.variantId)||null!==(t=e.customAttributes)&&void 0!==t&&t.freebie||null!=e&&null!==(o=e.customAttributes)&&void 0!==o&&o.is_add_on?e:{...e,customAttributes:{...e.customAttributes,gift_wrap:"APPLY"===i}}})):(null!=Hn&&Hn.verified||null!=Tn&&Tn.userDetailsFetched||null!=Tn&&Tn.otpSkip)&&null!=Ln&&Ln.selectedAddress&&null!=Ln&&Ln.defaultAddressCorrect||null!=Tn&&null!==(k=Tn.sellerConfig)&&void 0!==k&&k.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock)?null===(T=Mn.orderDetails.lineItems)||void 0===T?void 0:T.map((e=>{var l,t;return String(e.itemId)!==String(n)||null!==(l=e.customAttributes)&&void 0!==l&&l.freebie||null!=e&&null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on?e:{...e,customAttributes:{...e.customAttributes,gift_wrap:"APPLY"===i}}})):null===(P=Mn.Cart_data.items)||void 0===P?void 0:P.map((e=>{var l,t;return String(e.itemId)!==String(n)||null!==(l=e.customAttributes)&&void 0!==l&&l.freebie||null!=e&&null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on?e:{...e,customAttributes:{...e.customAttributes,gift_wrap:"APPLY"===i}}})),Oe=Le.reduce(((e,l)=>{var i;return e+(null!=l&&null!==(i=l.customAttributes)&&void 0!==i&&i.gift_wrap?null==l?void 0:l.quantity:0)}),0),Oe>0&&null!=Tn&&null!==(t=Tn.sellerConfig)&&void 0!==t&&null!==(o=t.giftWrapDetails)&&void 0!==o&&o.singleGiftWrap&&(Oe=1),Oe>0)Le=(null===(j=Le.filter((e=>{var l,i;return String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)})))||void 0===j?void 0:j.length)>0?Le.map((e=>{var l,i;return String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)?{...e,quantity:Oe}:e})):[...Le,{itemId:null===(F=Tn.sellerConfig)||void 0===F||null===(R=F.giftWrapDetails)||void 0===R?void 0:R.variantId,quantity:Oe}];else Le=Le.filter((e=>{var l,i;return String(e.itemId)!==String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)}));let Me={items:Le,couponCode:(Ln.selectedAddress||null!=Tn&&null!==(a=Tn.sellerConfig)&&void 0!==a&&a.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock))&&(null===(d=Mn.orderDetails)||void 0===d||null===(r=d.discountDetail)||void 0===r||null===(s=r.discount_data)||void 0===s||null===(u=s.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===u?void 0:u.length)>0?null===(c=Mn.orderDetails)||void 0===c||null===(v=c.discountDetail)||void 0===v||null===(m=v.discount_data)||void 0===m||null===(g=m.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===g||null===(p=g[0])||void 0===p?void 0:p.discount_code:(null===(h=Mn.Cart_data)||void 0===h||null===(y=h.discountDetail)||void 0===y||null===(f=y.discount_data)||void 0===f||null===(_=f.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===_?void 0:_.length)>0?null===(C=Mn.Cart_data)||void 0===C||null===(x=C.discountDetail)||void 0===x||null===(b=x.discount_data)||void 0===b||null===(A=b.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===A||null===(E=A[0])||void 0===E?void 0:E.discount_code:"",channel:null==Mn||null===(S=Mn.platform)||void 0===S?void 0:S.toUpperCase(),...Tn.isProductPage&&{variant:!0},...Mn.smartCartSelectedFreebies&&{selectedFreebieItems:Mn.smartCartSelectedFreebies}};const Ue=await M.Z.put("".concat(O.Z.CREATE_CART_DETAILS(),"/").concat(null==Tn||null===(D=Tn.userInfo)||void 0===D?void 0:D.user_profile_id),Me,Tn.sellerConfig.seller_id);if(Ue){var L,Z;kn((0,B.y)(Tn.sellerConfig.seller_id));let l=Mn.shopifyCart,i=null===(L=Mn.Cart_data)||void 0===L?void 0:L.id;if(Mn.Cart_data=Ue.data,Mn.orderDetails.id&&(Ln.selectedAddress||null!=Tn&&null!==(Z=Tn.sellerConfig)&&void 0!==Z&&Z.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched)&&(null==On||!On.orderBlock)){var H,G,W,q,z,Y,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce,ve,me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe,je,Fe,Re;let e={userId:Tn.userInfo.user_id,paymentType:On.paymentMode,sellerId:Tn.sellerConfig.seller_id,shippingPlan:null==On||null===(H=On.selected_service_data)||void 0===H?void 0:H.pickrr_tag,shippingAddressId:null!==(G=null==Ln||null===(W=Ln.selectedAddress)||void 0===W?void 0:W.addressID)&&void 0!==G?G:"658eae861495e60037ef2642",orderId:Mn.orderDetails.id,isUpdateRequired:1,source:"mobile"===J.getResult().device.type?"M_WEB":"WEB",...null!=Mn&&null!==(q=Mn.activePayment)&&void 0!==q&&q.key&&Mn.activePaymentGateway?{payment:{paymentPlatform:Mn.activePaymentGateway.toUpperCase(),paymentMethod:Mn.activePaymentMode,paymentMode:"online"}}:{payment:null},...(null==Tn||null===(z=Tn.sellerConfig)||void 0===z?void 0:z.easyRewardsGiftVoucherEnabled)&&"APPLIED"===(null===(Y=Mn.giftVoucherDetails)||void 0===Y||null===(K=Y.EASYREWARD)||void 0===K||null===($=K.status)||void 0===$?void 0:$.toUpperCase())&&{giftVoucherRequest:{gvCode:"APPLIED"==(null===(X=Mn.giftVoucherDetails)||void 0===X||null===(ee=X.EASYREWARD)||void 0===ee?void 0:ee.status.toUpperCase())?null===(le=Mn.giftVoucherDetails)||void 0===le||null===(ie=le.EASYREWARD)||void 0===ie?void 0:ie.gv_code:null===(ne=Mn.giftVoucherDetails)||void 0===ne||null===(te=ne.EASYREWARD)||void 0===te?void 0:te.previously_used_gv,pin:null===(oe=Mn.giftVoucherDetails)||void 0===oe||null===(ae=oe.EASYREWARD)||void 0===ae?void 0:ae.pin,applyGiftVoucher:!1,amount:null===(de=Mn.giftVoucherDetails)||void 0===de||null===(re=de.EASYREWARD)||void 0===re?void 0:re.amount_redeemed,requestId:null===(se=Mn.giftVoucherDetails)||void 0===se||null===(ue=se.EASYREWARD)||void 0===ue?void 0:ue.request_id,giftVoucherProvider:"EASYREWARD"}},...(null==Tn||null===(ce=Tn.sellerConfig)||void 0===ce?void 0:ce.enableShopifyGiftCard)&&"APPLIED"===(null===(ve=Mn.giftVoucherDetails)||void 0===ve||null===(me=ve.status)||void 0===me||null===(ge=me.SHOPIFY)||void 0===ge?void 0:ge.toUpperCase())&&{giftVoucherRequest:{gvCode:"APPLIED"==(null===(pe=Mn.giftVoucherDetails)||void 0===pe||null===(he=pe.SHOPIFY)||void 0===he?void 0:he.status.toUpperCase())?null===(ye=Mn.giftVoucherDetails)||void 0===ye||null===(fe=ye.SHOPIFY)||void 0===fe?void 0:fe.gv_code:null===(_e=Mn.giftVoucherDetails)||void 0===_e||null===(Ce=_e.SHOPIFY)||void 0===Ce?void 0:Ce.previously_used_gv,applyGiftVoucher:!1,amount:null===(xe=Mn.giftVoucherDetails)||void 0===xe||null===(be=xe.SHOPIFY)||void 0===be?void 0:be.amount_redeemed,requestId:null===(Ae=Mn.giftVoucherDetails)||void 0===Ae||null===(Ee=Ae.SHOPIFY)||void 0===Ee?void 0:Ee.request_id,giftVoucherProvider:"SHOPIFY"}},...On.platformCustomerId&&(null===(Se=Tn.sellerConfig)||void 0===Se?void 0:Se.flitsEnable)&&{loyaltyManagerRequest:{customerId:On.platformCustomerId,couponType:"FLITS",cart:"appmaker"===et?(0,Q.a)(Xn,Mn.Cart_data,Mn.orderDetails):window.btoa(unescape(encodeURIComponent(l))),cartToken:i,applyLoyaltyPoint:"APPLIED"===(null===(De=Mn.loyaltyPointDetails)||void 0===De?void 0:De.status)}},...(null===(we=Tn.sellerConfig)||void 0===we?void 0:we.capillaryEnabled)&&{loyaltyManagerRequest:{couponType:"CAPILLARY",applyLoyaltyPoint:!1}},...(null===(Ne=Tn.sellerConfig)||void 0===Ne?void 0:Ne.twidpayEnabled)&&{loyaltyManagerRequest:{couponType:V.w.twidPay,applyLoyaltyPoint:!1}},...(null===(Ie=Tn.sellerConfig)||void 0===Ie?void 0:Ie.customLoyaltyPointsEnabled)&&{loyaltyManagerRequest:{couponType:"CUSTOM",applyLoyaltyPoint:!1}},...(null===(ke=Tn.sellerConfig)||void 0===ke?void 0:ke.nectorEnabled)&&{loyaltyManagerRequest:{couponType:"NECTOR",applyLoyaltyPoint:!1}},...(null===(Te=Tn.sellerConfig)||void 0===Te?void 0:Te.easyRewardEnabled)&&{loyaltyManagerRequest:{couponType:"EASYREWARD",applyLoyaltyPoint:!1}},...(null===(Pe=Tn.sellerConfig)||void 0===Pe?void 0:Pe.gyftrrEnabled)&&{loyaltyManagerRequest:{couponType:V.w.gyftrr,applyLoyaltyPoint:!1}},...(null===(je=Tn.sellerConfig)||void 0===je?void 0:je.popcoinEnabled)&&{loyaltyManagerRequest:{couponType:"POPCOIN",applyLoyaltyPoint:!1}},...(null===(Fe=Tn.sellerConfig)||void 0===Fe?void 0:Fe.techtonicEnabled)&&{loyaltyManagerRequest:{couponType:V.w.techtonic,applyLoyaltyPoint:!1}},...(null===(Re=Tn.sellerConfig)||void 0===Re?void 0:Re.shipCoinEnabled)&&!Mn.disableShipCoinForThisCart&&{loyaltyManagerRequest:{couponType:V.w.shipCoin,applyLoyaltyPoint:!1}}};kn((0,U.Cs)(e,Tn.sellerConfig.seller_id))}e.onRenderLoading(),e.setGiftWrapLoading(!1)}else e.setGiftWrapLoading(!1)}catch(l){e.setGiftWrapLoading(!1)}},nt=async(l,i)=>{try{var n,t,o,a,d,r,s,u,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D;Qn(!0);let I=[];I=(null!=Hn&&Hn.verified||null!=Tn&&Tn.userDetailsFetched||null!=Tn&&Tn.otpSkip)&&null!=Ln&&Ln.selectedAddress&&null!=Ln&&Ln.defaultAddressCorrect||null!=Tn&&null!==(n=Tn.sellerConfig)&&void 0!==n&&n.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock)?null===(t=Mn.orderDetails.lineItems)||void 0===t?void 0:t.map((e=>{var l,i,n,t;return String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!=e&&null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on?e:{...e,customAttributes:{...e.customAttributes}}})):null===(o=Mn.Cart_data.items)||void 0===o?void 0:o.map((e=>{var l,i,n,t;return String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!=e&&null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on?e:{...e,customAttributes:{...e.customAttributes}}}));let k={items:I,couponCode:(Ln.selectedAddress||null!=Tn&&null!==(a=Tn.sellerConfig)&&void 0!==a&&a.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock))&&(null===(d=Mn.orderDetails)||void 0===d||null===(r=d.discountDetail)||void 0===r||null===(s=r.discount_data)||void 0===s||null===(u=s.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===u?void 0:u.length)>0?null===(c=Mn.orderDetails)||void 0===c||null===(v=c.discountDetail)||void 0===v||null===(m=v.discount_data)||void 0===m||null===(g=m.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===g||null===(p=g[0])||void 0===p?void 0:p.discount_code:(null===(h=Mn.Cart_data)||void 0===h||null===(y=h.discountDetail)||void 0===y||null===(f=y.discount_data)||void 0===f||null===(_=f.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===_?void 0:_.length)>0?null===(C=Mn.Cart_data)||void 0===C||null===(x=C.discountDetail)||void 0===x||null===(b=x.discount_data)||void 0===b||null===(A=b.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===A||null===(E=A[0])||void 0===E?void 0:E.discount_code:"",channel:null==Mn||null===(S=Mn.platform)||void 0===S?void 0:S.toUpperCase(),...l&&"ADD"===i?{giftMsgDetails:{action:"ADD",giftText:l}}:"REMOVE"===i?{giftMsgDetails:{action:"REMOVE"}}:{}};const T=await M.Z.put("".concat(O.Z.CREATE_CART_DETAILS(),"/").concat(null==Tn||null===(D=Tn.userInfo)||void 0===D?void 0:D.user_profile_id),k,Tn.sellerConfig.seller_id);var w,N;T&&(Mn.Cart_data=T.data,kn((0,z.C)("Gift note ".concat("ADD"===i?"added":"removed"," successfully"),{autoClose:3e3,closeOnClick:!1})),Qn(!1),e.setGiftMsgText(null==T||null===(w=T.data)||void 0===w||null===(N=w.cartAttributes)||void 0===N?void 0:N.gift_text)),Wn(!1)}catch(e){console.error(e),Qn(!1)}},tt=()=>{var e,l,i,n;let t=null===(e=Mn.orderDetails)||void 0===e||!e.id||!Ln.selectedAddress&&(null==Tn||null===(l=Tn.sellerConfig)||void 0===l||!l.enabledFeatureCodForm||null!=Hn&&Hn.verified||!Mn.orderFetched||null!=On&&On.orderBlock)?null===(n=Mn.Cart_data)||void 0===n?void 0:n.items:null===(i=Mn.orderDetails)||void 0===i?void 0:i.lineItems,o=null==t?void 0:t.filter((e=>{var l,i,n,t;return!(String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on)}));for(let e=0;e<(null==o?void 0:o.length);e++){var a,d;if(null===(a=o[e])||void 0===a||null===(d=a.customAttributes)||void 0===d||!d.gift_wrap)return!1}return!0},ot=()=>{var e,l,i,n;let t=null===(e=Mn.orderDetails)||void 0===e||!e.id||!Ln.selectedAddress&&(null==Tn||null===(l=Tn.sellerConfig)||void 0===l||!l.enabledFeatureCodForm||null!=Hn&&Hn.verified||!Mn.orderFetched||null!=On&&On.orderBlock)?null===(n=Mn.Cart_data)||void 0===n?void 0:n.items:null===(i=Mn.orderDetails)||void 0===i?void 0:i.lineItems,o=null==t?void 0:t.filter((e=>{var l,i,n,t;return!(String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on)})),a=0;for(let e=0;e{var e,l,i,n;let t=null===(e=Mn.orderDetails)||void 0===e||!e.id||!Ln.selectedAddress&&(null==Tn||null===(l=Tn.sellerConfig)||void 0===l||!l.enabledFeatureCodForm||null!=Hn&&Hn.verified||!Mn.orderFetched||null!=On&&On.orderBlock)?null===(n=Mn.Cart_data)||void 0===n?void 0:n.items:null===(i=Mn.orderDetails)||void 0===i?void 0:i.lineItems,o=null==t?void 0:t.filter((e=>{var l,i,n,t;return!(String(e.itemId)===String(null===(l=Tn.sellerConfig)||void 0===l||null===(i=l.giftWrapDetails)||void 0===i?void 0:i.variantId)||null!==(n=e.customAttributes)&&void 0!==n&&n.freebie||null!==(t=e.customAttributes)&&void 0!==t&&t.is_add_on)}));console.log("Fil",o);for(let e=0;e{Un.couponCode}),[Un.couponCode]),(0,n.useEffect)((()=>{var e,l,i;null!=Mn&&null!==(e=Mn.Cart_data)&&void 0!==e&&null!==(l=e.items)&&void 0!==l&&l.length&&(Tn.cartItems=null==Mn||null===(i=Mn.Cart_data)||void 0===i?void 0:i.items)}),[Mn.Cart_data]),(0,n.useEffect)((()=>{let e=0;var l;null!=Tn&&Tn.cartItems&&(null==Tn||null===(l=Tn.cartItems)||void 0===l||l.forEach((l=>{e+=l.price*l.quantity}))),Rn(e)}),[]),(0,n.useEffect)((()=>{jn(Mn.total_price),"COD"===Ln.selectedPaymentMode?jn(Mn.cod_total_price):"UPI"===Ln.selectedPaymentMode&&jn(Mn.total_price)}),[Ln.selectedPaymentMode,Mn.total_price]);const dt=e=>(null==e?void 0:e.length)>20?"".concat(null==e?void 0:e.slice(0,20),"..."):e,rt=null===(y=Mn.orderDetails)||void 0===y?void 0:y.id,st=Ln.selectedAddress,ut=e=>{if(null!=e&&e.length)return null==e?void 0:e.reduce(((e,l)=>e+Math.max(Number(null==l?void 0:l.compareAtPrice)||0,Number(null==l?void 0:l.price)||0)*(Number(null==l?void 0:l.quantity)||0)),0)},ct=ut(null==Mn||null===(f=Mn.orderDetails)||void 0===f?void 0:f.lineItems),vt=ut(null==Mn||null===(_=Mn.Cart_data)||void 0===_?void 0:_.items),mt=ct+((null==On||null===(b=On.selected_service_data)||void 0===b?void 0:b.charges)||0),gt=vt+((null==On||null===(E=On.selected_service_data)||void 0===E?void 0:E.charges)||0),pt=null!==(S=Mn.orderDetails)&&void 0!==S&&S.totalPrice?ct>(null===(k=Mn.orderDetails)||void 0===k?void 0:k.totalPrice):vt>(null===(F=Mn.Cart_data)||void 0===F?void 0:F.totalPrice),ht=null!=Mn&&null!==(G=Mn.orderDetails)&&void 0!==G&&null!==(W=G.lineItems)&&void 0!==W&&W.length&&Ln.selectedAddress?null==Mn||null===(K=Mn.orderDetails)||void 0===K||null===($=K.lineItems)||void 0===$?void 0:$.reduce(((e,l)=>e+l.quantity),0):(null==Mn||null===(X=Mn.Cart_data)||void 0===X||null===(ee=X.items)||void 0===ee?void 0:ee.reduce(((e,l)=>e+l.quantity),0))||(null==Mn||null===(le=Mn.initialCartData)||void 0===le?void 0:le.reduce(((e,l)=>e+l.quantity),0)),yt=()=>{var e,l,i,n,t,o,a,d;return!(null===(e=Tn.sellerConfig)||void 0===e||null===(l=e.giftWrapDetails)||void 0===l||!l.enabled||null===(i=Tn.sellerConfig)||void 0===i||null===(n=i.giftWrapDetails)||void 0===n||!n.variantId||Mn.orderPending||null!=Mn&&Mn.hasBundleProduct||null!==(t=Tn.sellerConfig)&&void 0!==t&&null!==(o=t.giftWrapDetails)&&void 0!==o&&o.customGiftWrapCheck&&(null==Mn||null===(a=Mn.Cart_data)||void 0===a||null===(d=a.cartAttributes)||void 0===d||!d.gift_wrap_eligible))};return(0,n.useEffect)((()=>{var l,i,n,t,o,a,d,r,s,u;(!Mn.defaultOrderSummaryOpen&&(Tn.cartItems||null!==(l=Mn.orderDetails)&&void 0!==l&&null!==(i=l.lineItems)&&void 0!==i&&i.length)&&null!=Tn&&null!==(n=Tn.sellerConfig)&&void 0!==n&&null!==(t=n.uiConfig)&&void 0!==t&&t.orderSummaryOpen&&(null==Mn||!Mn.cardDesignEnabled)||e.showItems||null!==(o=Tn.sellerConfig)&&void 0!==o&&o.draftOrderNativeShopify||null!==(a=Mn.openSummaryOnAutomatic)&&void 0!==a&&a.includes(null==Tn||null===(d=Tn.sellerConfig)||void 0===d?void 0:d.domainName)&&(null===(r=Mn.Cart_data)||void 0===r||null===(s=r.discountDetail)||void 0===s||null===(u=s.discount_data)||void 0===u?void 0:u.length)>0&&(()=>{for(let d=0;d<(null===(e=Mn.Cart_data)||void 0===e||null===(l=e.discountDetail)||void 0===l||null===(i=l.discount_data)||void 0===i?void 0:i.length);d++){var e,l,i,n,t,o,a;if("AUTOMATIC"===(null===(n=Mn.Cart_data)||void 0===n||null===(t=n.discountDetail)||void 0===t||null===(o=t.discount_data[d])||void 0===o||null===(a=o.discount_type)||void 0===a?void 0:a.toUpperCase()))return!0}return!1})()&&(null==Mn||!Mn.cardDesignEnabled))&&(null==e||e.setShowDetails(!0),Mn.defaultOrderSummaryOpen=!0)}),[Mn.Cart_data,Mn.orderFetched]),(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)("div",{className:"mb-18 mt-20 ".concat(null!=Mn&&Mn.cardDesignEnabled?"card-container":""),id:"order-summary-id",style:{borderBottom:null!=Mn&&Mn.cardDesignEnabled&&at()?"2px solid #DDAF6A":"",position:"relative"},children:[(0,P.jsxs)("div",{onClick:()=>{null!=Mn&&Mn.cardDesignEnabled?(N.Z.orderSummaryExpanded(),N.Z.additionalEvents("order-summary-expanded",null==Mn?void 0:Mn.Cart_data,Un.couponCode,!!I.y.getItem("refreshToken"),!1),null==e||e.setOrderSummaryModalVisible(!0)):(null!=e&&e.showDetails?(N.Z.orderSummaryCollapsed(),N.Z.additionalEvents("order-summary-collapsed",null==Mn?void 0:Mn.Cart_data,Un.couponCode,!!I.y.getItem("refreshToken"),!1)):(N.Z.orderSummaryExpanded(),N.Z.additionalEvents("order-summary-expanded",null==Mn?void 0:Mn.Cart_data,Un.couponCode,!!I.y.getItem("refreshToken"),!1)),null==e||e.setShowDetails((e=>!e)))},style:{cursor:"pointer"},children:[(null==Mn?void 0:Mn.cardDesignEnabled)&&((null==e?void 0:e.hasAnyFreebie)||(null==e?void 0:e.hasAnyZeroPriceItem))&&(0,P.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"10px",marginRight:"-16px",marginTop:"-14px"},children:(0,P.jsxs)("div",{className:"OrderSummary_topFreebieTag__Z-ICX",children:[(0,P.jsx)("span",{style:{borderRadius:"0px 4px 4px 0px",background:"linear-gradient(90deg, #FFFFFF 0%, #D0DBF7 100%)",paddingRight:"10px"},children:"Free Gift Added"}),(0,P.jsx)("div",{className:"OrderSummary_triangle__SUSj9"}),(0,P.jsx)("img",{src:"assets/images/gift.gif",alt:"gift gif",height:26,style:{border:"1px solid #D0DBF7",borderRadius:"50%",marginBottom:"-5px"}})]})}),(0,P.jsxs)("div",{className:(0,D.Z)("OrderSummary_header__nEaIo",null!=Mn&&Mn.cardDesignEnabled?"":"px-24"),children:[(0,P.jsx)("div",{children:(0,P.jsx)("div",{style:{display:"flex",gap:4,alignItems:null!=Mn&&Mn.cardDesignEnabled?"center":""},children:(0,P.jsxs)("div",{className:null!=Mn&&Mn.cardDesignEnabled?"card-main-heading":t,children:["Order summary ",(0,P.jsxs)("a",{className:null!=Mn&&Mn.cardDesignEnabled?"card-heading-subtext":"OrderSummary_label__gveF8",children:["(",ht," Item",1===ht?"":"s",")"]})]})})}),Object.keys(Mn.orderDetails).length>0&&Ln.selectedAddress||null!=Tn&&null!==(ie=Tn.sellerConfig)&&void 0!==ie&&ie.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock)?(!Hn.verified||Tn.isProductPage&&!Mn.proceedToBuy?Un.loader:Un.loader||On.serviceFetching||Ln.fetchingAllAddress||0!==(null==Ln||null===(ne=Ln.Address_data)||void 0===ne?void 0:ne.length)&&(!Mn.orderFetched&&!On.orderBlock||Mn.globalPaymentLoader)&&(null==Ln?void 0:Ln.defaultAddressCorrect))?(0,P.jsx)("div",{style:null!=Mn&&Mn.cardDesignEnabled?{paddingRight:"5px"}:{paddingRight:"14px"},children:(0,P.jsx)(H.Z,{smallLoader:"small",noMarginTop:"0"})}):(0,P.jsxs)("div",{className:(0,D.Z)(null!=Mn&&Mn.cardDesignEnabled?o:t,a),style:{fontSize:null!=Mn&&Mn.cardDesignEnabled?"14px":""},children:[null!=Tn&&null!==(te=Tn.sellerConfig)&&void 0!==te&&te.showCompareAtPrice&&pt?(0,P.jsxs)("div",{className:A,children:["₹",Number(null!==(oe=Mn.orderDetails)&&void 0!==oe&&oe.totalPrice&&"number"==typeof(null==On||null===(ae=On.selected_service_data)||void 0===ae?void 0:ae.charges)?mt:gt).toFixed(2)]}):(null==Mn?void 0:Mn.cardDesignEnabled)&&Number(null!==(de=Mn.orderDetails)&&void 0!==de&&de.totalPrice?null===(re=Mn.orderDetails)||void 0===re?void 0:re.totalPrice:null===(se=Mn.Cart_data)||void 0===se?void 0:se.totalPrice).toFixed(2)>("COD"===(null==Ln?void 0:Ln.selectedPaymentMode)?null===(ue=Mn.orderDetails)||void 0===ue||null===(ce=ue.codPrice)||void 0===ce?void 0:ce.toFixed(2):null!==(ve=(null===(me=Mn.orderDetails)||void 0===me?void 0:me.totalAmount)+(null===(ge=Mn.orderDetails)||void 0===ge?void 0:ge.prepaidDiscount))&&void 0!==ve?ve:0)&&(0,P.jsxs)("div",{className:A,children:["₹",Number(null!==(pe=Mn.orderDetails)&&void 0!==pe&&pe.totalPrice?null===(he=Mn.orderDetails)||void 0===he?void 0:he.totalPrice:null===(ye=Mn.Cart_data)||void 0===ye?void 0:ye.totalPrice).toFixed(2)]}),"₹","COD"===(null==Ln?void 0:Ln.selectedPaymentMode)||null!=Mn&&Mn.payPartialCod&&null!=Mn&&Mn.orderPending?null==Mn||null===(fe=Mn.orderDetails)||void 0===fe||null===(_e=fe.codPrice)||void 0===_e?void 0:_e.toFixed(2):(null!==(Ce=(null===(xe=Mn.orderDetails)||void 0===xe?void 0:xe.prepaidPrice)+(null===(be=Mn.orderDetails)||void 0===be?void 0:be.prepaidDiscount))&&void 0!==Ce?Ce:0).toFixed(2),(0,P.jsx)("img",{className:"pl-5 ".concat(null!=Mn&&Mn.cardDesignEnabled?"back-card-opacity":""),src:null!=Mn&&Mn.cardDesignEnabled?"./assets/images/arrowIconCard.svg":null!=e&&e.showDetails?"./assets/images/svg/up-arrow.svg":"./assets/images/svg/down-arrow.svg",alt:"toggle icon",style:{marginTop:null!=Mn&&Mn.cardDesignEnabled?"2px":""}})]}):(0,P.jsxs)("div",{className:(0,D.Z)(null!=Mn&&Mn.cardDesignEnabled?o:t,a),style:{fontSize:null!=Mn&&Mn.cardDesignEnabled?"14px":""},children:[null!=Tn&&null!==(Ae=Tn.sellerConfig)&&void 0!==Ae&&Ae.showCompareAtPrice&&pt?(0,P.jsxs)("div",{className:A,children:["₹",Number(null!==(Ee=Mn.orderDetails)&&void 0!==Ee&&Ee.totalPrice&&"number"==typeof(null==On||null===(Se=On.selected_service_data)||void 0===Se?void 0:Se.charges)?mt:gt).toFixed(2)]}):(null==Mn?void 0:Mn.cardDesignEnabled)&&Number(null!==(De=Mn.orderDetails)&&void 0!==De&&De.totalPrice?null===(we=Mn.orderDetails)||void 0===we?void 0:we.totalPrice:null===(Ne=Mn.Cart_data)||void 0===Ne?void 0:Ne.totalPrice).toFixed(2)!==(null!==(Ie=Mn.Cart_data)&&void 0!==Ie&&Ie.totalDiscount?((null===(ke=Mn.Cart_data)||void 0===ke?void 0:ke.totalPrice)-(null===(Te=Mn.Cart_data)||void 0===Te?void 0:Te.totalDiscount)).toFixed(2):null!==(Pe=Mn.Cart_data)&&void 0!==Pe&&Pe.totalPrice?null===(je=Mn.Cart_data)||void 0===je||null===(Fe=je.totalPrice)||void 0===Fe?void 0:Fe.toFixed(2):Fn.toFixed(2))&&(0,P.jsxs)("div",{className:A,children:["₹",Number(null!==(Re=Mn.orderDetails)&&void 0!==Re&&Re.totalPrice?null===(Le=Mn.orderDetails)||void 0===Le?void 0:Le.totalPrice:null===(Oe=Mn.Cart_data)||void 0===Oe?void 0:Oe.totalPrice).toFixed(2)]}),"₹",null!==(Me=Mn.Cart_data)&&void 0!==Me&&Me.totalDiscount?((null===(Ue=Mn.Cart_data)||void 0===Ue?void 0:Ue.totalPrice)-(null===(Ze=Mn.Cart_data)||void 0===Ze?void 0:Ze.totalDiscount)).toFixed(2):null!==(Be=Mn.Cart_data)&&void 0!==Be&&Be.totalPrice?null===(He=Mn.Cart_data)||void 0===He||null===(Ve=He.totalPrice)||void 0===Ve?void 0:Ve.toFixed(2):Fn.toFixed(2),(0,P.jsx)("img",{className:"pl-5 ".concat(null!=Mn&&Mn.cardDesignEnabled?"back-card-opacity":""),src:null!=Mn&&Mn.cardDesignEnabled?"./assets/images/arrowIconCard.svg":null!=e&&e.showDetails?"./assets/images/svg/up-arrow.svg":"./assets/images/svg/down-arrow.svg",alt:"toggle icon",style:{marginTop:null!=Mn&&Mn.cardDesignEnabled?"2px":""}})]})]}),((null==Mn||null===(Ge=Mn.orderDetails)||void 0===Ge||null===(We=Ge.discountDetail)||void 0===We||null===(qe=We.discount_data)||void 0===qe||null===(ze=qe.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===ze?void 0:ze.length)>0&&rt&&(null!==st||(null==Tn||null===(Ye=Tn.sellerConfig)||void 0===Ye?void 0:Ye.enabledFeatureCodForm)&&!(null!=Hn&&Hn.verified)&&Mn.orderFetched&&!(null!=On&&On.orderBlock))||(null==Mn||null===(Qe=Mn.Cart_data)||void 0===Qe||null===(Je=Qe.discountDetail)||void 0===Je||null===(Ke=Je.discount_data)||void 0===Ke||null===($e=Ke.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===$e?void 0:$e.length)>0&&(!rt||null===st&&!(null!=Tn&&null!==(Xe=Tn.sellerConfig)&&void 0!==Xe&&Xe.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock))))&&(0,P.jsxs)("div",{className:" ".concat(null!=Mn&&Mn.cardDesignEnabled?"":"px-24"," new__green__text font-12"),style:{marginTop:4},children:[(0,P.jsx)("img",{src:"./assets/images/svg/automatic_coupon.svg",alt:"Coupon Apply",style:{verticalAlign:"middle"}}),(0,P.jsx)("span",{className:"pl-5",children:(null==Mn||null===(el=Mn.Cart_data)||void 0===el||null===(ll=el.discountDetail)||void 0===ll||null===(il=ll.discount_data)||void 0===il?void 0:il.length)>1||(null==Mn||null===(nl=Mn.orderDetails)||void 0===nl||null===(tl=nl.discountDetail)||void 0===tl||null===(ol=tl.discount_data)||void 0===ol?void 0:ol.length)>1?"Multiple offers Applied! You save ₹".concat(null!==(al=null==Mn||null===(dl=Mn.orderDetails)||void 0===dl||null===(rl=dl.discountDetail)||void 0===rl?void 0:rl.total_discount)&&void 0!==al?al:null==Mn||null===(sl=Mn.Cart_data)||void 0===sl||null===(ul=sl.discountDetail)||void 0===ul?void 0:ul.total_discount,"!"):(0,P.jsxs)(P.Fragment,{children:[null!==(cl=null==Mn||null===(vl=Mn.orderDetails)||void 0===vl||null===(ml=vl.discountDetail)||void 0===ml||null===(gl=ml.discount_data)||void 0===gl||null===(pl=gl.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===pl||null===(hl=pl[0])||void 0===hl?void 0:hl.discount_code)&&void 0!==cl?cl:null==Mn||null===(yl=Mn.Cart_data)||void 0===yl||null===(fl=yl.discountDetail)||void 0===fl||null===(_l=fl.discount_data)||void 0===_l||null===(Cl=_l.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Cl||null===(xl=Cl[0])||void 0===xl?void 0:xl.discount_code," Offer Applied! You save ₹",(null==Mn||null===(bl=Mn.orderDetails)||void 0===bl||null===(Al=bl.discountDetail)||void 0===Al||null===(El=Al.discount_data)||void 0===El||null===(Sl=El.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Sl?void 0:Sl.length)>0?null==Mn||null===(Dl=Mn.orderDetails)||void 0===Dl||null===(wl=Dl.discountDetail)||void 0===wl||null===(Nl=wl.discount_data)||void 0===Nl||null===(Il=Nl.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Il||null===(kl=Il[0])||void 0===kl?void 0:kl.discount_amount:(null==Mn||null===(Tl=Mn.Cart_data)||void 0===Tl||null===(Pl=Tl.discountDetail)||void 0===Pl||null===(jl=Pl.discount_data)||void 0===jl||null===(Fl=jl.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Fl?void 0:Fl.length)>0?null==Mn||null===(Rl=Mn.Cart_data)||void 0===Rl||null===(Ll=Rl.discountDetail)||void 0===Ll||null===(Ol=Ll.discount_data)||void 0===Ol||null===(Ml=Ol.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Ml||null===(Ul=Ml[0])||void 0===Ul?void 0:Ul.discount_amount:"","!"]})})]}),yt()&&(0,P.jsx)("div",{className:null!=Mn&&Mn.cardDesignEnabled?"":"px-24",children:(0,P.jsxs)("div",{className:"OrderSummary_singleGiftWrapBox__aIgzO",style:{background:at()?"linear-gradient(93.62deg, #FFEBBC 0.89%, #FFFCF4 80.74%":"linear-gradient(93.62deg, #F4F4F4 0.89%, #F9F9F9 80.74%)",marginTop:null!=Mn&&Mn.cardDesignEnabled?"10px":"",width:null!=Mn&&Mn.cardDesignEnabled?"fit-content":"",paddingRight:null!=Mn&&Mn.cardDesignEnabled?"10px":""},children:[!(null!=Mn&&Mn.cardDesignEnabled)&&(0,P.jsx)("img",{src:"./assets/images/svg/goldGiftbox.svg",alt:"gift wrap",style:{verticalAlign:"middle",marginRight:"6px"}}),Vn?(0,P.jsxs)("span",{style:{color:"#A97600"},children:[Vn," ₹",lt()]}):at()?tt()?(0,P.jsx)("span",{style:{color:"#A97600"},children:"Yay! Your order is gift-wrapped!"}):(0,P.jsxs)("span",{style:{color:"#A97600"},children:["Yay! ",ot()," of your items ",ot()>1?"are":"is"," gift-wrapped! "]}):(0,P.jsxs)("span",{style:{color:"#6A6A6A"},children:[" ",null!=Mn&&Mn.cardDesignEnabled?"Gift":""," wrap my order at ₹",lt()," "]}),(0,P.jsx)("img",{src:"./assets/images/svg/down-arrow-filled.svg",alt:"arrow",style:{marginLeft:"4px",transform:null!=e&&e.showDetails||null!=e&&e.orderSummaryModalVisible?"rotate(180deg)":""}})]})})]}),null!=e&&e.showDetails?(0,P.jsxs)("div",{className:"OrderSummary_orderSummary__dXxUk",children:[null!==(Zl=Mn.orderDetails)&&void 0!==Zl&&Zl.totalPrice||null!==(Bl=Mn.Cart_data)&&void 0!==Bl&&Bl.totalPrice?(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Sub total"}),(0,P.jsxs)("div",{children:["₹",null!=Tn&&null!==(Hl=Tn.sellerConfig)&&void 0!==Hl&&Hl.showCompareAtPrice&&pt?Number(null!==(Vl=Mn.orderDetails)&&void 0!==Vl&&Vl.totalPrice?ct:vt).toFixed(2):Number(null!==(Gl=Mn.orderDetails)&&void 0!==Gl&&Gl.totalPrice?null===(Wl=Mn.orderDetails)||void 0===Wl?void 0:Wl.totalPrice:null===(ql=Mn.Cart_data)||void 0===ql?void 0:ql.totalPrice).toFixed(2)]})]}):null,(!(null!==(zl=Mn.orderDetails)&&void 0!==zl&&zl.id)||null===Ln.selectedAddress)&&!(null!=Tn&&null!==(Yl=Tn.sellerConfig)&&void 0!==Yl&&Yl.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock))&&(0,P.jsxs)(P.Fragment,{children:[(null===(Ql=Tn.sellerConfig)||void 0===Ql?void 0:Ql.taxInOrderSummary)&&(null===(Jl=Mn.Cart_data)||void 0===Jl?void 0:Jl.totalTax)>0&&(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Tax"}),(0,P.jsxs)("div",{children:["₹",null===(Kl=Mn.Cart_data)||void 0===Kl||null===($l=Kl.totalTax)||void 0===$l?void 0:$l.toFixed(2)]})]}),(null==Tn||null===(Xl=Tn.sellerConfig)||void 0===Xl?void 0:Xl.showCompareAtPrice)&&pt&&(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Discount on MRP"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹ ",Number(null!==(ei=Mn.orderDetails)&&void 0!==ei&&ei.totalPrice?ct-(null===(li=Mn.orderDetails)||void 0===li?void 0:li.totalPrice):vt-(null===(ii=Mn.Cart_data)||void 0===ii?void 0:ii.totalPrice)).toFixed(2)]})]}),(null===(ni=Mn.Cart_data)||void 0===ni||null===(ti=ni.discountDetail)||void 0===ti||null===(oi=ti.discount_data)||void 0===oi||null===(ai=oi.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===ai?void 0:ai.length)>0&&(null===(di=Mn.Cart_data)||void 0===di||null===(ri=di.discountDetail)||void 0===ri||null===(si=ri.discount_data)||void 0===si||null===(ui=si.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===ui?void 0:ui.map((e=>{var l;return(0,P.jsxs)("div",{className:d,children:[(0,P.jsxs)("div",{children:["Coupon discount (",dt(null==e?void 0:e.discount_code),")"]}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),(null===(ci=Mn.Cart_data)||void 0===ci||null===(vi=ci.discountDetail)||void 0===vi||null===(mi=vi.discount_data)||void 0===mi||null===(gi=mi.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===gi?void 0:gi.length)>0&&(null===(pi=Mn.Cart_data)||void 0===pi||null===(hi=pi.discountDetail)||void 0===hi||null===(yi=hi.discount_data)||void 0===yi||null===(fi=yi.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===fi?void 0:fi.map((e=>{var l;return(0,P.jsxs)("div",{className:d,children:[(0,P.jsxs)("div",{children:["Auto discount",(null==e?void 0:e.discount_code)&&"(".concat(null==e?void 0:e.discount_code,")")]}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})})))]}),(null===(_i=Mn.orderDetails)||void 0===_i?void 0:_i.id)&&((null==Ln?void 0:Ln.selectedAddress)||(null==Tn||null===(Ci=Tn.sellerConfig)||void 0===Ci?void 0:Ci.enabledFeatureCodForm)&&!(null!=Hn&&Hn.verified)&&Mn.orderFetched&&!(null!=On&&On.orderBlock))&&(0,P.jsxs)(P.Fragment,{children:[(null===(xi=Tn.sellerConfig)||void 0===xi?void 0:xi.taxInOrderSummary)&&(null===(bi=Mn.orderDetails)||void 0===bi?void 0:bi.totalTax)>0&&(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Tax"}),(0,P.jsxs)("div",{children:["₹",null===(Ai=Mn.orderDetails)||void 0===Ai||null===(Ei=Ai.totalTax)||void 0===Ei?void 0:Ei.toFixed(2)]})]}),(null==Tn||null===(Si=Tn.sellerConfig)||void 0===Si?void 0:Si.showCompareAtPrice)&&pt&&(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Discount on MRP"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹ ",Number(null!==(Di=Mn.orderDetails)&&void 0!==Di&&Di.totalPrice?ct-(null===(wi=Mn.orderDetails)||void 0===wi?void 0:wi.totalPrice):vt-(null===(Ni=Mn.Cart_data)||void 0===Ni?void 0:Ni.totalPrice)).toFixed(2)]})]}),(null===(Ii=Mn.orderDetails)||void 0===Ii||null===(ki=Ii.discountDetail)||void 0===ki||null===(Ti=ki.discount_data)||void 0===Ti||null===(Pi=Ti.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===Pi?void 0:Pi.length)>0&&(null===(ji=Mn.orderDetails)||void 0===ji||null===(Fi=ji.discountDetail)||void 0===Fi||null===(Ri=Fi.discount_data)||void 0===Ri||null===(Li=Ri.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===Li?void 0:Li.map((e=>{var l;return(0,P.jsxs)("div",{className:d,children:[(0,P.jsxs)("div",{children:["Coupon discount (",dt(null==e?void 0:e.discount_code),")"]}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),(null===(Oi=Mn.orderDetails)||void 0===Oi||null===(Mi=Oi.discountDetail)||void 0===Mi||null===(Ui=Mi.discount_data)||void 0===Ui||null===(Zi=Ui.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Zi?void 0:Zi.length)>0&&(null===(Bi=Mn.orderDetails)||void 0===Bi||null===(Hi=Bi.discountDetail)||void 0===Hi||null===(Vi=Hi.discount_data)||void 0===Vi||null===(Gi=Vi.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===Gi?void 0:Gi.map((e=>{var l;return(0,P.jsxs)("div",{className:d,children:[(0,P.jsxs)("div",{children:["Auto discount",(null==e?void 0:e.discount_code)&&"(".concat(null==e?void 0:e.discount_code,")")]}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),"APPLIED"===(null===(Wi=Mn.loyaltyPointDetails)||void 0===Wi?void 0:Wi.status)&&(null===(qi=Mn.loyaltyPointDetails)||void 0===qi?void 0:qi.applicable_credits)>0&&(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Rewards & Loyalty Points"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null===(zi=Mn.loyaltyPointDetails)||void 0===zi||null===(Yi=zi.applicable_credits)||void 0===Yi?void 0:Yi.toFixed(2)]})]}),"APPLIED"===(null===(Qi=Mn.giftVoucherDetails)||void 0===Qi||null===(Ji=Qi.EASYREWARD)||void 0===Ji||null===(Ki=Ji.status)||void 0===Ki?void 0:Ki.toUpperCase())&&(0,P.jsxs)("div",{className:d,style:{paddingRight:"0px"},children:[(0,P.jsx)("div",{children:"Gift Card"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null===($i=Mn.giftVoucherDetails)||void 0===$i||null===(Xi=$i.EASYREWARD)||void 0===Xi?void 0:Xi.amount_redeemed.toFixed(2)]})]}),"APPLIED"===(null===(en=Mn.giftVoucherDetails)||void 0===en||null===(ln=en.SHOPIFY)||void 0===ln||null===(nn=ln.status)||void 0===nn?void 0:nn.toUpperCase())&&(0,P.jsxs)("div",{className:d,style:{paddingRight:"0px"},children:[(0,P.jsx)("div",{children:"Gift Card"}),(0,P.jsxs)("div",{className:"new__green__text",children:["- ₹",null===(tn=Mn.giftVoucherDetails)||void 0===tn||null===(on=tn.SHOPIFY)||void 0===on?void 0:on.amount_redeemed.toFixed(2)]})]})]}),("COD"===Ln.selectedPaymentMode||Mn.payPartialCod&&Mn.orderPending)&&(null===(an=Mn.orderDetails)||void 0===an?void 0:an.codCharges)>0?(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"COD charges"}),(0,P.jsxs)("div",{children:["₹",null===(dn=Mn.orderDetails)||void 0===dn||null===(rn=dn.codCharges)||void 0===rn?void 0:rn.toFixed(2)]})]}):null,null==Mn||null===(sn=Mn.orderDetails)||void 0===sn||!sn.shippingCharges||!Ln.selectedAddress&&(null==Tn||null===(un=Tn.sellerConfig)||void 0===un||!un.enabledFeatureCodForm||null!=Hn&&Hn.verified||!Mn.orderFetched||null!=On&&On.orderBlock)?null:(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:"Delivery charges"}),(0,P.jsx)("div",{className:(null==Mn||null===(cn=Mn.orderDetails)||void 0===cn?void 0:cn.shippingCharges)<0?"ascent-green":"",children:(null==Mn||null===(vn=Mn.orderDetails)||void 0===vn?void 0:vn.shippingCharges)>0?(0,P.jsxs)(P.Fragment,{children:["₹",Number(null===(mn=Mn.orderDetails)||void 0===mn?void 0:mn.shippingCharges).toFixed(2)," "]}):"FREE"})]}),(null===(gn=Mn.orderDetails)||void 0===gn?void 0:gn.additionalCharge)>0&&(Ln.selectedAddress||(null==Tn||null===(pn=Tn.sellerConfig)||void 0===pn?void 0:pn.enabledFeatureCodForm)&&!(null!=Hn&&Hn.verified)&&Mn.orderFetched&&!(null!=On&&On.orderBlock))&&(0,P.jsxs)("div",{className:d,children:[(0,P.jsx)("div",{children:(null==On?void 0:On.additional_charge_text)||"Additional Charges"}),(0,P.jsxs)("div",{children:["₹",null===(hn=Mn.orderDetails)||void 0===hn||null===(yn=hn.additionalCharge)||void 0===yn?void 0:yn.toFixed(2)]})]}),yt()&&(e.giftWrapLoading||Un.loader||On.serviceFetching||Ln.fetchingAllAddress||Mn.orderFetching?(0,P.jsx)("div",{className:"skeleton__text__small width30",style:{marginLeft:"16px"}}):(0,P.jsxs)("div",{className:C,onClick:e=>{e.stopPropagation()},style:{padding:"0px 16px 10px 16px"},children:[(0,P.jsx)("input",{id:"selectAllGift",type:"checkbox",onChange:e=>{e.target.checked?it("ALL","APPLY"):it("ALL","REMOVE")},disabled:null==On?void 0:On.orderBlock,style:{accentColor:"var(--primary-color)",marginTop:"4px"},checked:tt()}),(0,P.jsxs)("h3",{className:x,children:[Vn||"Select all for gift wrapping at"," ₹",lt()]})]})),(null===(fn=Mn.orderDetails)||void 0===fn||null===(_n=fn.lineItems)||void 0===_n?void 0:_n.length)>0&&(Ln.selectedAddress||null!=Tn&&null!==(Cn=Tn.sellerConfig)&&void 0!==Cn&&Cn.enabledFeatureCodForm&&(null==Hn||!Hn.verified)&&Mn.orderFetched&&(null==On||!On.orderBlock))?(0,P.jsx)("div",{className:p,children:null===(xn=Mn.orderDetails)||void 0===xn||null===(bn=xn.lineItems)||void 0===bn?void 0:bn.map(((l,i)=>{var n,t,o,a,d,r,p,h,y,f,_,b,A,E,S,D,w,N,I,k,F,R,L,O,M,U,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le;return(0,P.jsxs)("div",{className:s,style:{borderBottom:(null===(n=Tn.cartItems)||void 0===n?void 0:n.length)===i+1?"none":"1px solid var(--grey-lite)"},children:[(0,P.jsxs)("div",{className:"d-flex ml-15",style:{position:"relative"},children:[(0,P.jsxs)("div",{className:u,children:[(null==l||null===(t=l.customAttributes)||void 0===t?void 0:t.gift_wrap)&&(0,P.jsx)("img",{src:"/assets/images/svg/gift-ribbon.svg",style:{zIndex:"10",position:"absolute",left:"-6px",top:"-6px",transform:"rotate(-45deg)",width:"24px"}}),"myxtur.com"===Tn.sellerConfig.domainName?(0,P.jsx)("img",{src:null!==(o=null==l||null===(a=l.customAttributes)||void 0===a?void 0:a.image)&&void 0!==o?o:null==l?void 0:l.imageUrl,alt:null==l?void 0:l.name,style:{overflow:"hidden",height:"auto",border:null!=l&&null!==(d=l.customAttributes)&&void 0!==d&&d.gift_wrap?"1px solid #DDAF6A":""}}):(0,P.jsx)("img",{src:null==l?void 0:l.imageUrl,alt:null==l?void 0:l.name,style:{overflow:"hidden",height:"auto",border:null!=l&&null!==(r=l.customAttributes)&&void 0!==r&&r.gift_wrap?"1px solid #DDAF6A":"",objectFit:Jn?"contain":"fill"}})]}),(0,P.jsxs)("div",{className:g,children:[(0,P.jsx)("div",{className:v,children:null==l?void 0:l.name}),"everlasting.shop"===(null==Tn||null===(p=Tn.sellerConfig)||void 0===p?void 0:p.domainName)&&(null==l?void 0:l.customAttributes)&&(0,P.jsx)("div",{className:v,children:Object.keys(null==l?void 0:l.customAttributes).map(((e,i)=>"For COD orders team will ask you for an advance payment of INR 200"!==e&&"contentId"!==e?"".concat(null==l?void 0:l.customAttributes[e]," / "):""))}),null===(h=Tn.sellerConfig)||void 0===h||!h.editQuantityEnabled||String(null===(y=Tn.sellerConfig)||void 0===y||null===(f=y.giftWrapDetails)||void 0===f?void 0:f.variantId)===String(l.itemId)||Mn.orderPending||null!=l&&null!==(_=l.customAttributes)&&void 0!==_&&_.freebie||null!=Mn&&Mn.hasBundleProduct||null!=l&&null!==(b=l.customAttributes)&&void 0!==b&&b.is_add_on||!((null==l?void 0:l.price)>0)?(0,P.jsxs)("div",{className:m,children:["Qty: ",null==l?void 0:l.quantity]}):(0,P.jsx)(j,{item:l,modifyCart:e.modifyCart,setShowRemoveItemModal:e.setShowRemoveItemModal,setCurrentQtyModifyingItem:e.setCurrentQtyModifyingItem}),(null==On||null===(A=On.selected_service_data)||void 0===A||null===(E=A.nonDeliverableItems)||void 0===E?void 0:E.find((e=>(null==e?void 0:e.variantId)==(null==l?void 0:l.itemId))))&&(0,P.jsx)(T.Z,{type:"error",alertMessage:"Product unavailable at selected pincode"}),"etchcraftemporium.in"===(null==Tn||null===(S=Tn.sellerConfig)||void 0===S?void 0:S.domainName)&&(null==l||null===(D=l.item_meta_data)||void 0===D?void 0:D.properties)&&Object.keys(null==l||null===(w=l.item_meta_data)||void 0===w?void 0:w.properties).map(((e,i)=>{var n;return(0,P.jsx)("div",{className:v,children:"".concat(e,': "').concat(null==l||null===(n=l.item_meta_data)||void 0===n?void 0:n.properties[e],'"')})})),("happyprintclub.com"===(null==Tn||null===(N=Tn.sellerConfig)||void 0===N?void 0:N.domainName)||"zoocase.in"===(null==Tn||null===(I=Tn.sellerConfig)||void 0===I?void 0:I.domainName))&&(null==l?void 0:l.customAttributes)&&(null===(k=Object.keys(null==l?void 0:l.customAttributes))||void 0===k?void 0:k.length)>0&&(null===(F=Object.keys(null==l?void 0:l.customAttributes))||void 0===F?void 0:F.map(((e,i)=>!Z.Wx.some((l=>l.includes(e)))&&(0,P.jsx)("div",{className:v,children:"".concat(e,': "').concat(null==l?void 0:l.customAttributes[e],'"')})))),(null===(R=Tn.sellerConfig)||void 0===R||null===(L=R.giftWrapDetails)||void 0===L?void 0:L.enabled)&&(null===(O=Tn.sellerConfig)||void 0===O||null===(M=O.giftWrapDetails)||void 0===M?void 0:M.variantId)&&String(null===(U=Tn.sellerConfig)||void 0===U||null===(B=U.giftWrapDetails)||void 0===B?void 0:B.variantId)!==String(l.itemId)&&!Mn.orderPending&&!(null!=Tn&&null!==(H=Tn.sellerConfig)&&void 0!==H&&null!==(V=H.giftWrapDetails)&&void 0!==V&&V.singleGiftWrap)&&!(null!=l&&null!==(G=l.customAttributes)&&void 0!==G&&G.freebie)&&!(null!=Mn&&Mn.hasBundleProduct)&&!(null!=l&&null!==(W=l.customAttributes)&&void 0!==W&&W.is_add_on)&&(e.giftWrapLoading||Un.loader||On.serviceFetching||Ln.fetchingAllAddress||Mn.orderFetching?(0,P.jsx)("div",{className:"skeleton__text__small",style:{width:"100px",marginTop:"5px"}}):(0,P.jsxs)("div",{className:C,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)("input",{id:"selectGift",type:"checkbox",onChange:e=>{e.target.checked?it("PRODUCT","APPLY",l.itemId):it("PRODUCT","REMOVE",l.itemId)},disabled:null==On?void 0:On.orderBlock,style:{accentColor:"var(--primary-color)",marginTop:"4px"},checked:!(null==l||null===(q=l.customAttributes)||void 0===q||!q.gift_wrap)}),(0,P.jsxs)("h3",{className:x,children:[Vn||"Gift wrap at"," ₹",null===(z=(null!=Tn&&null!==(Y=Tn.sellerConfig)&&void 0!==Y&&null!==(Q=Y.giftWrapDetails)&&void 0!==Q&&Q.singleGiftWrap?1:l.quantity)*(null===(J=Tn.sellerConfig)||void 0===J||null===(K=J.giftWrapDetails)||void 0===K?void 0:K.price))||void 0===z?void 0:z.toFixed(2)]})]}))]})]}),(0,P.jsxs)("div",{className:c,children:[l.price>0&&(null===($=l.customAttributes)||void 0===$||!$.freebie)?"₹".concat(null==l||null===(X=l.price)||void 0===X?void 0:X.toFixed(2)):(0,P.jsx)("span",{style:{color:"#238017"},children:"FREE"}),(null===(ee=Tn.sellerConfig)||void 0===ee?void 0:ee.showCompareAtPrice)&&(null==l?void 0:l.compareAtPrice)>(null==l?void 0:l.price)&&(0,P.jsxs)("span",{style:{fontWeight:400,color:"#909090",textDecoration:"line-through"},children:["₹",null==l||null===(le=l.compareAtPrice)||void 0===le?void 0:le.toFixed(2)]})]})]},i)}))}):(0,P.jsx)("div",{className:p,children:Tn.cartItems&&(null===(An=Tn.cartItems)||void 0===An?void 0:An.map(((l,i)=>{var n,t,o,a,d,r,p,h,y,f,_,b,A,E,S,D,w,N,I,k,F,R,L,O,M,U,B,H,V,G,W,q,z,Y,Q,J;return(0,P.jsxs)("div",{className:s,style:{borderBottom:(null===(n=Tn.cartItems)||void 0===n?void 0:n.length)===i+1?"none":"1px solid var(--grey-lite)"},children:[(0,P.jsxs)("div",{className:"d-flex ml-15",children:[(0,P.jsxs)("div",{className:u,children:[(null==l||null===(t=l.customAttributes)||void 0===t?void 0:t.gift_wrap)&&(0,P.jsx)("img",{src:"/assets/images/svg/gift-ribbon.svg",style:{zIndex:"10",position:"absolute",left:"-6px",top:"-6px",transform:"rotate(-45deg)",width:"24px"}}),(0,P.jsx)("img",{src:(null==l?void 0:l.image)||(null==l?void 0:l.imageUrl),alt:null==l?void 0:l.name,style:{overflow:"hidden",height:"auto",border:null!=l&&null!==(o=l.customAttributes)&&void 0!==o&&o.gift_wrap?"1px solid #DDAF6A":"",objectFit:Jn?"contain":"fill"}})]}),(0,P.jsxs)("div",{className:g,children:[(0,P.jsx)("div",{className:v,children:(null==l?void 0:l.title)||(null==l?void 0:l.name)}),"everlasting.shop"===(null==Tn||null===(a=Tn.sellerConfig)||void 0===a?void 0:a.domainName)&&(null==l?void 0:l.customAttributes)&&(0,P.jsx)("div",{className:v,children:Object.keys(null==l?void 0:l.customAttributes).map(((e,i)=>"For COD orders team will ask you for an advance payment of INR 200"!==e?"".concat(null==l?void 0:l.customAttributes[e]," / "):""))}),null===(d=Tn.sellerConfig)||void 0===d||!d.editQuantityEnabled||String(null===(r=Tn.sellerConfig)||void 0===r||null===(p=r.giftWrapDetails)||void 0===p?void 0:p.variantId)===String(l.itemId)||Mn.orderPending||null!=l&&null!==(h=l.customAttributes)&&void 0!==h&&h.freebie||null!=Mn&&Mn.hasBundleProduct||null!=l&&null!==(y=l.customAttributes)&&void 0!==y&&y.is_add_on||!((null==l?void 0:l.price)>0)?(0,P.jsxs)("div",{className:m,children:["Qty: ",null==l?void 0:l.quantity]}):(0,P.jsx)(j,{item:l,modifyCart:e.modifyCart}),(null==On||null===(f=On.selected_service_data)||void 0===f||null===(_=f.nonDeliverableItems)||void 0===_?void 0:_.find((e=>(null==e?void 0:e.variantId)==(null==l?void 0:l.itemId))))&&(0,P.jsx)(T.Z,{type:"error",alertMessage:"Product unavailable at selected pincode"}),"etchcraftemporium.in"===(null==Tn||null===(b=Tn.sellerConfig)||void 0===b?void 0:b.domainName)&&(null==l||null===(A=l.item_meta_data)||void 0===A?void 0:A.properties)&&Object.keys(null==l||null===(E=l.item_meta_data)||void 0===E?void 0:E.properties).map(((e,i)=>{var n;return(0,P.jsx)("div",{className:v,children:"".concat(e,': "').concat(null==l||null===(n=l.item_meta_data)||void 0===n?void 0:n.properties[e],'"')})})),("happyprintclub.com"===(null==Tn||null===(S=Tn.sellerConfig)||void 0===S?void 0:S.domainName)||"zoocase.in"===(null==Tn||null===(D=Tn.sellerConfig)||void 0===D?void 0:D.domainName))&&(null==l?void 0:l.customAttributes)&&(null===(w=Object.keys(null==l?void 0:l.customAttributes))||void 0===w?void 0:w.length)>0&&(null===(N=Object.keys(null==l?void 0:l.customAttributes))||void 0===N?void 0:N.map(((e,i)=>!Z.Wx.some((l=>l.includes(e)))&&(0,P.jsx)("div",{className:v,children:"".concat(e,': "').concat(null==l?void 0:l.customAttributes[e],'"')})))),(null===(I=Tn.sellerConfig)||void 0===I||null===(k=I.giftWrapDetails)||void 0===k?void 0:k.enabled)&&(null===(F=Tn.sellerConfig)||void 0===F||null===(R=F.giftWrapDetails)||void 0===R?void 0:R.variantId)&&String(null===(L=Tn.sellerConfig)||void 0===L||null===(O=L.giftWrapDetails)||void 0===O?void 0:O.variantId)!==String(l.itemId)&&!Mn.orderPending&&!(null!=Tn&&null!==(M=Tn.sellerConfig)&&void 0!==M&&null!==(U=M.giftWrapDetails)&&void 0!==U&&U.singleGiftWrap)&&!(null!=l&&null!==(B=l.customAttributes)&&void 0!==B&&B.freebie)&&!(null!=l&&null!==(H=l.customAttributes)&&void 0!==H&&H.is_add_on)&&!(null!=Mn&&Mn.hasBundleProduct)&&(e.giftWrapLoading||Un.loader||On.serviceFetching||Ln.fetchingAllAddress||Mn.orderFetching?(0,P.jsx)("div",{className:"skeleton__text__small",style:{width:"100px",marginTop:"5px"}}):(0,P.jsxs)("div",{className:C,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)("input",{id:"selectGift",type:"checkbox",onChange:e=>{e.target.checked?it("PRODUCT","APPLY",l.itemId):it("PRODUCT","REMOVE",l.itemId)},disabled:null==On?void 0:On.orderBlock,style:{accentColor:"#6F57E9",marginTop:"4px"},checked:!(null==l||null===(V=l.customAttributes)||void 0===V||!V.gift_wrap)}),(0,P.jsxs)("h3",{className:x,children:[Vn||"Gift wrap at"," ₹",null===(G=l.quantity*(null===(W=Tn.sellerConfig)||void 0===W||null===(q=W.giftWrapDetails)||void 0===q?void 0:q.price))||void 0===G?void 0:G.toFixed(2)]})]}))]})]}),(0,P.jsxs)("div",{className:c,children:[l.price>0&&(null===(z=l.customAttributes)||void 0===z||!z.freebie)?"₹".concat(null==l||null===(Y=l.price)||void 0===Y?void 0:Y.toFixed(2)):(0,P.jsx)("span",{style:{color:"#238017"},children:"FREE"}),(null===(Q=Tn.sellerConfig)||void 0===Q?void 0:Q.showCompareAtPrice)&&(null==l?void 0:l.compareAtPrice)>(null==l?void 0:l.price)&&(0,P.jsxs)("span",{style:{fontWeight:400,color:"#909090",textDecoration:"line-through"},children:["₹",null==l||null===(J=l.compareAtPrice)||void 0===J?void 0:J.toFixed(2)]})]})]},i)})))}),(null===(En=Tn.sellerConfig)||void 0===En||null===(Sn=En.giftWrapDetails)||void 0===Sn?void 0:Sn.allowGiftMessage)&&at()&&(0,P.jsx)(R,{giftMsgText:e.giftMsgText,setGiftMsgText:e.setGiftMsgText,addRemoveGiftNote:nt,setShowRemoveGiftMsgModal:zn,isGiftMsgBoxOpen:Gn,setIsGiftMsgBoxOpen:Wn,giftMsgLoading:Yn}),(null==On||null===(Dn=On.selected_service_data)||void 0===Dn||null===(wn=Dn.nonDeliverableItems)||void 0===wn?void 0:wn.length)&&!e.showItems&&!Tn.isProductPage&&(0,P.jsxs)("div",{style:{width:"90%",margin:"auto",display:"flex",flexDirection:"column",gap:"8px",textAlign:"center"},children:[(0,P.jsx)("span",{style:{fontWeight:"400",fontSize:"12px",lineHeight:"14px"},children:"You can continue checkout without that item"}),(0,P.jsx)("button",{className:null!=Mn&&Mn.cardDesignEnabled?"modal_button_white":"modal_button primary",onClick:()=>{e.isHeadless?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:"https://".concat(Tn.sellerConfig.domainName,"/")}}]},"*"):window.parent.postMessage({trigger:"headless-close"},"*")},style:{color:null!=Mn&&Mn.cardDesignEnabled?"var(--primary-color)":"#6F57E9",fontWeight:500,cursor:"pointer"},children:"Edit items in cart"})]})]}):null,(0,P.jsx)(L,{orderSummaryModalVisible:null==e?void 0:e.orderSummaryModalVisible,setOrderSummaryModalVisible:null==e?void 0:e.setOrderSummaryModalVisible,finalPriceLoginPage:Fn,GiftWrap:it,checkIfAllGiftWrap:tt,getPriceForGiftWrap:lt,checkIfAnyGiftWrap:at,giftWrapLoading:null==e?void 0:e.giftWrapLoading,totalOrderDetailsMRP:ct,totalCartDetailsMRP:vt,isOrderMRPGreater:pt,onRenderLoading:null==e?void 0:e.onRenderLoading,modifyCart:e.modifyCart,setShowRemoveItemModal:e.setShowRemoveItemModal,currentQtyModifyingItem:e.currentQtyModifyingItem,setCurrentQtyModifyingItem:e.setCurrentQtyModifyingItem,addRemoveGiftNote:nt,giftMsgText:e.giftMsgText,setGiftMsgText:e.setGiftMsgText,isGiftMsgBoxOpen:Gn,setIsGiftMsgBoxOpen:Wn,showRemoveGiftMsgModal:qn,setShowRemoveGiftMsgModal:zn,giftMsgLoading:Yn}),e.showRemoveItemModal&&(0,P.jsx)(q,{currentQtyModifyingItem:e.currentQtyModifyingItem,setShowRemoveItemModal:e.setShowRemoveItemModal,modifyCart:e.modifyCart}),qn&&(0,P.jsx)(Y,{setShowRemoveGiftMsgModal:zn,addRemoveGiftNote:nt}),(null==Mn?void 0:Mn.cardDesignEnabled)&&(null===(Nn=Tn.sellerConfig)||void 0===Nn||null===(In=Nn.giftWrapDetails)||void 0===In?void 0:In.enabled)&&at()&&(0,P.jsx)("img",{src:"/assets/images/svg/gift-ribbon.svg",style:{position:"absolute",bottom:"-8px",left:"48%",width:"24px"}})]})})}},3731:(e,l,i)=>{i.d(l,{y:()=>u});var n=i(7313),t=i(6352),o=i(7666),a=i(6e3),d=i(2199),r=i(5763),s=i(2183);const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,t.I0)(),i=(0,n.useRef)(null),u=(0,t.v9)((e=>e.Login)),c=(0,t.v9)((e=>e.Otp)),v=u.otpLess,m=(0,t.v9)((e=>e.Cart));function g(e){return e.startsWith("www.")?e.slice(4):e}(0,n.useEffect)((()=>{i.current=u.authentication_token}),[u.authentication_token]),(0,n.useEffect)((()=>{if(!v.otplessInitialized){const e={id:"otpless-sdk","data-appid":"6YH1ZI6T4Q7SHRDVDEK7"};v.iframeScriptLoadStartTime=(0,r.G)(),(0,a.v)("https://otpless.com/v4.1/headless.js",e).then((e=>{if(e){v.otpLessScriptLoaded=!0,v.iframeScriptLoadCompleteTime=(0,r.G)();try{window.OtpLessInstance=new OTPless(p),v.otplessInitialized=!0,console.log("otp less instance created")}catch(e){console.error("err",e),v.otplessInitialized=!1}}})).catch((e=>{console.error("error is",e),v.otpLessScriptLoaded=!1}))}}),[]);const p=(0,n.useCallback)((n=>{const t={ONETAP:()=>{try{let e=10;const{response:t}=n;console.log("one tap response",t),console.log("one tap ",i.current);const a=(null==t?void 0:t.token)||null;if(a){u.otpLess.token=a;const n={token:a},d=setInterval((()=>{if(console.log("one tap pooling",i.current),i.current&&l((0,o.Lm)(n,u.sellerConfig.seller_id)),(i.current||0===e)&&clearInterval(d),0===e&&!i.current)throw{...t,errorMessage:"pooling time out due to unavailability of authentication token for "+a};e-=1}),500)}else u.fireShipRocketFallBackOtpRequest=!0,d.$e((e=>{var l,i;e.setExtras({error:JSON.stringify(error),request_body:{number:u.mobileNumber},response_body:JSON.stringify(null===(l=error)||void 0===l||null===(i=l.response)||void 0===i?void 0:i.data)}),d.uT("fallback in else condition")}))}catch(l){var t;console.error("one tap error",err),d.$e((e=>{var i;e.setExtras({error:JSON.stringify(l),request_body:{number:u.mobileNumber},response_body:JSON.stringify(null==l||null===(i=l.response)||void 0===i?void 0:i.data)}),d.uT("ONE TAP POOLING TIME OUT")})),u.fireShipRocketFallBackOtpRequest=!0,null==e||null===(t=e.onRender)||void 0===t||t.call(e)}},OTP_AUTO_READ:()=>{try{var l;const{response:{otp:i}={}}=n;c.otpLessOtpValue=i,null==e||null===(l=e.onRender)||void 0===l||l.call(e)}catch(e){console.error("Auto-read OTP:",e)}},FAILED:()=>{var l;const{response:i}=n;u.otpLess.token=null,u.otpLess.verificationSuccessful=!1,u.fireShipRocketFallBackOtpRequest=!0,null===(l=e.onRender)||void 0===l||l.call(e),"7008"===i.errorCode&&(v.otpLessScriptLoaded=!1,v.otplessInitialized=!1)},FALLBACK_TRIGGERED:()=>{const{response:e}=n}};(null==n?void 0:n.responseType)in t&&t[n.responseType]()}),[l,u]),h=function(e,l,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;return new Promise(((t,o)=>{const a=setTimeout((()=>{var e,n;(0,s.kf)({name:"initiate"===l?"OTPLESS_INITIATE_TIMEOUT":"OTPLESS_VERIFY_TIMEOUT",domain:null===(e=u.sellerConfig)||void 0===e?void 0:e.domainName,payload:{number:u.mobileNumber,cart_id:null==m||null===(n=m.Cart_data)||void 0===n?void 0:n.id,timeStamp:i}}),o(new Error("OtpLess"+l+" Request timed out "+u.mobileNumber))}),n);e().then((e=>{clearTimeout(a),t(e)})).catch((e=>{console.error("otp less",e),clearTimeout(a),o(e)}))}))},y=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return new Promise((async(t,o)=>{const a=(0,r.G)();try{var p,y;if(!v.otpLessScriptLoaded||!v.otplessInitialized)throw new Error("OTP-less script not initialized");const o={channel:"PHONE",phone:e,otpLength:i,countryCode:"+91",metaData:JSON.stringify({...l,sellerDomain:g(l.sellerDomain)}),...n&&{deliveryChannel:n}};var f,_;if(null===(p=window)||void 0===p||null===(y=p.OtpLessInstance)||void 0===y||!y.isReady())return(0,s.kf)({name:"Otpless_not_ready",domain:null===(f=u.sellerConfig)||void 0===f?void 0:f.domainName,payload:{number:u.mobileNumber,cart_id:null==m||null===(_=m.Cart_data)||void 0===_?void 0:_.id,timeStamp:a}}),t({success:!1,error:"otp less Script was not ready"});const d=await h((()=>{var e;return null===(e=window.OtpLessInstance)||void 0===e?void 0:e.initiateWithFeedback(o)}),"initiate",a);return!0===(null==d?void 0:d.success)?c.otpDigits=i:c.otpDigits=6,t(d)}catch(e){return c.otpDigits=6,console.error("Error during OTP-less initiation:",e),d.$e((l=>{var i;l.setExtras({error:JSON.stringify(e),request_body:{error:JSON.stringify(e),number:u.mobileNumber,timeStamp:a},response_body:JSON.stringify(null==e||null===(i=e.response)||void 0===i?void 0:i.data)}),d.uT("OTPLESS initiate Request error")})),t({success:!1,error:e})}}))},f=(e,l)=>new Promise((async(i,n)=>{const t=(0,r.G)();try{const n=await h((()=>{var i;return null===(i=window.OtpLessInstance)||void 0===i?void 0:i.verify({channel:"PHONE",phone:e,otp:l,countryCode:"+91"})}),"verify",t);if(console.log("verification response is",n),200===n.statusCode)return i(n);if("7118"===n.response.errorCode)return n.response.errorMessage="Incorrect OTP!",i(n);if(!n.response.errorCode||"undefined"===n.response.errorCode)throw new Error(n);return i(n)}catch(n){return console.error("Error during OTP-less verification:",JSON.stringify(n)),d.$e((e=>{var l;e.setExtras({error:JSON.stringify(n),request_body:{number:u.mobileNumber,timeStamp:t,error:JSON.stringify(n)},response_body:JSON.stringify(null==n||null===(l=n.response)||void 0===l?void 0:l.data)}),d.uT("OTPLESS verify Request error")})),i({success:!1,statusCode:400,responseType:"VERIFY",response:{number:e,otp:l,errorCode:null,errorMessage:"Something went wrong! Kindly resend the OTP",verification:"FAILED"}})}}));return{initiateOtpLess:y,verifyOtpLess:f}}},9741:(e,l,i)=>{i.d(l,{w:()=>n});const n={capillary:"CAPILLARY",flits:"FLITS",easyReward:"EASYREWARD",custom:"CUSTOM",nector:"NECTOR",popCoin:"POPCOIN",techtonic:"TECHTONIC",shipCoin:"SHIPCOIN",twidPay:"TWIDPAY",gyftrr:"GYFTRR"}},6e3:(e,l,i)=>{i.d(l,{v:()=>n,o:()=>t});const n=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(((i,n)=>{try{const t=document.createElement("script");t.src=e,t.async=!0;for(let e in l)t.setAttribute(e,l[e]);t.onload=()=>{i(!0)},t.onerror=e=>{n(e||!1)},document.body.appendChild(t)}catch(e){console.error("load script error",e),n(e)}}))},t=e=>{for(var l=document.getElementsByTagName("script"),i=!1,n=0;n{i.d(l,{Z:()=>r});var n=i(7313);var t=i(7674),o=i(6352),a=i(2183),d=i(6417);const r=e=>{var l,i,r,s,u,c,v,m;(0,o.v9)((e=>e.Address));const g=(0,o.v9)((e=>e.Cart)),p=(0,o.v9)((e=>e.Login)),h=(0,o.v9)((e=>e.Shipping)),[y,f]=(0,n.useState)(!1),[_,C]=(0,n.useState)(!1),x=(null!==(l=(null===(i=g.orderDetails)||void 0===i?void 0:i.prepaidPrice)+(null===(r=g.orderDetails)||void 0===r?void 0:r.prepaidDiscount))&&void 0!==l?l:0).toFixed(2);let b="object"==typeof g.orderDetails.shippingAddress?g.orderDetails.shippingAddress:JSON.parse(g.orderDetails.shippingAddress);(0,n.useEffect)((()=>{g.paymentModal=!1,g.upiCollectOpen=!1,g.verifyingPayment=!1,window.scrollTo(0,0),e.onRender()}),[]);const A=null!=p&&null!==(s=p.sellerConfig)&&void 0!==s&&null!==(u=s.uiConfig)&&void 0!==u&&null!==(c=u.customConfig)&&void 0!==c&&c.bodyBgColor?"var(--whole-body-color)":"var(--body-bg-color)";return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{className:"OrderPending_wholeContainer__Zr3Yb",style:{paddingLeft:"20px",background:A},children:[(0,d.jsxs)("div",{className:"OrderPending_orderSummaryContainer__6pg5c",style:{background:"#ffedd8",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"8px"},children:[(0,d.jsx)("div",{children:(0,d.jsx)("img",{src:"./assets/images/OrderPending.svg",alt:"edit-icon",style:{marginTop:"10px"},height:52,width:52})}),(0,d.jsx)("div",{className:"OrderPending_subheading1__fACo4",style:{fontSize:"16px"},children:"Order Pending !! "}),(0,d.jsx)("div",{className:"OrderPending_container1__xSCgs",style:{display:"flex",justifyContent:"center",color:"black",fontSize:"12px",marginTop:"10px"},children:(0,d.jsx)("p",{style:{width:"90%",lineHeight:"14px"},children:null!=g&&g.isPaymentSuccess?"Your payment of ".concat(x," is received, and order status is pending. If we are unable to process it, a refund will be issued within 3-4 business days."):"Your order is currently pending. If we are unable to process it, a refund will be issued within 3-4 business days."})})]}),(0,d.jsxs)("div",{className:"OrderPending_lowerContainer__x9z4i",style:{margin:"10px 5px"},children:[(0,d.jsxs)("div",{className:"",children:[(0,d.jsx)("p",{className:"h2 bold mb-10",children:"Order Details"}),(0,d.jsx)("p",{className:"h3 grey-dark semi-bold mb-3",children:"\n ".concat(null!=b&&b.firstName?null==b?void 0:b.firstName:"Customer"," \n ").concat(null!=b&&b.lastName?null==b?void 0:b.lastName:"","\n ")}),(0,d.jsx)("p",{className:"h4 grey-dark light max-wid80 mb-10",children:"\n ".concat(null!=b&&b.line1?null==b?void 0:b.line1:""," \n ").concat(null!=b&&b.line2?null==b?void 0:b.line2:"","\n ").concat(null!=b&&b.city?null==b?void 0:b.city:"","\n ").concat(null!=b&&b.state?null==b?void 0:b.state:"","\n ").concat(null!=b&&b.pincode?null==b?void 0:b.pincode:"","\n ")}),(null==h||null===(v=h.selected_service_data)||void 0===v?void 0:v.edd)&&(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[(0,d.jsx)("p",{children:(0,d.jsx)("img",{src:"./assets/images/deliveryIcon.svg",alt:"delivery-icon",height:17,width:17})}),(0,d.jsxs)("p",{className:"h4 grey-dark light",children:[null==h||null===(m=h.selected_service_data)||void 0===m?void 0:m.edd," ",(0,d.jsx)("span",{style:{color:"#FD5530",fontWeight:"500",fontSize:"12px"},children:"(To be confirmed)"})]})]})})]}),(0,d.jsx)("div",{className:"OrderPending_pullMargin__PJerF",style:{margin:"0px -24px"},children:(0,d.jsx)(t.Z,{showItems:!0,orderSummaryModalVisible:y,setOrderSummaryModalVisible:f,showDetails:_,setShowDetails:C})}),(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[!(null!=g&&g.isPaymentSuccess)&&(0,d.jsx)("button",{className:"OrderPending_retryButton__AvhUt",onClick:()=>{var l,i,n;(0,a.kf)({name:"Retry_Payment_pending",domain:null===(l=p.sellerConfig)||void 0===l?void 0:l.domainName,payload:{cart_id:null==g||null===(i=g.Cart_data)||void 0===i?void 0:i.id,otpLess:null==p||null===(n=p.sellerConfig)||void 0===n?void 0:n.enabledFeatureCodForm}}),g.upiIdEntryDrawer=!1,g.paymentProcessing=!1,p.paymentPageReached=!0,g.verifyingPayment=!1,g.orderPending=!1,g.paymentMethodsFetched=!1,clearInterval(p.upiIntervalID),clearInterval(null==p?void 0:p.razorpayIntervalID),clearInterval(null==p?void 0:p.optionalPaymentIntervalId),clearInterval(p.easeBuzzIntervalID),e.onRender()},children:"Retry payment"}),(0,d.jsx)("button",{className:"OrderPending_continueShopping__Ly6Hp",onClick:()=>{window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"headlessClose",data:{}}]},"*")},children:"Continue shopping"})]}),(0,d.jsxs)("div",{style:{color:"#9B9B9B",fontSize:"10px",lineHeight:"12px"},children:[(0,d.jsx)("span",{style:{fontWeight:"bold"},children:"Note: "}),"For any questions, please feel free to contact our customer support. Thank you for shopping with us!"]})]})]})})}},7965:(e,l,i)=>{i.d(l,{Z:()=>s});var n=i(7313),t=(i(5896),i(8018)),o=i(6352),a=i(6417);const d=e=>{var l,i;const n=(0,o.v9)((e=>e.Login));return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"pt-18 pb-12 bb-1 row",onClick:l=>{e.onSelectShippingMethod(e),e.SetIsOpen(!1)},children:[(0,a.jsx)("input",{type:"radio",defaultChecked:e.name===e.selectedShipping.name,className:"sr-radio",name:"address",id:e.id}),(0,a.jsxs)("label",{htmlFor:e.id,className:"sr-label font-14 primary bold",children:[(0,a.jsx)("span",{className:"circle",children:(0,a.jsx)("span",{className:"circle-dot"})}),(0,a.jsxs)("div",{className:"full-width pl-20",children:[(0,a.jsxs)("p",{children:[" ","Serviceability_not_confirmed"===e.name.replace("Pickrr-","")?"Standard":e.name.replace("Pickrr-","")," Delivery"]}),(0,a.jsxs)("p",{className:"bld r-top",children:[" ",e.price?(0,a.jsxs)(a.Fragment,{children:["₹",null==e||null===(l=e.price)||void 0===l?void 0:l.toFixed(2)]}):"odette.in"===(null==n||null===(i=n.sellerConfig)||void 0===i?void 0:i.domainName)?"FREE SHIPPING":"FREE"]}),e.date&&(0,a.jsx)("p",{className:"font-12 lft20 grey deiveryTime mb-15 delivery-time",children:e.date})]})]})]})})},r=n.memo(d),s=e=>{var l,i,d,s,u,c;const v=(0,o.v9)((e=>e.Shipping)),m=(0,o.v9)((e=>e.Login)),[g,p]=(0,n.useState)(!1);let h,y=v.service_data;return y.length>0&&(h=y.map(((l,i)=>(0,a.jsx)(r,{onSelectShippingMethod:e.onSelectShippingMethod,SetIsOpen:e.SetIsOpen,name:null==l?void 0:l.pickrr_tag,price:l.charges,date:null!=l&&l.edd?l.edd:null,msg:l.edd_message,id:i,selectedShipping:e.selectedShipping,shippingObject:l},i)))),(0,a.jsx)(a.Fragment,{children:g?(0,a.jsx)("section",{className:"otp",children:(0,a.jsx)(t.Z,{onSelectAddressMethod:e.onSelectAddressMethod,addressToShow:e.addressToShow,setAddressToShow:e.setAddressToShow,SetIsOpen:e.SetIsOpen,onClose:()=>{e.onClose()},onRender:e.onRender,onRenderLoading:e.onRenderLoading,SetTitle:e.SetTitle})}):(0,a.jsx)("section",{children:(0,a.jsxs)("div",{className:"whole-container",children:[(0,a.jsx)("div",{className:"d-flex space-between",children:(0,a.jsx)("p",{className:"bold font-16 primary",style:{fontWeight:"700"},children:null!==(l=m.sellerConfig)&&void 0!==l&&null!==(i=l.uiConfig)&&void 0!==i&&null!==(d=i.address)&&void 0!==d&&d.label?null===(s=m.sellerConfig)||void 0===s||null===(u=s.uiConfig)||void 0===u||null===(c=u.address)||void 0===c?void 0:c.label:"Deliver to"})}),(0,a.jsx)("p",{className:"font-16 customerAddress mt-10"}),(0,a.jsx)("div",{className:"mb-5",children:(0,a.jsx)("label",{className:"h3 grey-dark semi-bold capitalize",children:e.addressToShow.name})}),(0,a.jsx)("div",{className:"mb-18 max-wid80",children:(0,a.jsx)("label",{className:"h4 grey-dark light",style:{overflowWrap:"break-word",width:"90%",fontWeight:"400"},children:e.addressToShow.address})}),(0,a.jsx)("p",{className:"bold h2 primary",children:"Delivery options"}),h]})})})}},528:(e,l,i)=>{i.d(l,{Z:()=>o}),i(7313);var n=i(3061),t=i(6417);const o=e=>(0,t.jsx)("button",{id:e.id,disabled:e.disabled,className:(0,n.Z)(e.isCardDesign?"Button_buttonCard__wz0fG":"Button_button__KXFVC",e.className,e.outline?"Button_outlineButton__LO7cb":""),onClick:e.onClick,style:{borderRadius:e.borderRadius?e.borderRadius:""},children:e.children})},9369:(e,l,i)=>{i.d(l,{Z:()=>y});var n=i(7313);const t="Input_input__70SE0",o="Input_antInput__N-D6-",a="Input_errorSpanParent__99swF",d="Input_errorSpan__J9mAg",r="Input_errorSpanRight__X249U",s="Input_asterisk__5MC4S",u="Input_textareaCharCount__ZqFbV";var c=i(3061),v=i(4227),m=i(6933),g=i(6352),p=i(6417);const{TextArea:h}=v.Z,y=e=>{(0,n.useRef)(null),(0,n.useRef)(null);const[l,i]=(0,n.useState)(!1),[y,f]=(0,n.useState)(!1),[_,C]=(0,n.useState)(e.value&&"string"==typeof e.value?e.value.length:0),x=(0,g.v9)((e=>e.Cart));(0,n.useEffect)((()=>{e.touched&&i(!0)}),[e.touched]);const b=()=>{i(!0),f(!1),null!=e.onBlur&&e.onBlur()},A=()=>{var l;f(!0),(null===(l=e.skippedArray)||void 0===l?void 0:l.length)>0&&e.setSkipErrorField(e.skippedArray)},E=l=>{if(e.showCount){const e=l.target.value;C(e.length)}e.onChange&&e.onChange(l)};return(0,p.jsxs)("div",{className:(0,c.Z)(null!=x&&x.cardDesignEnabled?"Input_fieldContainerCard__e94eQ":"Input_fieldContainer__dmJkV",e.className),style:{marginTop:e.marginTop?e.marginTop:"",marginRight:e.marginRight?e.marginRight:""},children:[(0,p.jsxs)("div",{className:(0,c.Z)("field d-flex text-left","Input_field__D-kbp",{Input_error__xWLuF:l&&(e.error||e.activeErrors)}),children:[null!=x&&x.cardDesignEnabled?(0,p.jsx)(p.Fragment,{children:"textarea"==e.type?(0,p.jsx)("div",{onClick:()=>{var l;e.disabled&&(null===(l=document.getElementById("pincode"))||void 0===l||l.focus())},style:{width:"100%"},children:(0,p.jsxs)(m.Z,{disabled:e.disabled,label:e.label,value:e.value,mandatory:e.mandatory,children:[(0,p.jsx)(h,{onWheel:e=>{e.target.blur()},id:e.id,name:e.name,className:o,onInput:e.onInput,onChange:E,onFocus:A,onBlur:b,value:e.value,disabled:e.disabled,autoComplete:e.autoComplete,autoSize:{maxRows:4},style:{fontFamily:"var(--font-family)",resize:"none",height:"96px",display:"flex"},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()},defaultValue:e.defaultValue,maxLength:e.maxLength&&e.maxLength}),e.maxLength&&e.showCount&&(0,p.jsxs)("div",{className:u,children:[_," / ",e.maxLength]})]})}):(0,p.jsx)("div",{onClick:()=>{var l;if("state"!==e.name&&e.disabled)null===(l=document.getElementById("pincode"))||void 0===l||l.focus();else if("state"===e.name&&!e.skipPincodeFocus){var i;null===(i=document.getElementById("pincode"))||void 0===i||i.focus()}},style:{display:"flex",flexDirection:"column",width:"100%"},children:(0,p.jsx)(m.Z,{disabled:e.disabled,label:e.label,value:e.value,mandatory:e.mandatory,children:(0,p.jsx)(v.Z,{onWheel:e=>{e.target.blur()},type:e.type,id:e.id,name:e.name,className:o,onInput:e.onInput,onChange:e.onChange,onFocus:A,onBlur:b,value:e.value,disabled:e.disabled,autoComplete:e.autoComplete,defaultValue:e.defaultValue,style:{fontFamily:"var(--font-family)"},maxLength:e.maxLength&&e.maxLength})})})}):(0,p.jsx)(p.Fragment,{children:"textarea"==e.type?(0,p.jsxs)("div",{onClick:()=>{var l;e.disabled&&(null===(l=document.getElementById("pincode"))||void 0===l||l.focus())},style:{width:"100%"},children:[(0,p.jsxs)("h5",{style:{fontFamily:"var(--font-family)",fontWeight:"400"},children:[e.mandatory&&(0,p.jsx)("span",{className:s,children:"*"}),e.label]}),(0,p.jsx)("textarea",{onWheel:e=>{e.target.blur()},id:e.id,name:e.name,className:t,onInput:e.onInput,onChange:E,onFocus:A,onBlur:b,value:e.value,disabled:e.disabled,autoComplete:e.autoComplete,style:{fontFamily:"var(--font-family)",resize:"none",height:"96px"},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()},defaultValue:e.defaultValue,maxLength:e.maxLength&&e.maxLength}),e.maxLength&&e.showCount&&(0,p.jsxs)("div",{className:u,children:[_," / ",e.maxLength]})]}):(0,p.jsxs)("div",{onClick:()=>{var l;if("state"!==e.name&&e.disabled)null===(l=document.getElementById("pincode"))||void 0===l||l.focus();else if("state"===e.name&&!e.skipPincodeFocus){var i;null===(i=document.getElementById("pincode"))||void 0===i||i.focus()}},style:{display:"flex",flexDirection:"column",width:"100%"},children:[(0,p.jsxs)("h5",{style:{fontWeight:"400",fontFamily:"var(--font-family)"},children:[e.mandatory&&(0,p.jsx)("span",{className:s,children:"*"}),e.label]}),(0,p.jsx)("input",{onWheel:e=>{e.target.blur()},type:e.type,id:e.id,name:e.name,placeholder:e.placeholder,className:t,onInput:e.onInput,onChange:e.onChange,onFocus:A,onBlur:b,value:e.value,disabled:e.disabled,autoComplete:e.autoComplete,defaultValue:e.defaultValue,style:{fontFamily:"var(--font-family)"},maxLength:e.maxLength&&e.maxLength,onPaste:l=>{if(e.pasteNotAllowed)return l.preventDefault(),!1}})]})}),e.loading?(0,p.jsx)("div",{className:null!=x&&x.cardDesignEnabled?"Input_spinnerContainerCard__EFqwf":"Input_spinnerContainer__HHz1f",style:{marginTop:null!=x&&x.cardDesignEnabled?"":"18px"},children:(0,p.jsx)("span",{className:null!=x&&x.cardDesignEnabled?"Input_spinnerCard__sBXgT":"Input_spinner__eoT+v"})}):null]}),e.activeErrors&&y?"Flat, House no., Floor, Building"==e.label||"Area, Street, Sector, Village"==e.label?(0,p.jsxs)("span",{className:a,children:[(0,p.jsx)("span",{className:d,children:e.activeErrors}),(0,p.jsxs)("span",{className:r,children:[e.lenError?e.lenError:"0","/",e.maxLength]})]}):(0,p.jsx)("span",{className:d,children:e.activeErrors}):l?"email"!==e.name?(e.error||e.activeErrors)&&("Flat, House no., Floor, Building"==e.label||"Area, Street, Sector, Village"==e.label?(0,p.jsxs)("span",{className:a,children:[(0,p.jsx)("span",{className:d,children:e.error?e.error:e.activeErrors}),(0,p.jsxs)("span",{className:r,children:[e.lenError?e.lenError:"0","/",e.maxLength]})]}):(0,p.jsx)("span",{className:d,children:e.error?e.error:e.activeErrors})):!y&&(e.error||e.activeErrors)&&(0,p.jsx)("span",{className:d,children:e.error?e.error:e.activeErrors}):null]})}},3366:(e,l,i)=>{i.d(l,{Z:()=>c});var n=i(7313);const t="Select_errorSpanParent__iTnu9",o="Select_errorSpan__qH54f",a="Select_errorSpanRight__-pyGh";var d=i(3061),r=i(6933),s=i(6352),u=i(6417);const c=e=>{(0,n.useRef)(null),(0,n.useRef)(null);const[l,i]=(0,n.useState)(!1),[c,v]=(0,n.useState)(!1),m=(0,s.v9)((e=>e.Cart));(0,n.useEffect)((()=>{e.touched&&i(!0)}),[e.touched]);const g=()=>{i(!0),v(!1),null!=e.onBlur&&e.onBlur()},p=()=>{var l;v(!0),(null===(l=e.skippedArray)||void 0===l?void 0:l.length)>0&&e.setSkipErrorField(e.skippedArray)};return console.log(e,"select props"),(0,u.jsxs)("div",{className:(0,d.Z)(null!=m&&m.cardDesignEnabled?"Select_fieldContainerCard__HjSmo":"Select_fieldContainer__Aa-3e",e.className),style:{marginTop:e.marginTop?e.marginTop:"",marginRight:e.marginRight?e.marginRight:""},children:[(0,u.jsxs)("div",{className:(0,d.Z)("field d-flex text-left","Select_field__M8+Nh",{"Select_error__aRXF-":l&&(e.error||e.activeErrors)}),children:[null!=m&&m.cardDesignEnabled?(0,u.jsx)("div",{onClick:()=>{var l;e.disabled&&(null===(l=document.getElementById("pincode"))||void 0===l||l.focus())},style:{width:"100%"},children:(0,u.jsx)(r.Z,{disabled:e.disabled,label:e.label,value:e.value,mandatory:e.mandatory,children:(0,u.jsx)("select",{className:"Select_antSelect__VYVqA",id:e.id,onFocus:p,onBlur:g,disabled:null==e?void 0:e.disabled,onChange:l=>{e.onChange(l)},value:e.value,children:null==e?void 0:e.children})})}):(0,u.jsxs)("div",{onClick:()=>{var l;e.disabled&&(null===(l=document.getElementById("pincode"))||void 0===l||l.focus())},style:{width:"100%"},children:[(0,u.jsxs)("h5",{style:{fontFamily:"var(--font-family)",fontWeight:"400"},children:[(0,u.jsx)("span",{className:"Select_asterisk__wcVXI",children:"*"}),"Gender"]}),(0,u.jsx)("select",{className:"Select_select__XPDXs",id:e.id,onFocus:p,onBlur:g,disabled:null==e?void 0:e.disabled,onChange:l=>{e.onChange(l)},value:e.value,children:null==e?void 0:e.children})]}),e.loading?(0,u.jsx)("div",{className:null!=m&&m.cardDesignEnabled?"Select_spinnerContainerCard__SCbS3":"Select_spinnerContainer__L+Jqc",style:{marginTop:null!=m&&m.cardDesignEnabled?"":"18px"},children:(0,u.jsx)("span",{className:null!=m&&m.cardDesignEnabled?"Select_spinnerCard__QhPyo":"Select_spinner__dQjpn"})}):null]}),e.activeErrors&&c?"Flat, House no., Floor, Building"==e.label||"Area, Street, Sector, Village"==e.label?(0,u.jsxs)("span",{className:t,children:[(0,u.jsx)("span",{className:o,children:e.activeErrors}),(0,u.jsxs)("span",{className:a,children:[e.lenError?e.lenError:"0","/",e.maxLength]})]}):(0,u.jsx)("span",{className:o,children:e.activeErrors}):l?"email"!==e.name?(e.error||e.activeErrors)&&("Flat, House no., Floor, Building"==e.label||"Area, Street, Sector, Village"==e.label?(0,u.jsxs)("span",{className:t,children:[(0,u.jsx)("span",{className:o,children:e.error?e.error:e.activeErrors}),(0,u.jsxs)("span",{className:a,children:[e.lenError?e.lenError:"0","/",e.maxLength]})]}):(0,u.jsx)("span",{className:o,children:e.error?e.error:e.activeErrors})):!c&&(0,u.jsx)("span",{className:o,children:e.error?e.error:e.activeErrors}):null]})}},3960:(e,l,i)=>{i.d(l,{Z:()=>u});var n=i(7313),t=i(6417);const o={color:"#FF0000",fontSize:"12px"},a={color:"#008000",fontSize:"12px"},d={color:"#000000",fontSize:"12px"},r={color:"darkgrey",textAlign:"center",marginTop:"100px",fontSize:"14px"},s=e=>{let l;switch(e.type){case"success":l=a;break;case"normal":l=d;break;case"loading":l=r;break;case"error":l=o;break;default:l={color:"#616161",fontSize:"12px"}}return(0,t.jsx)("p",{style:l,children:e.alertMessage})},u=n.memo(s)},2855:(e,l,i)=>{i.d(l,{Z:()=>o});var n=i(6352);var t=i(6417);const o=e=>{const l=(0,n.v9)((e=>e.Cart)),i=window.location.search;let o="shiprocketLogin"==new URLSearchParams(i).get("popupType");return(0,t.jsx)("div",{className:e.largeLoader?null!=l&&l.cardDesignEnabled?"Loader_backdropLargeCard__elMoy":"Loader_backdropLarge__C3fQt":"small"===e.smallLoader?o?"Loader_loginPopupBackdropSmall__ZVK1B":null!=l&&l.cardDesignEnabled?"Loader_backdropSmallCard__Bw2zc":"Loader_backdropSmall__9UmjY":o?"Loader_loginPopupBackdrop__0L1+5":null!=l&&l.cardDesignEnabled?"Loader_backdropCard__GR2ti":"Loader_backdrop__KL3PF",style:{marginTop:e.noMarginTop?e.noMarginTop:"15px",marginLeft:e.marginLeft?e.marginLeft:"",margin:e.margin?e.margin:""}})}},3130:(e,l,i)=>{i.d(l,{Z:()=>c});var n=i(7313);const t={thankyouContainer:"Thankyou_thankyouContainer__y3qlB",thankyou__success__icon:"Thankyou_thankyou__success__icon__F-h93",thankyou__text:"Thankyou_thankyou__text__a85p8",order_id:"Thankyou_order_id__zZBx-",text:"Thankyou_text__nl2Pz",divder:"Thankyou_divder__dG5xl",order_details:"Thankyou_order_details__8Pgq7",heading:"Thankyou_heading__7IZOx",userDetails:"Thankyou_userDetails__YypVj",servicebility:"Thankyou_servicebility__PSMx3",itemImg:"Thankyou_itemImg__whV-B",productName:"Thankyou_productName__PS3mN",description:"Thankyou_description__cxlKC",itemDetails:"Thankyou_itemDetails__+a7J0",itemCart:"Thankyou_itemCart__H-JQn",productPrice:"Thankyou_productPrice__6Xjdk",amountContainer:"Thankyou_amountContainer__SEtl5",ammountDescription:"Thankyou_ammountDescription__ZrQEO",textBold:"Thankyou_textBold__I7a9a",button:"Thankyou_button__A7sg3"};var o=i(6352),a=i(7075),d=i(9563),r=i(1805),s=i(5763),u=i(6417);const c=e=>{var l,i,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de;const re=(0,o.v9)((e=>e.Cart)),se=(0,o.v9)((e=>e.Address)),ue=(0,o.v9)((e=>e.Login)),ce=(0,o.v9)((e=>e.Shipping)),ve=(0,o.v9)((e=>e.Otp)),me=(re.initialCartData,(0,o.v9)((e=>e.Coupon))),ge=(e,l)=>(e.setMinutes(e.getMinutes()+l),e);(0,n.useEffect)((()=>{var l,i;if(re.paymentModal=!1,!re.isAfterSellCookieSet)if(re.isAfterSellCookieSet=!0,!e.isUpsell&&null!=ue&&null!==(l=ue.sellerConfig)&&void 0!==l&&null!==(i=l.aftersellConfig)&&void 0!==i&&i.isEnabled){var n,t,o,a,d,r,s,u,c,v,m,g,p,h,y,f,_,C;let e=null==re||null===(n=re.orderDetails)||void 0===n||null===(t=n.lineItems)||void 0===t?void 0:t.map((e=>({id:e.productId,variants:[e.itemId],quantity:e.quantity})));window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrAfterSellData",data:JSON.stringify({phoneNo:null==re||null===(o=re.orderDetails)||void 0===o||null===(a=o.shippingAddress)||void 0===a?void 0:a.phone,cartTotal:"COD"===se.selectedPaymentMode||re.payPartialCod?null==re||null===(d=re.orderDetails)||void 0===d?void 0:d.codPrice:null==re||null===(r=re.orderDetails)||void 0===r?void 0:r.prepaidPrice,variantArray:e}),time:ge(new Date,0===(null==ue||null===(s=ue.sellerConfig)||void 0===s||null===(u=s.aftersellConfig)||void 0===u?void 0:u.time)?5:null==ue||null===(c=ue.sellerConfig)||void 0===c||null===(v=c.aftersellConfig)||void 0===v?void 0:v.time)}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTime",data:ge(new Date,0===(null==ue||null===(m=ue.sellerConfig)||void 0===m||null===(g=m.aftersellConfig)||void 0===g?void 0:g.time)?5:null==ue||null===(p=ue.sellerConfig)||void 0===p||null===(h=p.aftersellConfig)||void 0===h?void 0:h.time),time:ge(new Date,0===(null==ue||null===(y=ue.sellerConfig)||void 0===y||null===(f=y.aftersellConfig)||void 0===f?void 0:f.time)?5:null==ue||null===(_=ue.sellerConfig)||void 0===_||null===(C=_.aftersellConfig)||void 0===C?void 0:C.time)}},"*")}else window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrAfterSellData",data:{},time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTime",data:{},time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"isUpsellFastrr",data:{},time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*")}),[]),(0,n.useEffect)((()=>{var e,l,i,n,t,o,a,d,r,s,u,c,v,m,g,p,h,y;re.isCtpCookieSet||(re.isCtpCookieSet=!0,("COD"===se.selectedPaymentMode||re.payPartialCod)&&null!==(e=ue.sellerConfig)&&void 0!==e&&null!==(l=e.codToPrepaidDiscount)&&void 0!==l&&l.is_enabled?(window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrCtpData",data:re.orderId,time:ge(new Date,0===(null===(i=ue.sellerConfig)||void 0===i||null===(n=i.codToPrepaidDiscount)||void 0===n?void 0:n.time)?5:null===(t=ue.sellerConfig)||void 0===t||null===(o=t.codToPrepaidDiscount)||void 0===o?void 0:o.time)}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTimeCtp",data:ge(new Date,0===(null===(a=ue.sellerConfig)||void 0===a||null===(d=a.codToPrepaidDiscount)||void 0===d?void 0:d.time)?5:null===(r=ue.sellerConfig)||void 0===r||null===(s=r.codToPrepaidDiscount)||void 0===s?void 0:s.time),time:ge(new Date,0===(null===(u=ue.sellerConfig)||void 0===u||null===(c=u.codToPrepaidDiscount)||void 0===c?void 0:c.time)?5:null===(v=ue.sellerConfig)||void 0===v||null===(m=v.codToPrepaidDiscount)||void 0===m?void 0:m.time)}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrSellerId",data:ue.sellerConfig.seller_id,time:ge(new Date,0===(null===(g=ue.sellerConfig)||void 0===g||null===(p=g.codToPrepaidDiscount)||void 0===p?void 0:p.time)?5:null===(h=ue.sellerConfig)||void 0===h||null===(y=h.codToPrepaidDiscount)||void 0===y?void 0:y.time)}},"*")):(window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrCtpData",data:"",time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTimeCtp",data:"",time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrSellerId",data:"",time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*")))}),[]);const pe=null===(l=re.orderDetails)||void 0===l||null===(i=l.lineItems)||void 0===i?void 0:i.map((e=>{var l;return(0,u.jsxs)("div",{className:t.itemCart,children:[(0,u.jsx)("div",{className:t.itemImg,children:(0,u.jsx)("img",{src:null==e?void 0:e.imageUrl,alt:null==e?void 0:e.name})}),(0,u.jsxs)("div",{className:t.itemDetails,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{className:t.productName,children:null==e?void 0:e.name}),(0,u.jsxs)("div",{className:t.description,children:["Qty: ",null==e?void 0:e.quantity]})]}),(0,u.jsxs)("div",{className:t.productPrice,children:["₹",null==e||null===(l=e.price)||void 0===l?void 0:l.toFixed(2)]})]})]})})),he="".concat(null===(c=re.orderDetails)||void 0===c||null===(v=c.shippingAddress)||void 0===v?void 0:v.firstName," ").concat(null===(m=re.orderDetails)||void 0===m||null===(g=m.shippingAddress)||void 0===g?void 0:g.lastName),ye=(null==re||null===(p=re.orderDetails)||void 0===p||null===(h=p.shippingAddress)||void 0===h?void 0:h.line1)+(null!=re&&null!==(y=re.orderDetails)&&void 0!==y&&null!==(f=y.shippingAddress)&&void 0!==f&&f.line2?null==re||null===(_=re.orderDetails)||void 0===_||null===(C=_.shippingAddress)||void 0===C?void 0:C.line2:""),fe=null==re||null===(x=re.orderDetails)||void 0===x||null===(b=x.shippingAddress)||void 0===b?void 0:b.city,_e=null==re||null===(A=re.orderDetails)||void 0===A||null===(E=A.shippingAddress)||void 0===E?void 0:E.pincode,Ce=null==re||null===(S=re.orderDetails)||void 0===S||null===(D=S.shippingAddress)||void 0===D?void 0:D.state,xe=null==re||null===(w=re.orderDetails)||void 0===w||null===(N=w.shippingAddress)||void 0===N?void 0:N.email,be=10===(null==re||null===(I=re.orderDetails)||void 0===I||null===(k=I.shippingAddress)||void 0===k||null===(T=k.phone)||void 0===T?void 0:T.length)?"+91".concat(null==re||null===(P=re.orderDetails)||void 0===P||null===(j=P.shippingAddress)||void 0===j?void 0:j.phone):null==re||null===(F=re.orderDetails)||void 0===F||null===(R=F.shippingAddress)||void 0===R?void 0:R.phone,Ae=null!==(L=ce.selected_service_data)&&void 0!==L&&L.edd?"".concat(null===(O=(0,d._7)(null===(M=ce.selected_service_data)||void 0===M?void 0:M.edd))||void 0===O?void 0:O.format("dddd"),", ").concat(null===(U=(0,d._7)(null===(Z=ce.selected_service_data)||void 0===Z?void 0:Z.edd))||void 0===U?void 0:U.format("MMM DD YYYY")):"",Ee=null==re||null===(B=re.orderDetails)||void 0===B?void 0:B.shippingCharges;return(0,n.useEffect)((()=>{var e;let l=[];l.push({action:"clearCart",data:{domain:null===(e=ue.sellerConfig)||void 0===e?void 0:e.domainName}}),window.parent.postMessage({trigger:"clear-cart",actions:l},"*")}),[]),(0,n.useEffect)((()=>{var e,l,i;null!=re&&re.isAnalyticsCookie||(re.isAnalyticsCookie=!0,window.parent.postMessage({trigger:"set-analytics-cookie",data:{name:"analyticsData",data:{name:null==re||null===(e=re.orderDetails)||void 0===e?void 0:e.clientOrderId,value:"COD"===(null==se?void 0:se.selectedPaymentMode)||re.payPartialCod?null==re||null===(l=re.orderDetails)||void 0===l?void 0:l.codPrice:null==re||null===(i=re.orderDetails)||void 0===i?void 0:i.prepaidPrice},time:ge(new Date,5)}},"*"))}),[]),(0,n.useEffect)((()=>{var e,l,i,n,t,o,d,r;if((re.upiPaymentStatus||re.razorPaymentStatus)&&(re.upiPaymentStatus=!1,a.Z.addPaymentInfo(re.orderDetails,null==ue||null===(e=ue.sellerConfig)||void 0===e||null===(l=e.marketingConfig)||void 0===l||null===(i=l.facebook)||void 0===i?void 0:i.events),null!=ue&&null!==(n=ue.sellerConfig)&&void 0!==n&&null!==(t=n.marketingConfig)&&void 0!==t&&null!==(o=t.ga4)&&void 0!==o&&null!==(d=o.events)&&void 0!==d&&d.payment_initiated&&(null==ue||null===(r=ue.sellerConfig)||void 0===r||!r.enableGa4MpEvents))){var u,c,v,m,g,p,h,y,f,_;const e={event:"add_payment_info",data:{event_category:"ecommerce",send_to:null==ue||null===(u=ue.sellerConfig)||void 0===u||null===(c=u.marketingConfig)||void 0===c||null===(v=c.ga4)||void 0===v?void 0:v.measurement_id,currency:"INR",value:((null==re||null===(m=re.orderDetails)||void 0===m?void 0:m.totalPrice)||0)+((null===(g=ce.selected_service_data)||void 0===g?void 0:g.charges)||0)+((null==re||null===(p=re.orderDetails)||void 0===p?void 0:p.totaltax)||0)-((null==re||null===(h=re.orderDetails)||void 0===h?void 0:h.prepaidDiscount)||0)-((null==re||null===(y=re.orderDetails)||void 0===y?void 0:y.couponDiscount)||0),items:null==re||null===(f=re.Cart_data)||void 0===f||null===(_=f.items)||void 0===_?void 0:_.map((e=>({id:(0,s.Wv)(e),name:null==e?void 0:e.name,variant:"",brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),payment_type:re.activePaymentGateway,coupon:null==me?void 0:me.couponCode}};window.parent.postMessage({trigger:"gtag",data:e},"*"),console.log("ADD-PAYMENT-INFO-GA-EVENT-FIRED eventData------\x3e",e)}}),[re.upiPaymentStatus]),(0,n.useEffect)((()=>{var e,l,i,n,t,o,u,c,v,m,g,p,h,y,f,_,C,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe,je,Fe,Re,Le,Oe,Me,Ue,Ze,Be,He,Ve,Ge,We,qe,ze,Ye,Qe,Je,Ke,$e,Xe,el,ll,il,nl,tl,ol,al,dl,rl,sl,ul,cl,vl,ml,gl,pl,hl,yl;if(a.Z.orderPlaced(null==ue?void 0:ue.mobileNumber,null==re?void 0:re.Cart_data,se.selectedAddress,null==me?void 0:me.couponCode,null==re?void 0:re.orderDetails,re.paymentMethodType,ce,null==se?void 0:se.selectedPaymentMode,re.clientOrderId,re.payPartialCod,null==re?void 0:re.transaction_ID,null==ue||null===(e=ue.sellerConfig)||void 0===e?void 0:e.marketingConfig,ce.platformCustomerId),null!=ue&&null!==(l=ue.sellerConfig)&&void 0!==l&&l.enableGtmEventParentFrame){var fl,_l,Cl,xl,bl,Al,El,Sl,Dl,wl,Nl,Il,kl,Tl,Pl,jl,Fl,Rl,Ll,Ol,Ml,Ul,Zl,Bl;let e={event:"order-placed",phone_num:(0,d.un)(null!==(fl=null==ue?void 0:ue.mobileNumber)&&void 0!==fl?fl:ve.mobile_no),firstName:null!==(_l=null===(Cl=se.selectedAddress)||void 0===Cl?void 0:Cl.firstName)&&void 0!==_l?_l:"",LastName:null!==(xl=null===(bl=se.selectedAddress)||void 0===bl?void 0:bl.lastName)&&void 0!==xl?xl:"",email:null!==(Al=null===(El=se.selectedAddress)||void 0===El?void 0:El.email)&&void 0!==Al?Al:"",fullName:null!==(Sl=null===(Dl=se.selectedAddress)||void 0===Dl?void 0:Dl.fullName)&&void 0!==Sl?Sl:"",city:null===(wl=se.selectedAddress)||void 0===wl?void 0:wl.city,state:null===(Nl=se.selectedAddress)||void 0===Nl?void 0:Nl.state,pincode:null===(Il=se.selectedAddress)||void 0===Il?void 0:Il.pincode,country:"in",Shopify_Customerid:ce.platformCustomerId,ecommerce:{currency:"INR",value:"COD"===(null==se?void 0:se.selectedPaymentMode)?null==re||null===(kl=re.orderDetails)||void 0===kl?void 0:kl.codPrice:null==re||null===(Tl=re.orderDetails)||void 0===Tl?void 0:Tl.prepaidPrice,coupon:null==me?void 0:me.couponCode,tax:null!==(Pl=null==re||null===(jl=re.Cart_data)||void 0===jl?void 0:jl.totalTax)&&void 0!==Pl?Pl:null==re||null===(Fl=re.orderDetails)||void 0===Fl?void 0:Fl.totalTax,shipping:null==re||null===(Rl=re.orderDetails)||void 0===Rl?void 0:Rl.shippingCharges,transaction_id:null==re||null===(Ll=re.orderDetails)||void 0===Ll?void 0:Ll.clientOrderId,paymentType:re.paymentMethodType,shipping_tier:null==ce||null===(Ol=ce.selected_service_data)||void 0===Ol?void 0:Ol.pickrr_tag,items:null!==(Ml=null==re||null===(Ul=re.Cart_data)||void 0===Ul||null===(Zl=Ul.items)||void 0===Zl?void 0:Zl.map((e=>{var l,i;const n=null==re||null===(l=re.Cart_data)||void 0===l||null===(i=l.items)||void 0===i?void 0:i.find((l=>l.productId==e.productId));return null!=n&&n.vendor?{...e,vendor:null==n?void 0:n.vendor}:{...e}})))&&void 0!==Ml?Ml:null==re||null===(Bl=re.orderDetails)||void 0===Bl?void 0:Bl.lineItems.map((e=>{var l,i;const n=null==re||null===(l=re.Cart_data)||void 0===l||null===(i=l.items)||void 0===i?void 0:i.find((l=>l.productId==e.productId));return null!=n&&n.vendor?{...e,vendor:null==n?void 0:n.vendor}:{...e}}))}};window.parent.postMessage({trigger:"gtm-events",data:e},"*")}if(null==re||null===(i=re.orderDetails)||void 0===i||null===(n=i.lineItems)||void 0===n||n.map((e=>null==e?void 0:e.productId)),a.Z.orderSuccessScreenOpened(),null==re||null===(t=re.orderDetails)||void 0===t||t.clientOrderId,null==re||null===(o=re.Cart_data)||void 0===o||o.id,null==re||null===(u=re.orderDetails)||void 0===u||u.totalPrice,"COD"===(null==se?void 0:se.selectedPaymentMode)?null!=me&&me.couponCode&&(null==re||null===(c=re.orderDetails)||void 0===c||c.couponDiscount):null!=me&&me.couponCode?(null==re||null===(v=re.orderDetails)||void 0===v||v.couponDiscount,null==re||null===(m=re.orderDetails)||void 0===m||m.prepaidDiscount):null==re||null===(g=re.orderDetails)||void 0===g||g.prepaidDiscount,null==re||null===(p=re.orderDetails)||void 0===p||p.totalTax,null==se||se.selectedPaymentMode,null==me||me.couponCode,"COD"==(null==se?void 0:se.selectedPaymentMode)&&(null==re||null===(h=re.orderDetails)||void 0===h||null===(y=h.codCharges)||void 0===y||y.toFixed(2)),null==se||se.selectedPaymentMode,null==re||re.orderDetails,null!=ue&&null!==(f=ue.sellerConfig)&&void 0!==f&&null!==(_=f.marketingConfig)&&void 0!==_&&null!==(C=_.facebook)&&void 0!==C&&null!==(x=C.pixel_array)&&void 0!==x&&x.length)null==ue||null===(gl=ue.sellerConfig)||void 0===gl||null===(pl=gl.marketingConfig)||void 0===pl||null===(hl=pl.facebook)||void 0===hl||null===(yl=hl.pixel_array)||void 0===yl||yl.map((e=>{var l,i,n,t,o;a.Z.initialiseAnalytics("",null==e?void 0:e.pixel_id,"","",null!==(l=null==re||null===(i=re.Cart_data)||void 0===i?void 0:i.id)&&void 0!==l?l:null==me||null===(n=me.data)||void 0===n?void 0:n.id,se.selectedAddress,"onlyPixel",null===(t=se.selectedAddress)||void 0===t?void 0:t.firstName,null===(o=se.selectedAddress)||void 0===o?void 0:o.lastName)}));else if(null!=ue&&null!==(b=ue.sellerConfig)&&void 0!==b&&null!==(A=b.marketingConfig)&&void 0!==A&&null!==(E=A.facebook)&&void 0!==E&&E.pixel_id){var Hl,Vl,Gl,Wl,ql,zl,Yl,Ql;a.Z.initialiseAnalytics("",null==ue||null===(Hl=ue.sellerConfig)||void 0===Hl||null===(Vl=Hl.marketingConfig)||void 0===Vl||null===(Gl=Vl.facebook)||void 0===Gl?void 0:Gl.pixel_id,"","",null!==(Wl=null==re||null===(ql=re.Cart_data)||void 0===ql?void 0:ql.id)&&void 0!==Wl?Wl:null==me||null===(zl=me.data)||void 0===zl?void 0:zl.id,se.selectedAddress,"onlyPixel",null===(Yl=se.selectedAddress)||void 0===Yl?void 0:Yl.firstName,null===(Ql=se.selectedAddress)||void 0===Ql?void 0:Ql.lastName)}const Jl=null==ue||null===(S=ue.sellerConfig)||void 0===S||null===(D=S.marketingConfig)||void 0===D||null===(w=D.facebook)||void 0===w?void 0:w.enable_content_id,Kl=null==ue||null===(N=ue.sellerConfig)||void 0===N||null===(I=N.marketingConfig)||void 0===I||null===(k=I.facebook)||void 0===k?void 0:k.content_id,$l={content_ids:null!=re&&null!==(T=re.Cart_data)&&void 0!==T&&null!==(P=T.items)&&void 0!==P&&P.length?null==re||null===(j=re.Cart_data)||void 0===j||null===(F=j.items)||void 0===F?void 0:F.map((e=>{var l;if(!Jl)return null==e?void 0:e.productId;switch(Kl){case"sku":return(null==e?void 0:e.channel.toUpperCase())===(null===r.ZW||void 0===r.ZW?void 0:r.ZW.magento)?null==e||null===(l=e.customAttributes)||void 0===l?void 0:l.magentoSku:null==e?void 0:e.sku;case"product_id":default:return null==e?void 0:e.productId;case"variant_id":return null==e?void 0:e.itemId}})):[],content_type:"product_group",contents:null!=re&&null!==(R=re.Cart_data)&&void 0!==R&&null!==(L=R.items)&&void 0!==L&&L.length?null==re||null===(O=re.Cart_data)||void 0===O||null===(M=O.items)||void 0===M?void 0:M.map((e=>{var l,i;return{id:Jl?"sku"===Kl?(null==e||null===(l=e.channel)||void 0===l?void 0:l.toUpperCase())===(null===r.ZW||void 0===r.ZW?void 0:r.ZW.magento)?null==e||null===(i=e.customAttributes)||void 0===i?void 0:i.magentoSku:(null==e?void 0:e.sku)||(null==e?void 0:e.productId):"variant_id"===Kl?null==e?void 0:e.itemId:null==e?void 0:e.productId:null==e?void 0:e.productId,variant:null==e?void 0:e.itemId,name:null==e?void 0:e.name,currency:"INR",price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}})):[],currency:"INR",num_items:null==re||null===(U=re.Cart_data)||void 0===U||null===(Z=U.items)||void 0===Z?void 0:Z.length,value:"COD"===(null==se?void 0:se.selectedPaymentMode)?null==re||null===(B=re.orderDetails)||void 0===B?void 0:B.codPrice:null==re||null===(H=re.orderDetails)||void 0===H?void 0:H.prepaidPrice,ph:10===(null==re||null===(V=re.orderDetails)||void 0===V||null===(G=V.shippingAddress)||void 0===G||null===(W=G.phone)||void 0===W?void 0:W.length)?"91".concat(null==re||null===(q=re.orderDetails)||void 0===q||null===(z=q.shippingAddress)||void 0===z?void 0:z.phone):null==re||null===(Y=re.orderDetails)||void 0===Y||null===(Q=Y.shippingAddress)||void 0===Q?void 0:Q.phone,ct:null==re||null===(J=re.orderDetails)||void 0===J||null===(K=J.shippingAddress)||void 0===K||null===($=K.city)||void 0===$||null===(X=$.toLowerCase())||void 0===X?void 0:X.replace(/[^a-zA-Z0-9 ]|\s/g,""),country:"in",st:null==re||null===(ee=re.orderDetails)||void 0===ee||null===(le=ee.shippingAddress)||void 0===le||null===(ie=le.state)||void 0===ie||null===(ne=ie.toLowerCase())||void 0===ne?void 0:ne.replace(/[^a-zA-Z0-9 ]|\s/g,""),zp:null==re||null===(te=re.orderDetails)||void 0===te||null===(oe=te.shippingAddress)||void 0===oe?void 0:oe.pincode,fn:null==re||null===(ae=re.orderDetails)||void 0===ae||null===(de=ae.shippingAddress)||void 0===de?void 0:de.firstName,ln:null==re||null===(ge=re.orderDetails)||void 0===ge||null===(pe=ge.shippingAddress)||void 0===pe?void 0:pe.lastName};a.Z.purchase($l,null==ue||null===(he=ue.sellerConfig)||void 0===he||null===(ye=he.marketingConfig)||void 0===ye||null===(fe=ye.facebook)||void 0===fe?void 0:fe.events,"COD"!==(null==se?void 0:se.selectedPaymentMode));const Xl={event:"purchase",data:{event_category:"ecommerce",transaction_id:(null==re||null===(_e=re.orderDetails)||void 0===_e?void 0:_e.clientOrderId)||(null==re||null===(Ce=re.orderDetails)||void 0===Ce?void 0:Ce.id),currency:"INR",value:"COD"===se.selectedPaymentMode?null==re||null===(xe=re.orderDetails)||void 0===xe?void 0:xe.codPrice:null!==(be=null==re||null===(Ae=re.orderDetails)||void 0===Ae?void 0:Ae.prepaidPrice)&&void 0!==be?be:null==re||null===(Ee=re.Cart_data)||void 0===Ee?void 0:Ee.totalPrice,tax:null==re||null===(Se=re.orderDetails)||void 0===Se?void 0:Se.totalTax,shipping:null==re||null===(De=re.orderDetails)||void 0===De?void 0:De.shippingCharges,items:null==re||null===(we=re.Cart_data)||void 0===we?void 0:we.items.map((e=>({id:(0,s.Wv)(e),name:null==e?void 0:e.name,variant:"",brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),coupon:null==re||null===(Ne=re.orderDetails)||void 0===Ne||null===(Ie=Ne.couponData)||void 0===Ie?void 0:Ie.coupon_code}},ei={...Xl.data,items:null==re||null===(ke=re.Cart_data)||void 0===ke?void 0:ke.items.map((e=>({id:null==e?void 0:e.productId,name:null==e?void 0:e.name,variant:null==e?void 0:e.itemId,brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),payment_type:null==se?void 0:se.selectedPaymentMode,coupon_discount:null==re||null===(Te=re.orderDetails)||void 0===Te?void 0:Te.couponDiscount,phone_num:(0,d.un)(null!==(Pe=null==ue?void 0:ue.mobileNumber)&&void 0!==Pe?Pe:ve.mobile_no),city:null===(je=se.selectedAddress)||void 0===je?void 0:je.city,state:null===(Fe=se.selectedAddress)||void 0===Fe?void 0:Fe.state,pincode:null===(Re=se.selectedAddress)||void 0===Re?void 0:Re.pincode,first_name:null===(Le=se.selectedAddress)||void 0===Le?void 0:Le.firstName,last_name:null===(Oe=se.selectedAddress)||void 0===Oe?void 0:Oe.lastName,email:null===(Me=se.selectedAddress)||void 0===Me?void 0:Me.email};var li,ii,ni;(null==ue||null===(Ue=ue.sellerConfig)||void 0===Ue||null===(Ze=Ue.channel)||void 0===Ze?void 0:Ze.toUpperCase())===r.ZW.shopify&&window.parent.postMessage({trigger:"shopify-custom-events",data:{eventName:"PurchaseSR",eventData:ei}},"*"),null==ue||null===(Be=ue.sellerConfig)||void 0===Be||null===(He=Be.marketingConfig)||void 0===He||null===(Ve=He.ga4)||void 0===Ve||null===(Ge=Ve.events)||void 0===Ge||!Ge.order_placed||null!=ue&&null!==(We=ue.sellerConfig)&&void 0!==We&&We.enableGa4MpEvents||(Xl.data={...Xl.data,send_to:null==ue||null===(li=ue.sellerConfig)||void 0===li||null===(ii=li.marketingConfig)||void 0===ii||null===(ni=ii.ga4)||void 0===ni?void 0:ni.measurement_id},window.parent.postMessage({trigger:"gtag",data:Xl},"*"),console.log("PURCHASE-GA-EVENT-FIRED eventData------\x3e",Xl));var ti={...(null==re||null===(qe=re.orderDetails)||void 0===qe||null===(ze=qe.shippingAddress)||void 0===ze?void 0:ze.email)&&{email:null==re||null===(Ye=re.orderDetails)||void 0===Ye||null===(Qe=Ye.shippingAddress)||void 0===Qe?void 0:Qe.email},phone_number:(0,d.un)(null==re||null===(Je=re.orderDetails)||void 0===Je||null===(Ke=Je.shippingAddress)||void 0===Ke?void 0:Ke.phone),first_name:null==re||null===($e=re.orderDetails)||void 0===$e||null===(Xe=$e.shippingAddress)||void 0===Xe?void 0:Xe.firstName,last_name:null==re||null===(el=re.orderDetails)||void 0===el||null===(ll=el.shippingAddress)||void 0===ll?void 0:ll.lastName,home_address:{street:(null==re||null===(il=re.orderDetails)||void 0===il||null===(nl=il.shippingAddress)||void 0===nl?void 0:nl.line1)+(null!=re&&null!==(tl=re.orderDetails)&&void 0!==tl&&null!==(ol=tl.shippingAddress)&&void 0!==ol&&ol.line2?null==re||null===(al=re.orderDetails)||void 0===al||null===(dl=al.shippingAddress)||void 0===dl?void 0:dl.line2:""),city:null==re||null===(rl=re.orderDetails)||void 0===rl||null===(sl=rl.shippingAddress)||void 0===sl?void 0:sl.city,region:null==re||null===(ul=re.orderDetails)||void 0===ul||null===(cl=ul.shippingAddress)||void 0===cl?void 0:cl.state,postal_code:null==re||null===(vl=re.orderDetails)||void 0===vl||null===(ml=vl.shippingAddress)||void 0===ml?void 0:ml.pincode,country:"IN"}};function oi(){window.dataLayer.push(arguments)}console.log("enhanced_conversion_data---\x3e",ti);for(let e=0;e<(null==ue||null===(ai=ue.sellerConfig)||void 0===ai||null===(di=ai.marketingConfig)||void 0===di||null===(ri=di.gads)||void 0===ri||null===(si=ri.google_ads_array)||void 0===si?void 0:si.length);e++){var ai,di,ri,si,ui,ci,vi,mi,gi,pi,hi,yi,fi,_i,Ci,xi,bi,Ai,Ei,Si,Di,wi,Ni,Ii,ki,Ti,Pi,ji,Fi,Ri,Li,Oi,Mi,Ui,Zi,Bi,Hi,Vi,Gi,Wi,qi,zi,Yi,Qi,Ji,Ki,$i,Xi,en,ln,nn,tn;const l=document.createElement("script");document.head.appendChild(l),l.src="https://www.googletagmanager.com/gtag/js?id=".concat(null==ue||null===(ui=ue.sellerConfig)||void 0===ui||null===(ci=ui.marketingConfig)||void 0===ci||null===(vi=ci.gads)||void 0===vi||null===(mi=vi.google_ads_array)||void 0===mi?void 0:mi[e].conversion_id),l.async=!0,l.onload=()=>{var l,i,n,t,o,a,d,r,s,u,c,v,m,g,p,h,y,f,_,C,x,b;0===e&&(window.dataLayer=window.dataLayer||[],oi("js",new Date)),oi("config",null==ue||null===(l=ue.sellerConfig)||void 0===l||null===(i=l.marketingConfig)||void 0===i||null===(n=i.gads)||void 0===n||null===(t=n.google_ads_array)||void 0===t?void 0:t[e].conversion_id,{allow_enhanced_conversions:null==ue||null===(o=ue.sellerConfig)||void 0===o||null===(a=o.marketingConfig)||void 0===a||null===(d=a.gads)||void 0===d?void 0:d.enhance_conversion}),oi("event","conversion",{send_to:(null==ue||null===(r=ue.sellerConfig)||void 0===r||null===(s=r.marketingConfig)||void 0===s||null===(u=s.gads)||void 0===u||null===(c=u.google_ads_array)||void 0===c?void 0:c[e].conversion_id)+"/"+(null==ue||null===(v=ue.sellerConfig)||void 0===v||null===(m=v.marketingConfig)||void 0===m||null===(g=m.gads)||void 0===g||null===(p=g.google_ads_array)||void 0===p?void 0:p[e].conversion_label),value:((null==re||null===(h=re.orderDetails)||void 0===h?void 0:h.totalPrice)||0)+((null===(y=ce.selected_service_data)||void 0===y?void 0:y.charges)||0)+((null==re||null===(f=re.orderDetails)||void 0===f?void 0:f.totaltax)||0)-("UPI"===se.selectedPaymentMode?null==re||null===(_=re.orderDetails)||void 0===_?void 0:_.prepaidDiscount:0)+("COD"===se.selectedPaymentMode||re.payPartialCod?null==re||null===(C=re.orderDetails)||void 0===C?void 0:C.codCharges:0)-((null==re||null===(x=re.orderDetails)||void 0===x?void 0:x.couponDiscount)||0),currency:"INR",transaction_id:null==re||null===(b=re.orderDetails)||void 0===b?void 0:b.clientOrderId})};let i={...null!=re&&null!==(gi=re.orderDetails)&&void 0!==gi&&null!==(pi=gi.shippingAddress)&&void 0!==pi&&pi.email?{email:null==re||null===(hi=re.orderDetails)||void 0===hi||null===(yi=hi.shippingAddress)||void 0===yi?void 0:yi.email}:{},phone_number:(0,d.un)(null==re||null===(fi=re.orderDetails)||void 0===fi||null===(_i=fi.shippingAddress)||void 0===_i?void 0:_i.phone),first_name:null==re||null===(Ci=re.orderDetails)||void 0===Ci||null===(xi=Ci.shippingAddress)||void 0===xi?void 0:xi.firstName,last_name:null==re||null===(bi=re.orderDetails)||void 0===bi||null===(Ai=bi.shippingAddress)||void 0===Ai?void 0:Ai.lastName,home_address:{street:(null==re||null===(Ei=re.orderDetails)||void 0===Ei||null===(Si=Ei.shippingAddress)||void 0===Si?void 0:Si.line1)+(null!=re&&null!==(Di=re.orderDetails)&&void 0!==Di&&null!==(wi=Di.shippingAddress)&&void 0!==wi&&wi.line2?null==re||null===(Ni=re.orderDetails)||void 0===Ni||null===(Ii=Ni.shippingAddress)||void 0===Ii?void 0:Ii.line2:""),city:null==re||null===(ki=re.orderDetails)||void 0===ki||null===(Ti=ki.shippingAddress)||void 0===Ti?void 0:Ti.city,region:null==re||null===(Pi=re.orderDetails)||void 0===Pi||null===(ji=Pi.shippingAddress)||void 0===ji?void 0:ji.state,postal_code:null==re||null===(Fi=re.orderDetails)||void 0===Fi||null===(Ri=Fi.shippingAddress)||void 0===Ri?void 0:Ri.pincode,country:"IN"}},n={send_to:(null==ue||null===(Li=ue.sellerConfig)||void 0===Li||null===(Oi=Li.marketingConfig)||void 0===Oi||null===(Mi=Oi.gads)||void 0===Mi||null===(Ui=Mi.google_ads_array)||void 0===Ui?void 0:Ui[e].conversion_id)+"/"+(null==ue||null===(Zi=ue.sellerConfig)||void 0===Zi||null===(Bi=Zi.marketingConfig)||void 0===Bi||null===(Hi=Bi.gads)||void 0===Hi||null===(Vi=Hi.google_ads_array)||void 0===Vi?void 0:Vi[e].conversion_label),value:((null==re||null===(Gi=re.orderDetails)||void 0===Gi?void 0:Gi.totalPrice)||0)+((null===(Wi=ce.selected_service_data)||void 0===Wi?void 0:Wi.charges)||0)+((null==re||null===(qi=re.orderDetails)||void 0===qi?void 0:qi.totaltax)||0)-("UPI"===se.selectedPaymentMode?null==re||null===(zi=re.orderDetails)||void 0===zi?void 0:zi.prepaidDiscount:0)+("COD"===se.selectedPaymentMode||re.payPartialCod?null==re||null===(Yi=re.orderDetails)||void 0===Yi?void 0:Yi.codCharges:0)-((null==re||null===(Qi=re.orderDetails)||void 0===Qi?void 0:Qi.couponDiscount)||0),currency:"INR",transaction_id:(null==re||null===(Ji=re.orderDetails)||void 0===Ji?void 0:Ji.clientOrderId)||re.orderId};console.log("firing point of woo commerce orders",n),window.parent.postMessage({trigger:"convesion-gtm-event",eventName:"conversion",config:{configId:null==ue||null===(Ki=ue.sellerConfig)||void 0===Ki||null===($i=Ki.marketingConfig)||void 0===$i||null===(Xi=$i.gads)||void 0===Xi||null===(en=Xi.google_ads_array)||void 0===en?void 0:en[e].conversion_id,configObject:{allow_enhanced_conversions:null==ue||null===(ln=ue.sellerConfig)||void 0===ln||null===(nn=ln.marketingConfig)||void 0===nn||null===(tn=nn.gads)||void 0===tn?void 0:tn.enhance_conversion}},enhanced_conversion_data:i,conversionData:{...n,enhanced_conversion_data:i}},"*")}}),[]),(0,u.jsxs)("div",{className:t.thankyouContainer,children:[(0,u.jsxs)("div",{className:t.order_placed,children:[(0,u.jsx)("img",{src:"./assets/images/svg/successWoocomm.svg",alt:"success",className:t.thankyou__success__icon}),(0,u.jsx)("div",{className:t.thankyou__text,children:"Thank you!"}),(0,u.jsxs)("div",{className:t.order_id,children:["Your order ",null==re||null===(H=re.orderDetails)||void 0===H?void 0:H.clientOrderId," has been placed."]}),(0,u.jsx)("div",{className:t.text,children:(0,u.jsx)("b",{children:"PLEASE DO NOT CLOSE THIS WINDOW."})}),(0,u.jsxs)("div",{className:t.text,children:["We'll send the order confirmation to your registered ",(0,u.jsx)("br",{}),"phone number ",be,"."]}),(0,u.jsx)("div",{className:t.divder})]}),(0,u.jsxs)("div",{className:t.order_details,children:[(0,u.jsx)("div",{className:t.heading,children:"Order Details"}),(0,u.jsxs)("div",{className:t.userDetails,children:[(0,u.jsx)("div",{style:{fontWeight:500},children:he}),(0,u.jsxs)("div",{children:[ye,", ",fe,", ",Ce,(0,u.jsx)("br",{}),_e]}),xe&&(0,u.jsx)("div",{children:xe}),(0,u.jsx)("div",{children:be})]}),Ae?(0,u.jsxs)("div",{className:t.servicebility,children:[(0,u.jsx)("div",{children:(0,u.jsx)("img",{src:"./assets/images/svg/servicebility__icon.svg",alt:"success",className:t.thankyou__success__icon})}),(0,u.jsx)("div",{children:Ae})]}):"",(0,u.jsx)("div",{className:t.divder}),(0,u.jsx)("div",{className:t.lineItems,children:pe}),(0,u.jsxs)("div",{className:t.amountContainer,children:[(0,u.jsxs)("div",{className:t.ammountDescription,children:[(0,u.jsx)("div",{children:"Subtotal"}),(0,u.jsxs)("div",{className:t.textBold,children:["₹",Number(null!==(V=re.orderDetails)&&void 0!==V&&V.totalPrice?null===(G=re.orderDetails)||void 0===G?void 0:G.totalPrice:null===(W=re.Cart_data)||void 0===W?void 0:W.totalPrice).toFixed(2)]})]}),("COD"===se.selectedPaymentMode||re.payPartialCod)&&(null===(q=re.orderDetails)||void 0===q?void 0:q.codCharges)>0?(0,u.jsxs)("div",{className:t.ammountDescription,children:[(0,u.jsx)("div",{children:"COD charges"}),(0,u.jsx)("div",{className:t.textBold,children:null===(z=re.orderDetails)||void 0===z||null===(Y=z.codCharges)||void 0===Y?void 0:Y.toFixed(2)})]}):"",Ee?(0,u.jsxs)("div",{className:t.ammountDescription,children:[(0,u.jsx)("div",{children:"Shipping"}),(0,u.jsx)("div",{className:t.textBold,children:Ee>0?"₹".concat(null==Ee?void 0:Ee.toFixed(2)):"FREE"})]}):"",null!==(Q=re.orderDetails)&&void 0!==Q&&Q.totalDiscount&&"COD"!==se.selectedPaymentMode?(0,u.jsxs)("div",{className:t.ammountDescription,children:[(0,u.jsx)("div",{children:"Discount"}),(0,u.jsx)("div",{className:t.textBold,children:null!==(J=null===(K=re.orderDetails)||void 0===K||null===($=K.totalDiscount)||void 0===$?void 0:$.toFixed(2))&&void 0!==J?J:"0"})]}):"",null!==(X=re.orderDetails)&&void 0!==X&&X.couponDiscount&&("COD"===se.selectedPaymentMode||re.payPartialCod)?(0,u.jsxs)("div",{className:t.ammountDescription,children:[(0,u.jsx)("div",{children:"Discount"}),(0,u.jsx)("div",{className:t.textBold,children:null!==(ee=null===(le=re.orderDetails)||void 0===le||null===(ie=le.couponDiscount)||void 0===ie?void 0:ie.toFixed(2))&&void 0!==ee?ee:"0"})]}):"",(0,u.jsx)("div",{className:t.divder}),(0,u.jsxs)("div",{className:t.ammountDescription,children:[(0,u.jsx)("div",{className:t.textBold,style:{fontSize:14},children:"Total"}),(0,u.jsxs)("div",{className:t.textBold,style:{fontSize:14},children:["₹","COD"===se.selectedPaymentMode||re.payPartialCod?null===(ne=re.orderDetails)||void 0===ne||null===(te=ne.codPrice)||void 0===te?void 0:te.toFixed(2):null===(oe=re.orderDetails)||void 0===oe||null===(ae=oe.prepaidPrice)||void 0===ae?void 0:ae.toFixed(2)]})]})]}),!(null!=ue&&null!==(de=ue.sellerConfig)&&void 0!==de&&de.disableContinueShopping)&&(0,u.jsx)("div",{className:t.button,onClick:()=>{var e;window.parent.postMessage({trigger:"continue-shopping",data:null===(e=ue.sellerConfig)||void 0===e?void 0:e.domainName},"*")},children:"Continue Shopping"})]})]})}},7784:(e,l,i)=>{i.d(l,{Z:()=>r});var n=i(7075),t=i(6352),o=i(1608),a=i(5381),d=i(6417);const r=e=>{var l,i,r,s,u,c,v,m,g,p,h;let{show:y,phoneNumberRef:f=null}=e;const _=(0,t.v9)((e=>e.Login)),C=(0,t.v9)((e=>e.Cart)),x=(0,t.v9)((e=>e.Coupon)),b=window.location.search;let A="shiprocketLogin"==new URLSearchParams(b).get("popupType");const E=new URLSearchParams(window.location.search),S=E.get("uuid")?E.get("uuid"):null,D=!(null!=_&&_.enteredNumber)&&(null==_||null===(l=_.sellerConfig)||void 0===l||null===(i=l.festiveThemeConfig)||void 0===i?void 0:i.enabled)&&"shipping"===(null==_?void 0:_.onPage)&&y&&!(null!=_&&null!==(r=_.sellerConfig)&&void 0!==r&&r.nativeShopifyCheckout)&&!(null!=_&&_.customLogin)&&!A;return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{className:null!=C&&C.cardDesignEnabled?"whole-container-card grey-medium ":"whole-container grey-medium",children:[D&&(0,d.jsx)("div",{children:(0,d.jsx)("img",{style:{width:"100%"},src:"./assets/images/independenceDay.svg",alt:"Independence Day",onClick:()=>{var e;null==f||null===(e=f.current)||void 0===e||e.focus()}})}),"shipping"===(null==_?void 0:_.onPage)&&y&&!_.customLogin&&!A&&(0,d.jsxs)("div",{className:"bgCheckoutFeature",style:{fontSize:"12px",display:"flex",gap:"5%"},onClick:()=>{var e;null==f||null===(e=f.current)||void 0===e||e.focus()},children:[(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,d.jsx)("span",{className:"icon",children:(0,d.jsx)(a.Gt,{color:"var(--body-text-tertiary)"})}),(0,d.jsx)("span",{className:"badgeTextOldDesign",children:"Secure payments"})]}),(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,d.jsx)("span",{className:"icon",children:(0,d.jsx)(a.R7,{color:"var(--body-text-tertiary)"})}),(0,d.jsx)("span",{className:"badgeTextOldDesign",children:"Assured delivery"})]}),(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,d.jsx)("span",{className:"icon",children:(0,d.jsx)(a.qX,{color:"var(--body-text-tertiary)"})}),(0,d.jsx)("span",{className:"badgeTextOldDesign",children:"Verified seller"})]})]}),(0,d.jsxs)("div",{className:"d-flex container2 h6",style:{marginBottom:0},children:[(null==_||null===(s=_.sellerConfig)||void 0===s?void 0:s.tncUrl)&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("a",{rel:"noreferrer",href:null==_||null===(u=_.sellerConfig)||void 0===u?void 0:u.tncUrl,className:"mr-5",target:"_blank",children:"T&C"}),(0,d.jsx)("p",{children:"|"})]}),(null==_||null===(c=_.sellerConfig)||void 0===c?void 0:c.privacyPolicyUrl)&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("a",{rel:"noreferrer",href:null==_||null===(v=_.sellerConfig)||void 0===v?void 0:v.privacyPolicyUrl,className:"ml-5 mr-5",target:"_blank",children:"Privacy Policy"}),(0,d.jsx)("p",{children:"|"})]}),(null==_||null===(m=_.sellerConfig)||void 0===m?void 0:m.refundPolicyUrl)&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("a",{rel:"noreferrer",href:null==_||null===(g=_.sellerConfig)||void 0===g?void 0:g.refundPolicyUrl,className:"ml-5 mr-5",target:"_blank",children:["Refund Policy"," "]}),(0,d.jsx)("p",{children:"|"})]}),(null==_||null===(p=_.sellerConfig)||void 0===p?void 0:p.shippingPolicyUrl)&&(0,d.jsx)("a",{rel:"noreferrer",href:null==_||null===(h=_.sellerConfig)||void 0===h?void 0:h.shippingPolicyUrl,className:"ml-5 mr-5",target:"_blank",children:"Shipping Policy"})]}),(0,d.jsxs)("div",{style:{display:"flex",justifyContent:"space-around"},children:[(0,d.jsxs)("div",{className:"d-flex container2 h6",style:{marginBottom:1},children:[(0,d.jsx)("a",{rel:"noreferrer",href:"https://checkout.shiprocket.in/terms-conditions/",onClick:()=>{n.Z.additionalEvents("terms-and-conditions",null==C?void 0:C.Cart_data,x.couponCode,!!o.y.getItem("refreshToken"),!1)},className:"mr-5",target:"_blank",children:"T&C"}),(0,d.jsx)("p",{children:"|"}),(0,d.jsx)("a",{rel:"noreferrer",href:"https://www.shiprocket.in/privacy-policy/my-shiprocket/",onClick:()=>{n.Z.additionalEvents("privacy-policy",null==C?void 0:C.Cart_data,x.couponCode,!!o.y.getItem("refreshToken"),!1)},className:"ml-5 mr-5",target:"_blank",children:"Privacy Policy"}),S&&"string"==typeof S&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{children:"|"}),(0,d.jsx)("p",{className:"ml-5 mr-5",children:S})]})]}),y&&(0,d.jsxs)("div",{className:"d-flex container2 h6",style:{marginBottom:0},children:[(0,d.jsx)("p",{className:"mr-5",children:"Powered By"}),(0,d.jsx)("img",{className:"sr-logo",src:"./assets/images/SRLogoDark.png",alt:"Shiprocket"})]})]})]})})}},5763:(e,l,i)=>{i.d(l,{Wv:()=>c,JD:()=>v,G:()=>m,bX:()=>g}),i(6352);var n=i(1608),t=i(5637),o=i(2718),a=i(7083),d=i(9741),r=i(1805),s=i(8515);const u=i(1318),c=e=>{try{var l,i,n;return(null==e||null===(l=e.channel)||void 0===l?void 0:l.toUpperCase())===r.ZW.shopify?"".concat(r.Zd).concat(null==e?void 0:e.productId,"_").concat(null==e?void 0:e.itemId):(null==e||null===(i=e.channel)||void 0===i?void 0:i.toUpperCase())===r.ZW.magento?null==e||null===(n=e.customAttributes)||void 0===n?void 0:n.magentoSku:null==e?void 0:e.productId}catch(e){console.log(e)}},v=async(e,l,i,o,a,d)=>{console.log(o,"checking delivery state inside the helper function");const r=window.location.search;let s=new URLSearchParams(r);try{var u,c;let r;if(null!=l&&null!==(u=l.sellerConfig)&&void 0!==u&&u.landmarkMandatory||null==l||null===(c=l.sellerConfig)||void 0===c||!c.addressLayoutNew){var v,m,g,p,h,y,f,_,C,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L;let i=null==o?void 0:o.name,n=null==o?void 0:o.lastName;r={sellerId:null==l||null===(v=l.sellerConfig)||void 0===v?void 0:v.seller_id,address:{phone:null!==(m=null==l?void 0:l.mobileNumber)&&void 0!==m?m:"",line1:null!==(g=null==o||null===(p=o.line1)||void 0===p||null===(h=p.replace(/\n/g," "))||void 0===h?void 0:h.trim())&&void 0!==g?g:"",line2:null!==(y=null==o||null===(f=o.line2)||void 0===f||null===(_=f.replace(/\n/g," "))||void 0===_?void 0:_.trim())&&void 0!==y?y:"",gender:null!==(C=null==o?void 0:o.gender)&&void 0!==C?C:"",city:null!==(x=null==o||null===(b=o.city)||void 0===b?void 0:b.trim())&&void 0!==x?x:"",pincode:null!==(A=null==o?void 0:o.pincode)&&void 0!==A?A:"",state:null!==(E=null==o||null===(S=o.Pincode_data)||void 0===S||null===(D=S.postcode_details)||void 0===D?void 0:D.state)&&void 0!==E?E:"",country:"IN",sellerID:null!==(w=null==l||null===(N=l.sellerConfig)||void 0===N?void 0:N.seller_id)&&void 0!==w?w:"",landmark:null!==(I=null==o||null===(k=o.landmark)||void 0===k?void 0:k.trim())&&void 0!==I?I:"",firstName:null!==(T=null==i?void 0:i.trim())&&void 0!==T?T:"",lastName:null!==(P=null==n?void 0:n.trim())&&void 0!==P?P:"",addressType:["Shipping"],email:null!==(j=null==o?void 0:o.email)&&void 0!==j?j:"",countryCode:"+91",cartId:null!==(F=null==e||null===(R=e.Cart_data)||void 0===R?void 0:R.id)&&void 0!==F?F:"",alternatePhone:null!=l&&null!==(L=l.sellerConfig)&&void 0!==L&&L.enableAdrrPhone?null==o?void 0:o.phoneNumber:"",tags:"others"===(null==o?void 0:o.selectedTag)?"other: ".concat(null==o?void 0:o.tagValue):null==o?void 0:o.selectedTag},billingAddress:{}}}else{var O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$;r={sellerId:null==l||null===(O=l.sellerConfig)||void 0===O?void 0:O.seller_id,address:{phone:null!==(M=null==l?void 0:l.mobileNumber)&&void 0!==M?M:"",fullAddressLine:null!==(U=null==o?void 0:o.line1)&&void 0!==U?U:"",city:null!==(Z=null==o||null===(B=o.city)||void 0===B?void 0:B.trim())&&void 0!==Z?Z:"",pincode:null!==(H=null==o?void 0:o.pincode)&&void 0!==H?H:"",gender:null!==(V=null==o?void 0:o.gender)&&void 0!==V?V:"",state:null!==(G=null==o||null===(W=o.state)||void 0===W?void 0:W.trim())&&void 0!==G?G:"",country:"IN",sellerID:null!==(q=null==l||null===(z=l.sellerConfig)||void 0===z?void 0:z.seller_id)&&void 0!==q?q:"",fullName:null!==(Y=null==o?void 0:o.name)&&void 0!==Y?Y:"",addressType:["Shipping"],email:null!==(Q=null==o?void 0:o.email)&&void 0!==Q?Q:"",countryCode:"+91",cartId:null!==(J=null==e||null===(K=e.Cart_data)||void 0===K?void 0:K.id)&&void 0!==J?J:"",versionId:"v2",alternatePhone:null!=l&&null!==($=l.sellerConfig)&&void 0!==$&&$.enableAdrrPhone?null==o?void 0:o.phoneNumber:"",tags:"others"===(null==o?void 0:o.selectedTag)?"other: ".concat(null==o?void 0:o.tagValue):null==o?void 0:o.selectedTag},billingAddress:{}}}r={...r,codIntent:i.codIntent},!s.get("guest-abandon-payload")&&n.y.setItem("codFormAddress",JSON.stringify(r)),await d((0,t.i)(r,a.pim_sid_updated,l.sellerConfig.seller_id,!0))}catch(e){console.log("serviceability call break",e)}};function m(){return(new Date).toLocaleString("en-IN",{timeZone:"Asia/Kolkata",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const g=async(e,l,i,n,t,r,c)=>{try{var v,m;i({type:"UPDATE_INTERMITTENT_UPDATED_ADDRESS_OTPLESS_REQUEST"});const B=window.location.search;let H=new URLSearchParams(B),V=null!=H.get("cartToken")?H.get("cartToken"):null,G=null!=H.get("application")?H.get("application"):null;const W=n.shopifyCart,q=null===(v=n.Cart_data)||void 0===v?void 0:v.id,z=new u("",""),Y={...e,address:{...null==e?void 0:e.address,addressID:"random-".concat(null===(m=1e5*Math.random())||void 0===m?void 0:m.toFixed(0))}};if(await a.Z.post(o.Z.SERVICABILITY_STATUS(),Y,l)){var g,p,h,y,f,_,C,x,b,A,E,S,D,w,N,I,k,T,P,j,F,R,L,O,M,U,Z;let u={userId:null==r||null===(g=r.userInfo)||void 0===g?void 0:g.user_id,paymentType:null==t?void 0:t.paymentMode,sellerId:null==r||null===(p=r.sellerConfig)||void 0===p?void 0:p.seller_id,shippingPlan:null==t||null===(h=t.selected_service_data)||void 0===h?void 0:h.pickrr_tag,shippingAddressId:null!==(y=null==c||null===(f=c.selectedAddress)||void 0===f?void 0:f.addressID)&&void 0!==y?y:"658eae861495e60037ef2642",orderId:null==n||null===(_=n.orderDetails)||void 0===_?void 0:_.id,isUpdateRequired:1,...(null==t?void 0:t.platformCustomerId)&&(null==r||null===(C=r.sellerConfig)||void 0===C?void 0:C.flitsEnable)&&{loyaltyManagerRequest:{customerId:null==t?void 0:t.platformCustomerId,couponType:"FLITS",cart:"appmaker"===G?(0,s.a)(V,n.Cart_data,n.orderDetails):window.btoa(unescape(encodeURIComponent(W))),cartToken:q}},...(null==r||null===(x=r.sellerConfig)||void 0===x?void 0:x.capillaryEnabled)&&{loyaltyManagerRequest:{couponType:"CAPILLARY",applyLoyaltyPoint:"APPLIED"===(null==n||null===(b=n.loyaltyPointDetails)||void 0===b?void 0:b.status)}},...(null==r||null===(A=r.sellerConfig)||void 0===A?void 0:A.twidpayEnabled)&&{loyaltyManagerRequest:{couponType:d.w.twidPay,applyLoyaltyPoint:"APPLIED"===(null==n||null===(E=n.loyaltyPointDetails)||void 0===E?void 0:E.status)}},...(null==r||null===(S=r.sellerConfig)||void 0===S?void 0:S.customLoyaltyPointsEnabled)&&{loyaltyManagerRequest:{couponType:"CUSTOM",applyLoyaltyPoint:"APPLIED"===(null==n||null===(D=n.loyaltyPointDetails)||void 0===D?void 0:D.status)}},...(null==r||null===(w=r.sellerConfig)||void 0===w?void 0:w.nectorEnabled)&&{loyaltyManagerRequest:{couponType:"NECTOR",applyLoyaltyPoint:"APPLIED"===(null==n||null===(N=n.loyaltyPointDetails)||void 0===N?void 0:N.status)}},...(null==r||null===(I=r.sellerConfig)||void 0===I?void 0:I.easyRewardEnabled)&&{loyaltyManagerRequest:{couponType:"EASYREWARD",applyLoyaltyPoint:"APPLIED"===(null==n||null===(k=n.loyaltyPointDetails)||void 0===k?void 0:k.status)}},...(null===(T=r.sellerConfig)||void 0===T?void 0:T.popcoinEnabled)&&{loyaltyManagerRequest:{couponType:"POPCOIN",applyLoyaltyPoint:"APPLIED"===(null==n||null===(P=n.loyaltyPointDetails)||void 0===P?void 0:P.status)}},...(null===(j=r.sellerConfig)||void 0===j?void 0:j.techtonicEnabled)&&{loyaltyManagerRequest:{couponType:d.w.techtonic,applyLoyaltyPoint:"APPLIED"===(null==n||null===(F=n.loyaltyPointDetails)||void 0===F?void 0:F.status)}},...(null===(R=r.sellerConfig)||void 0===R?void 0:R.shipCoinEnabled)&&!n.disableShipCoinForThisCart&&{loyaltyManagerRequest:{couponType:d.w.shipCoin,applyLoyaltyPoint:"APPLIED"===(null==n||null===(L=n.loyaltyPointDetails)||void 0===L?void 0:L.status)}},source:"mobile"===(null==z||null===(O=z.getResult())||void 0===O||null===(M=O.device)||void 0===M?void 0:M.type)?"M_WEB":"WEB",...null!=n&&null!==(U=n.activePayment)&&void 0!==U&&U.key&&null!=n&&n.activePaymentGateway?{payment:{paymentPlatform:null==n||null===(Z=n.activePaymentGateway)||void 0===Z?void 0:Z.toUpperCase(),paymentMethod:null==n?void 0:n.activePaymentMode,paymentMode:"online"}}:{payment:null}};const v=await a.Z.put(o.Z.FETCH_ORDERS(),{...u},l);v&&(i({type:"UPDATE_ORDER_SUCCESS",payload:null==v?void 0:v.data}),i({type:"UPDATE_INTERMITTENT_UPDATED_ADDRESS_OTPLESS_SUCCESS",payload:e}))}}catch(e){i({type:"UPDATE_INTERMITTENT_UPDATED_ADDRESS_OTPLESS_FAILURE"})}}},972:(e,l,i)=>{var n=i(7313),t=i(1168),o=i(6352),a=i(8846),d=i(470);const r="NoInternet_wholeContainer__deSog",s="NoInternet_wholeContainerHeadless__cXGBO",u="NoInternet_maxWidth60per__XSXIL";var c=i(3061),v=i(6417);const m=e=>{let{isHeadless:l}=e;const i=(0,o.v9)((e=>e.Login));return(0,o.v9)((e=>e.Cart)),i.onLoginPage=!1,(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)("div",{className:l?s:r,children:[(0,v.jsx)("img",{src:"./assets/images/server_error.svg",alt:"server Error"}),(0,v.jsx)("p",{className:"h3 mb-10",children:"Something is temporarily wrong with your network connection."}),(0,v.jsx)("p",{className:(0,c.Z)(u,"h4 grey-medium mb-20"),children:"Please make sure you are connected to the internet and then click on try again."}),(0,v.jsx)("button",{className:"btn-grey-outline",onClick:()=>{var e;(e=document.getElementById("headless-iframe"))?e.src=e.src:window.location.reload()},children:"Try Again"})]})})},g=e=>{let{isHeadless:l}=e;return(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)("div",{className:l?s:r,children:[(0,v.jsx)("p",{className:"h3 mb-10",children:"No Internet Connection"}),(0,v.jsx)("p",{className:(0,c.Z)(u,"h4 grey-medium mb-20"),children:"Check your connection then refresh the page"}),(0,v.jsx)("button",{className:"btn-grey-outline",onClick:()=>{var e;(e=document.getElementById("headless-iframe"))?e.src=e.src:window.location.reload()},children:"Refresh"})]})})};var p=i(2199),h=i(1805),y=i(2183);const f=e=>{let{isHeadless:l,redirectUrl:i="",platform:t,errorMessage:a,domainName:u}=e;const c=(0,o.v9)((e=>e.Login)),m=(0,o.v9)((e=>e.Cart)),g=(0,o.v9)((e=>e.Cart)),{channel:f}=null==g?void 0:g.orderDetails,_=window.location.search;let C,x=new URLSearchParams(_),b=x.get("user_profile_id")?x.get("user_profile_id"):null,A=x.get("cart_id")?x.get("cart_id"):null,E=null!=x.get("fastrr_status")?x.get("fastrr_status"):null;var S,D,w;return x.get("uuid")&&x.get("uuid"),c.onLoginPage=!1,C="CUSTOM"===t?"CUSTOM":"",c.redirectEventFired||(c.redirectEventFired=!0,null!=c&&null!==(S=c.sellerConfig)&&void 0!==S&&S.walletThresholdBreach?(0,y.kf)({name:"NATIVE_REDIRECT_THRESHOLD_BREACHED",domain:null===(D=c.sellerConfig)||void 0===D?void 0:D.domainName,payload:{otpLess:null==c||null===(w=c.sellerConfig)||void 0===w?void 0:w.enabledFeatureCodForm}}):(t||C)&&p.uT("Redirection to ".concat(C?"custom":t," Native - Checkout"))),(0,n.useEffect)((()=>{var e,l;let n="";if((null==m||null===(e=m.Cart_data)||void 0===e||null===(l=e.items)||void 0===l?void 0:l.length)>0)for(let e of null==m||null===(o=m.Cart_data)||void 0===o?void 0:o.items){var o;n=n+(null==e?void 0:e.itemId)+":"+(null==e?void 0:e.quantity)+","}const a=E&&A&&b?"http://".concat(u,"/cart/").concat(n):i;if(h.ZW.shopify===t&&!C){const e=","===a[(null==a?void 0:a.length)-1]?null==a?void 0:a.slice(0,(null==a?void 0:a.length)-1):a;window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:"www.faebeauty.in"===u?"https://www.faebeauty.in/checkout":e}}]},"*")}(h.ZW.wooCommerce===t||C)&&(C?C?window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:a}}]},"*"):setTimeout((()=>{window.parent.postMessage({trigger:"headless-close"},"*")}),3e3):window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:null!=a&&a.includes("?")?"".concat(a,"&attributes[fastrr_redirect]=1"):"".concat(a,"?attributes[fastrr_redirect]=1")}}]},"*"))}),[]),(0,v.jsx)(v.Fragment,{children:(0,v.jsx)("div",{className:l?s:r,children:E&&null!=c&&c.batchAPI?(0,v.jsx)("div",{className:"App",style:{boxShadow:x.get("seller-domain")?"0 5px 5px #E8ECFF, 2px 2px 5px #E8ECFF":"",overflow:"scroll",height:"100vh",background:"#FFF"},children:(0,v.jsx)(d.Z,{image:"paymentFailed",heading:"Payment Failed",subheading:"Your payment was not completed. Any amount if deducted will get refunded within 4-7 days..",ctaText:"Back to Home"})}):(0,v.jsx)("p",{className:"h3 mb-10",children:a||(C?"Something went wrong...":"Taking you to checkout...")})})})};var _=i(9094),C=i(2718),x=i(7083),b=i(7784),A=i(4499),E=i(7075),S=i(9563),D=i(5763),w=i(804);const N=e=>{var l,i,t;const a=(0,o.v9)((e=>e.Address)),r=(0,o.v9)((e=>e.Cart)),s=(0,o.v9)((e=>e.Login)),u=(0,o.v9)((e=>e.Shipping)),c=(0,o.v9)((e=>e.Coupon)),m=(0,o.v9)((e=>e.Otp)),g=(r.initialCartData,null===(l=r.platform)||void 0===l||l.toUpperCase(),(0,o.I0)());function p(){window.dataLayer.push(arguments)}return(0,n.useEffect)((()=>{var e,l,i,n,t,o,d,s;!r.orderDetailsSaved&&null!==(e=r.orderPlacedDetails)&&void 0!==e&&e.clientOrderReturnUrl&&(g({type:"UPDATE_CART_STATE",payload:{key:"orderDetailsSaved",value:!0}}),_.Z.setItem("shiprocketCheckoutOrderDetails",JSON.stringify({order_id:null===(i=r.orderPlacedDetails)||void 0===i?void 0:i.clientOrderId,amount:"COD"===a.selectedPaymentMode?null===(n=r.orderPlacedDetails)||void 0===n?void 0:n.codPrice:null===(t=r.orderPlacedDetails)||void 0===t?void 0:t.prepaidPrice,discount:(0,S.PO)(null===(o=r.orderPlacedDetails)||void 0===o||null===(d=o.discountDetail)||void 0===d?void 0:d.discount_data,"discount_code"),products:(0,S.PO)(null===(s=r.orderPlacedDetails)||void 0===s?void 0:s.lineItems,"name")}))),(0,w.N)("order_placed",{orderId:null===(l=r.orderPlacedDetails)||void 0===l?void 0:l.platformOrderId})}),[null===(i=r.orderPlacedDetails)||void 0===i?void 0:i.clientOrderReturnUrl]),(0,n.useEffect)((()=>{var e;let l=[];l.push({action:"clearCart",data:{domain:null===(e=s.sellerConfig)||void 0===e?void 0:e.domainName}}),window.parent.postMessage({trigger:"clear-cart",actions:l},"*")}),[]),(0,n.useEffect)((()=>{var e,l,i;null!=r&&r.isAnalyticsCookie||(r.isAnalyticsCookie=!0,window.parent.postMessage({trigger:"set-analytics-cookie",data:{name:"analyticsData",data:{name:null==r?void 0:r.clientOrderId,value:"COD"===(null==a?void 0:a.selectedPaymentMode)?null==r||null===(e=r.orderDetails)||void 0===e?void 0:e.codPrice:null==r||null===(l=r.orderDetails)||void 0===l?void 0:l.prepaidPrice},time:(i=new Date,5,null==i||i.setMinutes((null==i?void 0:i.getMinutes())+5),i)}},"*"))}),[]),(0,n.useEffect)((()=>{var l,i;if(null!=s&&null!==(l=s.sellerConfig)&&void 0!==l&&l.marketingConfig&&Object.keys(null==s||null===(i=s.sellerConfig)||void 0===i?void 0:i.marketingConfig).length>0){var n,t,o,d,v,g,f,_,C,x,b,A,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce,ve,me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe,je,Fe,Re,Le,Oe,Me,Ue,Ze,Be,He,Ve,Ge,We,qe,ze,Ye,Qe,Je,Ke,$e,Xe,el,ll,il,nl,tl,ol,al,dl,rl,sl,ul,cl,vl,ml,gl,pl,hl,yl,fl,_l,Cl,xl,bl,Al,El,Sl,Dl,wl,Nl,Il,kl,Tl,Pl,jl,Fl,Rl,Ll,Ol,Ml,Ul,Zl,Bl,Hl;const l=null==s||null===(n=s.sellerConfig)||void 0===n||null===(t=n.marketingConfig)||void 0===t||null===(o=t.wigzo)||void 0===o?void 0:o.wigzo_id,i=null==s||null===(d=s.sellerConfig)||void 0===d||null===(v=d.marketingConfig)||void 0===v||null===(g=v.ga4)||void 0===g?void 0:g.measurement_id,$i=null==s||null===(f=s.sellerConfig)||void 0===f||null===(_=f.marketingConfig)||void 0===_||null===(C=_.facebook)||void 0===C?void 0:C.pixel_id,Xi=null==s||null===(x=s.sellerConfig)||void 0===x||null===(b=x.marketingConfig)||void 0===b?void 0:b.gads;var Vl,Gl,Wl,ql;if(null==s||null===(A=s.sellerConfig)||void 0===A||null===(w=A.marketingConfig)||void 0===w||null===(N=w.facebook)||void 0===N||N.events,null==r||null===(I=r.orderDetails)||void 0===I||null===(k=I.lineItems)||void 0===k||k.map((e=>null==e?void 0:e.productId)),E.Z.initialiseAnalytics(i,$i,l,Xi,r.orderDetails.cartId,r.orderDetails.shippinAddress,"fireAllEvents"),null!=s&&null!==(T=s.sellerConfig)&&void 0!==T&&null!==(P=T.marketingConfig)&&void 0!==P&&null!==(j=P.facebook)&&void 0!==j&&null!==(F=j.pixel_array)&&void 0!==F&&F.length)null==s||null===(Vl=s.sellerConfig)||void 0===Vl||null===(Gl=Vl.marketingConfig)||void 0===Gl||null===(Wl=Gl.facebook)||void 0===Wl||null===(ql=Wl.pixel_array)||void 0===ql||ql.map((e=>{var l,i,n,t;E.Z.initialiseAnalytics("",null==e?void 0:e.pixel_id,"","",r.orderDetails.cartId,r.orderDetails.shippingAddress,"onlyPixel",null===(l=r.orderDetails)||void 0===l||null===(i=l.shippingAddress)||void 0===i?void 0:i.firstName,null===(n=r.orderDetails)||void 0===n||null===(t=n.shippingAddress)||void 0===t?void 0:t.lastName)}));else if(null!=s&&null!==(R=s.sellerConfig)&&void 0!==R&&null!==(L=R.marketingConfig)&&void 0!==L&&null!==(O=L.facebook)&&void 0!==O&&O.pixel_id){var zl,Yl,Ql,Jl,Kl,$l,Xl;E.Z.initialiseAnalytics("",null==s||null===(zl=s.sellerConfig)||void 0===zl||null===(Yl=zl.marketingConfig)||void 0===Yl||null===(Ql=Yl.facebook)||void 0===Ql?void 0:Ql.pixel_id,"","",r.orderDetails.cartId,r.orderDetails.shippingAddress,"onlyPixel",null===(Jl=r.orderDetails)||void 0===Jl||null===(Kl=Jl.shippingAddress)||void 0===Kl?void 0:Kl.firstName,null===($l=r.orderDetails)||void 0===$l||null===(Xl=$l.shippingAddress)||void 0===Xl?void 0:Xl.lastName)}console.log("Initializing FB Pixel",null==s||null===(M=s.sellerConfig)||void 0===M||null===(U=M.marketingConfig)||void 0===U||null===(Z=U.facebook)||void 0===Z?void 0:Z.pixel_id,r.orderDetails.shippingAddress);const en=null==s||null===(B=s.sellerConfig)||void 0===B||null===(H=B.marketingConfig)||void 0===H||null===(V=H.facebook)||void 0===V?void 0:V.enable_content_id,ln=null==s||null===(G=s.sellerConfig)||void 0===G||null===(W=G.marketingConfig)||void 0===W||null===(q=W.facebook)||void 0===q?void 0:q.content_id,nn={content_ids:null!=r&&null!==(z=r.Cart_data)&&void 0!==z&&null!==(Y=z.items)&&void 0!==Y&&Y.length?null==r||null===(Q=r.Cart_data)||void 0===Q||null===(J=Q.items)||void 0===J?void 0:J.map((e=>{var l;if(!en)return null==e?void 0:e.productId;switch(ln){case"sku":return(null==e?void 0:e.channel.toUpperCase())===(null===h.ZW||void 0===h.ZW?void 0:h.ZW.magento)?null==e||null===(l=e.customAttributes)||void 0===l?void 0:l.magentoSku:null==e?void 0:e.sku;case"product_id":default:return null==e?void 0:e.productId;case"variant_id":return null==e?void 0:e.itemId}})):[],content_type:"product_group",contents:null!=r&&null!==(K=r.Cart_data)&&void 0!==K&&null!==($=K.items)&&void 0!==$&&$.length?null==r||null===(X=r.Cart_data)||void 0===X||null===(ee=X.items)||void 0===ee?void 0:ee.map((e=>{var l,i;return{id:en?"sku"===ln?(null==e||null===(l=e.channel)||void 0===l?void 0:l.toUpperCase())===(null===h.ZW||void 0===h.ZW?void 0:h.ZW.magento)?null==e||null===(i=e.customAttributes)||void 0===i?void 0:i.magentoSku:(null==e?void 0:e.sku)||(null==e?void 0:e.productId):"variant_id"===ln?null==e?void 0:e.itemId:null==e?void 0:e.productId:null==e?void 0:e.productId,variant:null==e?void 0:e.itemId,name:null==e?void 0:e.name,currency:"INR",price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}})):[],currency:"INR",num_items:null==r||null===(le=r.Cart_data)||void 0===le||null===(ie=le.items)||void 0===ie?void 0:ie.length,value:"COD"===(null==a?void 0:a.selectedPaymentMode)?null==r||null===(ne=r.orderDetails)||void 0===ne?void 0:ne.codPrice:null==r||null===(te=r.orderDetails)||void 0===te?void 0:te.prepaidPrice,ph:10===(null==r||null===(oe=r.orderDetails)||void 0===oe||null===(ae=oe.shippingAddress)||void 0===ae||null===(de=ae.phone)||void 0===de?void 0:de.length)?"91".concat(null==r||null===(re=r.orderDetails)||void 0===re||null===(se=re.shippingAddress)||void 0===se?void 0:se.phone):null==r||null===(ue=r.orderDetails)||void 0===ue||null===(ce=ue.shippingAddress)||void 0===ce?void 0:ce.phone,ct:null==r||null===(ve=r.orderDetails)||void 0===ve||null===(me=ve.shippingAddress)||void 0===me||null===(ge=me.city)||void 0===ge||null===(pe=ge.toLowerCase())||void 0===pe?void 0:pe.replace(/[^a-zA-Z0-9 ]|\s/g,""),country:"in",st:null==r||null===(he=r.orderDetails)||void 0===he||null===(ye=he.shippingAddress)||void 0===ye||null===(fe=ye.state)||void 0===fe||null===(_e=fe.toLowerCase())||void 0===_e?void 0:_e.replace(/[^a-zA-Z0-9 ]|\s/g,""),zp:null==r||null===(Ce=r.orderDetails)||void 0===Ce||null===(xe=Ce.shippingAddress)||void 0===xe?void 0:xe.pincode,fn:null==r||null===(be=r.orderDetails)||void 0===be||null===(Ae=be.shippingAddress)||void 0===Ae?void 0:Ae.firstName,ln:null==r||null===(Ee=r.orderDetails)||void 0===Ee||null===(Se=Ee.shippingAddress)||void 0===Se?void 0:Se.lastName};E.Z.purchase(nn,null==s||null===(De=s.sellerConfig)||void 0===De||null===(we=De.marketingConfig)||void 0===we||null===(Ne=we.facebook)||void 0===Ne?void 0:Ne.events,"COD"!==(null==a?void 0:a.selectedPaymentMode));const tn={event:"purchase",data:{event_category:"ecommerce",transaction_id:null==r||null===(Ie=r.orderDetails)||void 0===Ie?void 0:Ie.clientOrderId,currency:"INR",value:"COD"===a.selectedPaymentMode?null==r||null===(ke=r.orderDetails)||void 0===ke?void 0:ke.codPrice:null!==(Te=null==r||null===(Pe=r.orderDetails)||void 0===Pe?void 0:Pe.prepaidPrice)&&void 0!==Te?Te:null==r||null===(je=r.Cart_data)||void 0===je?void 0:je.totalPrice,tax:null==r||null===(Fe=r.orderDetails)||void 0===Fe?void 0:Fe.totalTax,shipping:null==r||null===(Re=r.orderDetails)||void 0===Re?void 0:Re.shippingCharges,ecomm_prodid:null==r||null===(Le=r.Cart_data)||void 0===Le||null===(Oe=Le.items)||void 0===Oe?void 0:Oe.map((e=>(0,D.Wv)(e))),items:null==r||null===(Me=r.Cart_data)||void 0===Me||null===(Ue=Me.items)||void 0===Ue?void 0:Ue.map((e=>({id:(0,D.Wv)(e),name:null==e?void 0:e.name,variant:"",brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),coupon:null==r||null===(Ze=r.orderDetails)||void 0===Ze||null===(Be=Ze.couponData)||void 0===Be?void 0:Be.coupon_code}},on={...tn.data,items:null==r||null===(He=r.Cart_data)||void 0===He||null===(Ve=He.items)||void 0===Ve?void 0:Ve.map((e=>({id:null==e?void 0:e.productId,name:null==e?void 0:e.name,variant:null==e?void 0:e.itemId,brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),payment_type:null==a?void 0:a.selectedPaymentMode,coupon_discount:null==r||null===(Ge=r.orderDetails)||void 0===Ge?void 0:Ge.couponDiscount,phone_num:(0,S.un)(null!==(We=null==s?void 0:s.mobileNumber)&&void 0!==We?We:m.mobile_no),city:null===(qe=a.selectedAddress)||void 0===qe?void 0:qe.city,state:null===(ze=a.selectedAddress)||void 0===ze?void 0:ze.state,pincode:null===(Ye=a.selectedAddress)||void 0===Ye?void 0:Ye.pincode,first_name:null===(Qe=a.selectedAddress)||void 0===Qe?void 0:Qe.firstName,last_name:null===(Je=a.selectedAddress)||void 0===Je?void 0:Je.lastName,email:null===(Ke=a.selectedAddress)||void 0===Ke?void 0:Ke.email};var ei,li,ii,ni,ti;(null==s||null===($e=s.sellerConfig)||void 0===$e||null===(Xe=$e.channel)||void 0===Xe?void 0:Xe.toUpperCase())===h.ZW.shopify&&window.parent.postMessage({trigger:"shopify-custom-events",data:{eventName:"PurchaseSR",eventData:on}},"*"),null==s||null===(el=s.sellerConfig)||void 0===el||null===(ll=el.marketingConfig)||void 0===ll||null===(il=ll.ga4)||void 0===il||null===(nl=il.events)||void 0===nl||!nl.order_placed||null!=s&&null!==(tl=s.sellerConfig)&&void 0!==tl&&tl.enableGa4MpEvents||(tn.data={...tn.data,send_to:null==s||null===(ei=s.sellerConfig)||void 0===ei||null===(li=ei.marketingConfig)||void 0===li||null===(ii=li.ga4)||void 0===ii?void 0:ii.measurement_id},window.parent.postMessage({trigger:"gtag",data:tn},"*"),console.log("PURCHASE-GA-EVENT-FIRED eventData------\x3e",tn),"innovist.com"===(null==s||null===(ni=s.sellerConfig)||void 0===ni?void 0:ni.domainName)&&(0,y.kf)({name:"Purchase-Event-GA",domain:null===(ti=s.sellerConfig)||void 0===ti?void 0:ti.domainName,payload:tn}));var oi={...(null==r||null===(ol=r.orderDetails)||void 0===ol||null===(al=ol.shippingAddress)||void 0===al?void 0:al.email)&&{email:null==r||null===(dl=r.orderDetails)||void 0===dl||null===(rl=dl.shippingAddress)||void 0===rl?void 0:rl.email},phone_number:(0,S.un)(null==r||null===(sl=r.orderDetails)||void 0===sl||null===(ul=sl.shippingAddress)||void 0===ul?void 0:ul.phone),first_name:null==r||null===(cl=r.orderDetails)||void 0===cl||null===(vl=cl.shippingAddress)||void 0===vl?void 0:vl.firstName,last_name:null==r||null===(ml=r.orderDetails)||void 0===ml||null===(gl=ml.shippingAddress)||void 0===gl?void 0:gl.lastName,home_address:{street:(null==r||null===(pl=r.orderDetails)||void 0===pl||null===(hl=pl.shippingAddress)||void 0===hl?void 0:hl.line1)+(null!=r&&null!==(yl=r.orderDetails)&&void 0!==yl&&null!==(fl=yl.shippingAddress)&&void 0!==fl&&fl.line2?null==r||null===(_l=r.orderDetails)||void 0===_l||null===(Cl=_l.shippingAddress)||void 0===Cl?void 0:Cl.line2:""),city:null==r||null===(xl=r.orderDetails)||void 0===xl||null===(bl=xl.shippingAddress)||void 0===bl?void 0:bl.city,region:null==r||null===(Al=r.orderDetails)||void 0===Al||null===(El=Al.shippingAddress)||void 0===El?void 0:El.state,postal_code:null==r||null===(Sl=r.orderDetails)||void 0===Sl||null===(Dl=Sl.shippingAddress)||void 0===Dl?void 0:Dl.pincode,country:"IN"}};for(let e=0;e<(null==s||null===(ai=s.sellerConfig)||void 0===ai||null===(di=ai.marketingConfig)||void 0===di||null===(ri=di.gads)||void 0===ri||null===(si=ri.google_ads_array)||void 0===si?void 0:si.length);e++){var ai,di,ri,si,ui,ci,vi,mi,gi;const l=document.createElement("script");document.head.appendChild(l),l.src="https://www.googletagmanager.com/gtag/js?id=".concat(null==s||null===(ui=s.sellerConfig)||void 0===ui||null===(ci=ui.marketingConfig)||void 0===ci||null===(vi=ci.gads)||void 0===vi||null===(mi=vi.google_ads_array)||void 0===mi||null===(gi=mi[e])||void 0===gi?void 0:gi.conversion_id),l.async=!0,l.onload=()=>{var l,i,n,t,o,a,d,u,c,v,m,g,h,y,f,_,C,x,b,A,E,w,N,I,k,T,P,j,F,R,L,O,M,U,Z,B,H,V,G,W,q,z,Y,Q,J,K,$,X,ee,le,ie,ne,te,oe,ae,de,re,se,ue,ce,ve,me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe;0===e&&(window.dataLayer=window.dataLayer||[],p("js",new Date)),p("config",null==s||null===(l=s.sellerConfig)||void 0===l||null===(i=l.marketingConfig)||void 0===i||null===(n=i.gads)||void 0===n||null===(t=n.google_ads_array)||void 0===t?void 0:t[e].conversion_id,{allow_enhanced_conversions:null==s||null===(o=s.sellerConfig)||void 0===o||null===(a=o.marketingConfig)||void 0===a||null===(d=a.gads)||void 0===d?void 0:d.enhance_conversion}),console.log("ga ads fired",{send_to:(null==s||null===(u=s.sellerConfig)||void 0===u||null===(c=u.marketingConfig)||void 0===c||null===(v=c.gads)||void 0===v||null===(m=v.google_ads_array)||void 0===m||null===(g=m[e])||void 0===g?void 0:g.conversion_id)+"/"+(null==s||null===(h=s.sellerConfig)||void 0===h||null===(y=h.marketingConfig)||void 0===y||null===(f=y.gads)||void 0===f||null===(_=f.google_ads_array)||void 0===_||null===(C=_[e])||void 0===C?void 0:C.conversion_label),value:((null==r||null===(x=r.orderDetails)||void 0===x?void 0:x.totalPrice)||0)+((null==r||null===(b=r.orderDetails)||void 0===b?void 0:b.shippingCharges)||0)+((null==r||null===(A=r.orderDetails)||void 0===A?void 0:A.totaltax)||0)-((null==r||null===(E=r.orderDetails)||void 0===E?void 0:E.prepaidDiscount)||0)-((null==r||null===(w=r.orderDetails)||void 0===w?void 0:w.couponDiscount)||0),currency:"INR",transaction_id:null==r||null===(N=r.orderDetails)||void 0===N?void 0:N.clientOrderId}),p("event","conversion",{send_to:(null==s||null===(I=s.sellerConfig)||void 0===I||null===(k=I.marketingConfig)||void 0===k||null===(T=k.gads)||void 0===T||null===(P=T.google_ads_array)||void 0===P||null===(j=P[e])||void 0===j?void 0:j.conversion_id)+"/"+(null==s||null===(F=s.sellerConfig)||void 0===F||null===(R=F.marketingConfig)||void 0===R||null===(L=R.gads)||void 0===L||null===(O=L.google_ads_array)||void 0===O||null===(M=O[e])||void 0===M?void 0:M.conversion_label),value:((null==r||null===(U=r.orderDetails)||void 0===U?void 0:U.totalPrice)||0)+((null==r||null===(Z=r.orderDetails)||void 0===Z?void 0:Z.shippingCharges)||0)+((null==r||null===(B=r.orderDetails)||void 0===B?void 0:B.totaltax)||0)-((null==r||null===(H=r.orderDetails)||void 0===H?void 0:H.prepaidDiscount)||0)-((null==r||null===(V=r.orderDetails)||void 0===V?void 0:V.couponDiscount)||0),currency:"INR",transaction_id:null==r||null===(G=r.orderDetails)||void 0===G?void 0:G.clientOrderId});let je={...null!=r&&null!==(W=r.orderDetails)&&void 0!==W&&null!==(q=W.shippingAddress)&&void 0!==q&&q.email?{email:null==r||null===(z=r.orderDetails)||void 0===z||null===(Y=z.shippingAddress)||void 0===Y?void 0:Y.email}:{},phone_number:(0,S.un)(null==r||null===(Q=r.orderDetails)||void 0===Q||null===(J=Q.shippingAddress)||void 0===J?void 0:J.phone),first_name:null==r||null===(K=r.orderDetails)||void 0===K||null===($=K.shippingAddress)||void 0===$?void 0:$.firstName,last_name:null==r||null===(X=r.orderDetails)||void 0===X||null===(ee=X.shippingAddress)||void 0===ee?void 0:ee.lastName,home_address:{street:(null==r||null===(le=r.orderDetails)||void 0===le||null===(ie=le.shippingAddress)||void 0===ie?void 0:ie.line1)+(null!=r&&null!==(ne=r.orderDetails)&&void 0!==ne&&null!==(te=ne.shippingAddress)&&void 0!==te&&te.line2?null==r||null===(oe=r.orderDetails)||void 0===oe||null===(ae=oe.shippingAddress)||void 0===ae?void 0:ae.line2:""),city:null==r||null===(de=r.orderDetails)||void 0===de||null===(re=de.shippingAddress)||void 0===re?void 0:re.city,region:null==r||null===(se=r.orderDetails)||void 0===se||null===(ue=se.shippingAddress)||void 0===ue?void 0:ue.state,postal_code:null==r||null===(ce=r.orderDetails)||void 0===ce||null===(ve=ce.shippingAddress)||void 0===ve?void 0:ve.pincode,country:"IN"}},Fe={send_to:(null==s||null===(me=s.sellerConfig)||void 0===me||null===(ge=me.marketingConfig)||void 0===ge||null===(pe=ge.gads)||void 0===pe||null===(he=pe.google_ads_array)||void 0===he||null===(ye=he[e])||void 0===ye?void 0:ye.conversion_id)+"/"+(null==s||null===(fe=s.sellerConfig)||void 0===fe||null===(_e=fe.marketingConfig)||void 0===_e||null===(Ce=_e.gads)||void 0===Ce||null===(xe=Ce.google_ads_array)||void 0===xe||null===(be=xe[e])||void 0===be?void 0:be.conversion_label),value:((null==r||null===(Ae=r.orderDetails)||void 0===Ae?void 0:Ae.totalPrice)||0)+((null==r||null===(Ee=r.orderDetails)||void 0===Ee?void 0:Ee.shippingCharges)||0)+((null==r||null===(Se=r.orderDetails)||void 0===Se?void 0:Se.totaltax)||0)-((null==r||null===(De=r.orderDetails)||void 0===De?void 0:De.prepaidDiscount)||0)-((null==r||null===(we=r.orderDetails)||void 0===we?void 0:we.couponDiscount)||0),currency:"INR",ecomm_prodid:null==r||null===(Ne=r.Cart_data)||void 0===Ne||null===(Ie=Ne.items)||void 0===Ie?void 0:Ie.map((e=>(0,D.Wv)(e))),transaction_id:null==r||null===(ke=r.orderDetails)||void 0===ke?void 0:ke.clientOrderId,items:null==r||null===(Te=r.Cart_data)||void 0===Te||null===(Pe=Te.items)||void 0===Pe?void 0:Pe.map((e=>({id:(0,D.Wv)(e)})))};window.parent.postMessage({trigger:"convesion-gtm-event",eventName:"conversion",enhanced_conversion_data:je,conversionData:Fe},"*")}}if(console.log("enhanced_conversion_data---\x3e",oi),E.Z.orderPlacedBilldesk(e.marketConfigPairs,null===(wl=r.orderDetails)||void 0===wl||null===(Nl=wl.shippingAddress)||void 0===Nl?void 0:Nl.phone,{items:null===(Il=r.orderDetails)||void 0===Il?void 0:Il.lineItems},null===(kl=r.orderDetails)||void 0===kl?void 0:kl.shippingAddress,null===(Tl=r.orderDetails)||void 0===Tl||null===(Pl=Tl.couponData)||void 0===Pl?void 0:Pl.coupon_code,null==r?void 0:r.orderDetails,null===(jl=r.orderDetails)||void 0===jl?void 0:jl.paymentMethod,null===(Fl=r.orderDetails)||void 0===Fl?void 0:Fl.shippingTag,null===(Rl=r.orderDetails)||void 0===Rl?void 0:Rl.paymentGateway,null===(Ll=r.orderDetails)||void 0===Ll?void 0:Ll.clientOrderId,u.platformCustomerId),null!=s&&null!==(Ol=s.sellerConfig)&&void 0!==Ol&&Ol.enableGtmEventParentFrame){var pi,hi,yi,fi,_i,Ci,xi,bi,Ai,Ei,Si,Di,wi,Ni,Ii,ki,Ti,Pi,ji,Fi,Ri,Li,Oi,Mi;let e={event:"order-placed",firstName:null!==(pi=null===(hi=a.selectedAddress)||void 0===hi?void 0:hi.firstName)&&void 0!==pi?pi:"",LastName:null!==(yi=null===(fi=a.selectedAddress)||void 0===fi?void 0:fi.lastName)&&void 0!==yi?yi:"",email:null!==(_i=null===(Ci=a.selectedAddress)||void 0===Ci?void 0:Ci.email)&&void 0!==_i?_i:"",fullName:null!==(xi=null===(bi=a.selectedAddress)||void 0===bi?void 0:bi.fullName)&&void 0!==xi?xi:"",phone_num:(0,S.un)(null!==(Ai=null==s?void 0:s.mobileNumber)&&void 0!==Ai?Ai:m.mobile_no),city:null===(Ei=a.selectedAddress)||void 0===Ei?void 0:Ei.city,state:null===(Si=a.selectedAddress)||void 0===Si?void 0:Si.state,pincode:null===(Di=a.selectedAddress)||void 0===Di?void 0:Di.pincode,country:"in",Shopify_Customerid:u.platformCustomerId,ecommerce:{currency:"INR",value:"COD"===(null==a?void 0:a.selectedPaymentMode)?null==r||null===(wi=r.orderDetails)||void 0===wi?void 0:wi.codPrice:null==r||null===(Ni=r.orderDetails)||void 0===Ni?void 0:Ni.prepaidPrice,coupon:null==c?void 0:c.couponCode,tax:null!==(Ii=null==r||null===(ki=r.Cart_data)||void 0===ki?void 0:ki.totalTax)&&void 0!==Ii?Ii:null==r||null===(Ti=r.orderDetails)||void 0===Ti?void 0:Ti.totalTax,shipping:null==r||null===(Pi=r.orderDetails)||void 0===Pi?void 0:Pi.shippingCharges,transaction_id:null==r||null===(ji=r.orderDetails)||void 0===ji?void 0:ji.clientOrderId,paymentType:r.paymentMethodType,shipping_tier:null==u||null===(Fi=u.selected_service_data)||void 0===Fi?void 0:Fi.pickrr_tag,items:null!==(Ri=null==r||null===(Li=r.Cart_data)||void 0===Li||null===(Oi=Li.items)||void 0===Oi?void 0:Oi.map((e=>{var l,i;const n=null==r||null===(l=r.Cart_data)||void 0===l||null===(i=l.items)||void 0===i?void 0:i.find((l=>(null==l?void 0:l.productId)==(null==e?void 0:e.productId)));return null!=n&&n.vendor?{...e,vendor:null==n?void 0:n.vendor}:{...e}})))&&void 0!==Ri?Ri:null==r||null===(Mi=r.orderDetails)||void 0===Mi?void 0:Mi.lineItems.map((e=>{var l,i;const n=null==r||null===(l=r.Cart_data)||void 0===l||null===(i=l.items)||void 0===i?void 0:i.find((l=>(null==l?void 0:l.productId)==(null==e?void 0:e.productId)));return null!=n&&n.vendor?{...e,vendor:null==n?void 0:n.vendor}:{...e}}))}};window.parent.postMessage({trigger:"gtm-events",data:e},"*")}if(null!=s&&null!==(Ml=s.sellerConfig)&&void 0!==Ml&&null!==(Ul=Ml.marketingConfig)&&void 0!==Ul&&null!==(Zl=Ul.ga4)&&void 0!==Zl&&null!==(Bl=Zl.events)&&void 0!==Bl&&Bl.payment_initiated&&(null==s||null===(Hl=s.sellerConfig)||void 0===Hl||!Hl.enableGa4MpEvents)){var Ui,Zi,Bi,Hi,Vi,Gi,Wi,qi,zi,Yi,Qi,Ji,Ki;const e={event:"add_payment_info",data:{event_category:"ecommerce",send_to:null==s||null===(Ui=s.sellerConfig)||void 0===Ui||null===(Zi=Ui.marketingConfig)||void 0===Zi||null===(Bi=Zi.ga4)||void 0===Bi?void 0:Bi.measurement_id,currency:"INR",ecomm_prodid:null==r||null===(Hi=r.Cart_data)||void 0===Hi||null===(Vi=Hi.items)||void 0===Vi?void 0:Vi.map((e=>(0,D.Wv)(e))),value:((null==r||null===(Gi=r.orderDetails)||void 0===Gi?void 0:Gi.totalPrice)||0)+((null===(Wi=r.orderDetails)||void 0===Wi?void 0:Wi.shippingCharges)||0)+((null==r||null===(qi=r.orderDetails)||void 0===qi?void 0:qi.totaltax)||0)-((null==r||null===(zi=r.orderDetails)||void 0===zi?void 0:zi.prepaidDiscount)||0)-((null==r||null===(Yi=r.orderDetails)||void 0===Yi?void 0:Yi.couponDiscount)||0),items:null==r||null===(Qi=r.Cart_data)||void 0===Qi||null===(Ji=Qi.items)||void 0===Ji?void 0:Ji.map((e=>({id:(0,D.Wv)(e),name:null==e?void 0:e.name,variant:"",brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),payment_type:null==r||null===(Ki=r.orderDetails)||void 0===Ki?void 0:Ki.paymentGateway,coupon:null==c?void 0:c.couponCode}};window.parent.postMessage({trigger:"gtag",data:e},"*"),console.log("ADD-PAYMENT-INFO-GA-EVENT-FIRED eventData------\x3e",e)}}}),[]),(0,n.useEffect)((()=>{try{var e;if(null!==(e=r.orderPlacedDetails)&&void 0!==e&&e.clientOrderReturnUrl&&!r.ucEventOrder){var l,i,n,t,o,a,d,s,u,c;r.ucEventOrder=!0;const e={id:"",status:"success",method:"PREPAID",order_id:null===(l=r.orderPlacedDetails)||void 0===l?void 0:l.clientOrderId,customer_id:"",phone:String(null==r||null===(i=r.orderPlacedDetails)||void 0===i||null===(n=i.shippingAddress)||void 0===n?void 0:n.phone),email:null==r||null===(t=r.orderPlacedDetails)||void 0===t||null===(o=t.shippingAddress)||void 0===o?void 0:o.email,zip:String(null==r||null===(a=r.orderPlacedDetails)||void 0===a||null===(d=a.shippingAddress)||void 0===d?void 0:d.pincode),referrer:"",sla:"",total_price:String(null==r||null===(s=r.orderPlacedDetails)||void 0===s?void 0:s.prepaidPrice),couponData:{coupon_code:"",coupon_type:"",discount_amount:""},items:null==r||null===(u=r.orderPlacedDetails)||void 0===u||null===(c=u.lineItems)||void 0===c?void 0:c.map((e=>{var l;return{id:"",name:null==e?void 0:e.name,mrp:null!==(l=null==e?void 0:e.compareAtPrice)&&void 0!==l?l:"",selling_price:String(null==e?void 0:e.price),variant_id:String(null==e?void 0:e.itemId),qty:String(null==e?void 0:e.quantity)}}))};console.log("UCORDER",e),(0,y.Vw)({eventName:"order",payload:e})}}catch(e){}}),[null===(t=r.orderPlacedDetails)||void 0===t?void 0:t.clientOrderReturnUrl]),"object"==typeof r.orderDetails.shippingAddress?r.orderDetails.shippingAddress:JSON.parse(r.orderDetails.shippingAddress),(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(d.Z,{image:"orderPlacedNew",heading:"Order placed",subheading:"Redirecting you to the confirmation page.",showButton:!0})})};var I=i(3960),k=i(2855),T=i(3130),P=i(7023),j=i(1608);const F="OrderPendingNew_itemTitleCard__KACCO",R="OrderPendingNew_summaryLabelCard__Zqf9Z",L=e=>{var l,i,t,a,d,r,s,u,c,m,g,p,h,y,f,_,C,x,b,A,E,S,D,w,N,I,k,T,P,j,L;(0,o.v9)((e=>e.Address));const O=(0,o.v9)((e=>e.Cart)),M=(0,o.v9)((e=>e.Login)),U=(0,o.v9)((e=>e.Shipping)),Z=(0,o.v9)((e=>e.Otp));let B="object"==typeof O.orderDetails.shippingAddress?O.orderDetails.shippingAddress:JSON.parse(O.orderDetails.shippingAddress);return(0,n.useEffect)((()=>{O.verifyingPayment=!1,window.scrollTo(0,0)}),[]),console.log("cart state order details",O),(0,v.jsx)(v.Fragment,{children:(0,v.jsx)("div",{className:"OrderPendingNew_wholeContainerCard__pUL54",children:(0,v.jsxs)("div",{className:"card-container",children:[(0,v.jsxs)("div",{className:"OrderPendingNew_topContainer__0acXv",children:[(0,v.jsxs)("div",{className:"OrderPendingNew_orderPendingContainer__XArlv",children:[(0,v.jsx)("div",{className:"OrderPendingNew_subheading1__0kQO7",children:"Order pending!!"}),(0,v.jsx)("div",{className:"OrderPendingNew_container1__IE9xx",style:{display:"flex",justifyContent:"center"},children:"Order #".concat(null==O||null===(l=O.orderDetails)||void 0===l?void 0:l.id," is pending confirmation.")}),(0,v.jsx)("div",{className:"OrderPendingNew_container2__QFIu+",style:{display:"flex",justifyContent:"center"},children:"We'll send the order confirmation to your registered phone number ".concat(null!==(i=M.mobileNumber)&&void 0!==i?i:Z.mobile_no," once confirmed.")})]}),(0,v.jsx)("div",{style:{height:"1px",backgroundImage:"linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .1) 75%, transparent 75%, transparent 100%)",backgroundSize:"8px 1px",border:"none",width:"100%"}}),(0,v.jsxs)("div",{className:"OrderPendingNew_orderDetailsContainer__zCKOl",children:[(0,v.jsx)("div",{className:"card-main-heading",children:"Order details"}),(0,v.jsxs)("div",{className:"d-flex space-between",style:{flexDirection:"column",gap:"0px"},children:[(0,v.jsx)("label",{className:"OrderPendingNew_addressName__biCik",style:{color:"#222222"},children:"\n ".concat(null!=B&&B.firstName?null==B?void 0:B.firstName:"Customer"," \n ").concat(null!=B&&B.lastName?null==B?void 0:B.lastName:"","\n ")}),(0,v.jsx)("label",{className:"OrderPendingNew_addressDetail__QjPla",style:{overflowWrap:"break-word",fontWeight:"400",color:"#222222"},children:"\n ".concat(null!=B&&B.line1?null==B?void 0:B.line1:""," \n ").concat(null!=B&&B.line2?null==B?void 0:B.line2:"","\n ").concat(null!=B&&B.city?null==B?void 0:B.city:"","\n ").concat(null!=B&&B.state?null==B?void 0:B.state:"","\n ").concat(null!=B&&B.pincode?null==B?void 0:B.pincode:"","\n ")})]}),(0,v.jsxs)("div",{className:"d-flex align-v-center",children:[(0,v.jsx)("img",{src:"./assets/images/shippingIcon.svg",alt:"shipping-icon",height:17,width:17,style:{marginRight:"4px"}}),(0,v.jsxs)("label",{className:"card-address-details",style:{overflowWrap:"break-word",fontWeight:"400",color:"#222222",lineHeight:"normal"},children:[null==U||null===(t=U.selected_service_data)||void 0===t?void 0:t.edd," ",(0,v.jsx)("a",{style:{color:"rgba(253, 85, 48, 1)"},children:"(to be confirmed)"})]})]})]}),(0,v.jsx)("div",{style:{height:"1px",backgroundImage:"linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .1) 75%, transparent 75%, transparent 100%)",backgroundSize:"8px 1px",border:"none",width:"100%"}}),(0,v.jsx)("div",{style:{overflowY:"auto",transition:"all .5s",maxHeight:"150px"},children:null==O||null===(a=O.orderDetails)||void 0===a||null===(d=a.lineItems)||void 0===d?void 0:d.map(((e,l)=>{var i,n,t,o,a,d,r;return(0,v.jsx)("div",{className:"OrderPendingNew_orderItemsCard__WwSAj",children:(0,v.jsxs)("div",{className:"d-flex ml-15",children:[(0,v.jsx)("div",{className:"OrderPendingNew_itemImage__bSUPC",children:"myxtur.com"===M.sellerConfig.domainName?(0,v.jsx)("img",{src:null!==(i=null==e||null===(n=e.customAttributes)||void 0===n?void 0:n.image)&&void 0!==i?i:null==e?void 0:e.imageUrl,alt:null==e?void 0:e.name}):(0,v.jsx)("img",{src:null==e?void 0:e.imageUrl,alt:null==e?void 0:e.name})}),(0,v.jsxs)("div",{className:"OrderPendingNew_itemDetails__Sc5DR",children:[(0,v.jsx)("div",{className:F,children:null==e?void 0:e.name}),"everlasting.shop"===(null==M||null===(t=M.sellerConfig)||void 0===t?void 0:t.domainName)&&(null==e?void 0:e.customAttributes)&&(0,v.jsx)("div",{className:F,children:Object.keys(null==e?void 0:e.customAttributes).map(((l,i)=>"For COD orders team will ask you for an advance payment of INR 200"!==l&&"contentId"!==l?"".concat(null==e?void 0:e.customAttributes[l]," / "):""))}),"etchcraftemporium.in"===(null==M||null===(o=M.sellerConfig)||void 0===o?void 0:o.domainName)&&(null==e||null===(a=e.item_meta_data)||void 0===a?void 0:a.properties)&&Object.keys(null==e||null===(d=e.item_meta_data)||void 0===d?void 0:d.properties).map(((l,i)=>{var n;return(0,v.jsx)("div",{className:F,children:"".concat(l,': "').concat(null==e||null===(n=e.item_meta_data)||void 0===n?void 0:n.properties[l],'"')})})),(0,v.jsxs)("div",{className:"OrderPendingNew_itemQuantityCard__bj1NR",children:["Qty: ",null==e?void 0:e.quantity]}),(0,v.jsxs)("div",{className:"OrderPendingNew_itemPriceCard__1jJjt",children:["₹",null==e||null===(r=e.price)||void 0===r?void 0:r.toFixed(2)]})]})]})},l)}))}),(0,v.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,v.jsx)("div",{className:"OrderPendingNew_subHeading__ohGeh",children:"Bill summary"}),null!==(r=O.orderDetails)&&void 0!==r&&r.totalPrice?(0,v.jsxs)("div",{className:R,children:[(0,v.jsx)("div",{children:"Sub total"}),(0,v.jsxs)("div",{children:["₹",Number(null===(s=O.orderDetails)||void 0===s?void 0:s.totalPrice).toFixed(2)]})]}):null,!(null!==(u=M.sellerConfig)&&void 0!==u&&u.nativeShopifyCheckout)&&(0,v.jsxs)(v.Fragment,{children:[(null===(c=O.orderDetails)||void 0===c||null===(m=c.discountDetail)||void 0===m||null===(g=m.discount_data)||void 0===g||null===(p=g.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===p?void 0:p.length)>0&&(null===(h=O.orderDetails)||void 0===h||null===(y=h.discountDetail)||void 0===y||null===(f=y.discount_data)||void 0===f||null===(_=f.filter((e=>"automatic"!==(null==e?void 0:e.discount_type))))||void 0===_?void 0:_.map((e=>{var l,i;return(0,v.jsxs)("div",{className:R,style:{color:"#238017"},children:[(0,v.jsxs)("div",{children:["Coupon discount (",(i=null==e?void 0:e.discount_code,(null==i?void 0:i.length)>20?"".concat(null==i?void 0:i.slice(0,20),"..."):i),")"]}),(0,v.jsxs)("div",{style:{color:"#238017"},children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})}))),(null===(C=O.orderDetails)||void 0===C||null===(x=C.discountDetail)||void 0===x||null===(b=x.discount_data)||void 0===b||null===(A=b.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===A?void 0:A.length)>0&&(null===(E=O.orderDetails)||void 0===E||null===(S=E.discountDetail)||void 0===S||null===(D=S.discount_data)||void 0===D||null===(w=D.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===w?void 0:w.map((e=>{var l;return(0,v.jsxs)("div",{className:R,style:{color:"#238017"},children:[(0,v.jsx)("div",{children:"Auto discount"}),(0,v.jsxs)("div",{style:{color:"#238017"},children:["- ₹",null==e||null===(l=e.discount_amount)||void 0===l?void 0:l.toFixed(2)," "]})]})})))]}),null!=O&&null!==(N=O.orderDetails)&&void 0!==N&&N.shippingCharges?(0,v.jsxs)("div",{className:R,children:[(0,v.jsx)("div",{children:"Delivery charges"}),(0,v.jsx)("div",{className:(null==O||null===(I=O.orderDetails)||void 0===I?void 0:I.shippingCharges)<0?"ascent-green":"",children:(null==O||null===(k=O.orderDetails)||void 0===k?void 0:k.shippingCharges)>0?(0,v.jsxs)(v.Fragment,{children:["₹",Number(null===(T=O.orderDetails)||void 0===T?void 0:T.shippingCharges).toFixed(2)," "]}):"FREE"})]}):null,(0,v.jsx)("div",{style:{height:"1px",backgroundImage:"linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .1) 75%, transparent 75%, transparent 100%)",backgroundSize:"8px 1px",border:"none",width:"100%"}}),(0,v.jsxs)("div",{className:"OrderPendingNew_summaryTotalAmountCard__3W-Xg",children:[(0,v.jsx)("div",{children:"Total amount"}),(0,v.jsxs)("div",{children:["₹",(null!==(P=(null===(j=O.orderDetails)||void 0===j?void 0:j.totalAmount)+(null===(L=O.orderDetails)||void 0===L?void 0:L.prepaidDiscount))&&void 0!==P?P:0).toFixed(2)]})]})]})]}),(0,v.jsxs)("div",{className:"order-pending-note-container",children:[(0,v.jsx)("span",{style:{fontWeight:500},children:"Note:"})," For any questions, please feel free to contact our customer support. Thank you for shopping with us!"]})]})})})};var O=i(3106);const M=e=>{var l,i,t,a;let{billDeskTransactionId:r,fastrrSellerId:s,onRender:u,sellerDomain:c}=e;const m=window.location.search;let g=new URLSearchParams(m);const p=(0,o.v9)((e=>e.Cart)),h=(0,o.v9)((e=>e.Login)),[y,f]=(0,n.useState)(!1),[_,S]=(0,n.useState)(""),[D,w]=(0,n.useState)(!1),F=(0,o.v9)((e=>e.Address)),[R,M]=(0,n.useState)(!0),[U,Z]=(0,n.useState)(!0),[B,H]=(0,n.useState)(""),[V,G]=(0,n.useState)(!1),W=!!g.get("is_upsell")&&g.get("is_upsell"),[q,z]=(0,n.useState)(!!j.y.getItem("configfetchAfterRedirectionTried"));let Y=encodeURI(btoa(c));(0,n.useEffect)((()=>{E.Z.initialiseGTM("GTM-TTW8J69")}),[]),(0,n.useEffect)((()=>{p.isCtpCookieSet||(p.isCtpCookieSet=!0,window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrCtpData",data:"",time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTimeCtp",data:"",time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrSellerId",data:"",time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"))}),[]);const Q=(e,l)=>(null==e||e.setMinutes((null==e?void 0:e.getMinutes())+l),e),J=(e=>{const l={},i={contlo:"contlo",facebook:"facebook",ga4:"ga4",gads:"gads",moengage:"moengage",wigzo:"wigzo"};if(null!==e&&Object.keys(e).length>0)for(let[n,t]of Object.entries(e)){const t=n;if(n===i[n]&&null!==e[t]&&void 0!==e[t]&&Object.keys(e[t]).length>0)for(let[i,n]of Object.entries(e[t]))"events"!==i&&(l["".concat(t,"_").concat(i)]=n),"events"===i&&(l["".concat(t,"_","order_placed")]=null==n?void 0:n.order_placed)}return l})(null!=h&&null!==(l=h.sellerConfig)&&void 0!==l&&l.marketingConfig?null==h||null===(i=h.sellerConfig)||void 0===i?void 0:i.marketingConfig:null);let K;return(0,n.useEffect)((()=>{!p.billdeskDetailsFetched&&h.configFetched&&(()=>{p.fireRedirectPullingRequest=!0;let e=50;K=setInterval((()=>{p.fireRedirectPullingRequest&&e&&(p.fireRedirectPullingRequest=!1,e-=1,(async e=>{M(!0);try{var l,i,n,t,o,a,d,c,v,m,g,y,_;let w=await x.Z.post(C.Z.GET_UPI_PAYMENT_DETAILS(r,s),{},s);var b,A,D,N,I,k,T,j,R;if(console.log("Response",w),w&&(p.billdeskDetailsFetched=!0,p.orderDetails=null==w||null===(b=w.data)||void 0===b?void 0:b.data,F.selectedAddress=null==w||null===(A=w.data)||void 0===A||null===(D=A.data)||void 0===D?void 0:D.shippingAddress),"PENDING"===(null==w||null===(l=w.data)||void 0===l||null===(i=l.data)||void 0===i||null===(n=i.paymentStatus)||void 0===n?void 0:n.toUpperCase())&&(e>0?p.fireRedirectPullingRequest=!0:(S("Pending"),M(!1),h.onPage="payment",p.orderPending=!0,u())),"SUCCESS"===(null==w||null===(t=w.data)||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.paymentStatus)||void 0===a?void 0:a.toUpperCase())){var L,O,U,Z,B,H,V,q,z,Y,$,X,ee,le,ie,ne,te,oe,ae,de,re,se;if(E.Z.paymentSuccessBilldesk(J,null===(L=w.data)||void 0===L||null===(O=L.data)||void 0===O||null===(U=O.shippingAddress)||void 0===U?void 0:U.phone,{items:w.data.data.lineItems},null===(Z=w.data)||void 0===Z||null===(B=Z.data)||void 0===B?void 0:B.shippingAddress,null===(H=w.data)||void 0===H||null===(V=H.data)||void 0===V?void 0:V.couponCode,null==p?void 0:p.orderDetails,null===(q=w.data)||void 0===q||null===(z=q.data)||void 0===z?void 0:z.shippingTag,null===(Y=w.data)||void 0===Y||null===($=Y.data)||void 0===$?void 0:$.paymentMethod),"SUCCESS"===(null==w||null===(X=w.data)||void 0===X||null===(ee=X.data)||void 0===ee||null===(le=ee.status)||void 0===le?void 0:le.toUpperCase())){var ue,ce,ve;if(p.fireRedirectPullingRequest=!1,p.fireSetuRequest=!1,clearInterval(K),!p.isAfterSellCookieSet)if(p.isAfterSellCookieSet=!0,!W&&null!=h&&null!==(ce=h.sellerConfig)&&void 0!==ce&&null!==(ve=ce.aftersellConfig)&&void 0!==ve&&ve.isEnabled){var me,ge,pe,he,ye,fe,_e,Ce,xe,be,Ae,Ee,Se,De,we,Ne,Ie,ke,Te,Pe;let e=null==w||null===(me=w.data)||void 0===me||null===(ge=me.data)||void 0===ge||null===(pe=ge.lineItems)||void 0===pe?void 0:pe.map((e=>({id:null==e?void 0:e.productId,variants:[null==e?void 0:e.itemId],quantity:null==e?void 0:e.quantity})));window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrAfterSellData",data:JSON.stringify({phoneNo:null==w||null===(he=w.data)||void 0===he||null===(ye=he.data)||void 0===ye||null===(fe=ye.shippingAddress)||void 0===fe?void 0:fe.phone,cartTotal:null==w||null===(_e=w.data)||void 0===_e||null===(Ce=_e.data)||void 0===Ce?void 0:Ce.prepaidPrice,variantArray:e}),time:Q(new Date,0===(null==h||null===(xe=h.sellerConfig)||void 0===xe||null===(be=xe.aftersellConfig)||void 0===be?void 0:be.time)?5:null==h||null===(Ae=h.sellerConfig)||void 0===Ae||null===(Ee=Ae.aftersellConfig)||void 0===Ee?void 0:Ee.time)}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTime",data:Q(new Date,0===(null==h||null===(Se=h.sellerConfig)||void 0===Se||null===(De=Se.aftersellConfig)||void 0===De?void 0:De.time)?5:null==h||null===(we=h.sellerConfig)||void 0===we||null===(Ne=we.aftersellConfig)||void 0===Ne?void 0:Ne.time),time:Q(new Date,0===(null==h||null===(Ie=h.sellerConfig)||void 0===Ie||null===(ke=Ie.aftersellConfig)||void 0===ke?void 0:ke.time)?5:null==h||null===(Te=h.sellerConfig)||void 0===Te||null===(Pe=Te.aftersellConfig)||void 0===Pe?void 0:Pe.time)}},"*")}else window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrAfterSellData",data:{},time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrrOrderPlacedTime",data:{},time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*"),window.parent.postMessage({trigger:"set-cookie",data:{name:"isUpsellFastrr",data:{},time:"Thu, 01 Jan 1970 00:00:00 UTC"}},"*");p.orderPlacedDetails=null==w||null===(ue=w.data)||void 0===ue?void 0:ue.data,S("Success"),M(!1),h.onPage="payment",u()}"PENDING"===(null==w||null===(ie=w.data)||void 0===ie||null===(ne=ie.data)||void 0===ne||null===(te=ne.status)||void 0===te?void 0:te.toUpperCase())&&(e>0?(p.fireRedirectPullingRequest=!0,"woocommerce"===(null==h||null===(re=h.sellerConfig)||void 0===re?void 0:re.channel)&&S("Success")):("woocommerce"!==(null==h||null===(se=h.sellerConfig)||void 0===se?void 0:se.channel)&&S("Pending"),M(!1),h.onPage="payment",u())),"FAILED"===(null==w||null===(oe=w.data)||void 0===oe||null===(ae=oe.data)||void 0===ae||null===(de=ae.status)||void 0===de?void 0:de.toUpperCase())&&(S("Pending"),M(!1),h.onPage="payment",u())}"FAILED"===(null==w||null===(d=w.data)||void 0===d||null===(c=d.data)||void 0===c||null===(v=c.paymentStatus)||void 0===v?void 0:v.toUpperCase())&&(f(!0),M(!1),h.onPage="payment",u()),null!=w&&null!==(m=w.data)&&void 0!==m&&null!==(g=m.data)&&void 0!==g&&g.clientOrderReturnUrl&&"SUCCESS"===(null==w||null===(y=w.data)||void 0===y||null===(_=y.data)||void 0===_?void 0:_.status).toUpperCase()&&(p.fireRedirectPullingRequest=!1,p.fireSetuRequest=!1,clearInterval(K),p.orderCompleteUrl=null==w||null===(N=w.data)||void 0===N||null===(I=N.data)||void 0===I?void 0:I.clientOrderReturnUrl,(0,P.X)(null==w||null===(k=w.data)||void 0===k||null===(T=k.data)||void 0===T?void 0:T.channel,null==w||null===(j=w.data)||void 0===j||null===(R=j.data)||void 0===R?void 0:R.clientOrderReturnUrl))}catch(l){var je,Fe,Re,Le;null!=l&&null!==(je=l.response)&&void 0!==je&&null!==(Fe=je.data)&&void 0!==Fe&&null!==(Re=Fe.error)&&void 0!==Re&&null!==(Le=Re.message)&&void 0!==Le&&Le.includes("order doesn't belong to this")?G(!0):e>0?p.fireRedirectPullingRequest=!0:(p.billdeskDetailsFetched=!0,w(!0),M(!1))}})(e))}),3e3),h.redirectPullingInterval=K})()}),[h.configFetched]),(0,n.useEffect)((()=>{h.configFetched||q?q&&j.y.removeItem("configfetchAfterRedirectionTried"):(async()=>{try{if(!h.configFetched){j.y.setItem("configfetchAfterRedirectionTried","1");const c=await x.Z.getWithUid(C.Z.SELLER_CONFIG(),Y);var e,l,i,n,t,o,a,d,r,s;c&&(j.y.removeItem("configfetchAfterRedirectionTried"),h.configFetched=!0,h.sellerConfig=c.data.data,Z(!1),(null==c||null===(e=c.data)||void 0===e||null===(l=e.data)||void 0===l||null===(i=l.uiConfig)||void 0===i||null===(n=i.header)||void 0===n?void 0:n.background_color)&&H(null==c||null===(t=c.data)||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.uiConfig)||void 0===a||null===(d=a.header)||void 0===d?void 0:d.background_color),null!=c&&null!==(r=c.data)&&void 0!==r&&null!==(s=r.data)&&void 0!==s&&s.cardDesign&&(p.cardDesignEnabled="1"===j.y.getItem("isCardDesign"),u()))}}catch(e){h.configFetched=!0,Z(!1)}})()}),[]),(0,v.jsxs)("div",{className:"App",style:{boxShadow:g.get("seller-domain")?"0 5px 5px #E8ECFF, 2px 2px 5px #E8ECFF":"",overflow:"scroll",height:"100vh"},children:[!y&&"Success"!==_&&(0,v.jsx)("div",{className:null!=p&&p.cardDesignEnabled?"HeaderComponentCard":"HeaderComponent",children:(0,v.jsx)("div",{className:null!=p&&p.cardDesignEnabled?"px-12":"px-24 pt-24",style:{backgroundColor:B||"var(--white)",paddingTop:"www.soni.fashion"===h.sellerConfig.domainName?0:null!=p&&p.cardDesignEnabled?"8px":"24px"},children:(0,v.jsx)(O.Z,{cardDesignEnabled:!(null!=p&&p.cardDesignEnabled),isHeadless:g.get("seller-domain")&&!g.get("isFastrrProduct"),onRender:u,onRenderLoading:u,fetchingDetails:R})})}),(R||U||!p.fireRedirectPullingRequest&&U)&&"Success"!==_&&!V&&!q&&(0,v.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"90vh",flexDirection:"column",backgroundColor:null!=p&&p.cardDesignEnabled?"var(--body-bg-color)":"#FFF"},children:[(0,v.jsx)(k.Z,{}),(0,v.jsx)("div",{style:{marginTop:"20px"},children:(0,v.jsx)(I.Z,{alertMessage:"Verifying payment....",type:"success"})})]}),"woocommerce"===(null==h||null===(t=h.sellerConfig)||void 0===t?void 0:t.channel)&&"Success"===_&&(0,v.jsx)(T.Z,{}),!U&&"Success"===_&&"woocommerce"!==(null==h||null===(a=h.sellerConfig)||void 0===a?void 0:a.channel)&&(0,v.jsx)(N,{isHeadless:g.get("seller-domain")?g.get("seller-domain"):null,marketConfigPairs:J}),!U&&y&&(0,v.jsx)(d.Z,{image:"paymentFailed",heading:"Payment Failed",subheading:"Your payment was not completed. Any amount if deducted will get refunded within 4-7 days..",ctaText:"Back to Home"}),!U&&"Pending"===_&&!V&&!q&&(null!=p&&p.cardDesignEnabled?(0,v.jsx)(L,{}):(0,v.jsx)(A.Z,{})),(V||q)&&(0,v.jsx)(d.Z,{image:"pending_icon",heading:"Order pending",subheading:"It can take upto 15 minutes for payment confirmation after which your order will be placed. If the order is not placed and money is deducted from your account, the amount will be fully refunded within 5 working days.",ctaText:"Back to Home"}),!U&&D&&(0,v.jsx)("div",{style:null!=p&&p.cardDesignEnabled?{height:"90vh",display:"flex"}:{},children:(0,v.jsx)(d.Z,{image:"server_error",heading:"Something Went Wrong",subheading:"Please try again..",ctaText:"Back to Home"})}),(0,v.jsx)(b.Z,{show:!0})]})};var U=i(8805);const Z=()=>{const e=(0,o.v9)((e=>e.Toast.toasts)),l=(0,o.I0)();return e.length?(0,v.jsx)("div",{className:"styles_overlay__1nGtW",children:(0,v.jsx)("div",{className:"styles_toastContainer__5QVQ5",children:e.map((e=>(0,v.jsxs)("div",{className:"styles_toastText__zv7e-",onClick:()=>e.closeOnClick&&l((0,U.R)(e.id)),children:[(0,v.jsx)("span",{style:{marginRight:"10px"},children:"✅"}),(0,v.jsx)("p",{children:e.message})]},e.id)))})}):null},B=n.lazy((()=>Promise.all([i.e(422),i.e(945)]).then(i.bind(i,61)))),H=n.lazy((()=>Promise.all([i.e(422),i.e(91)]).then(i.bind(i,1402)))),V=n.lazy((()=>Promise.all([i.e(568),i.e(61)]).then(i.bind(i,6568)))),G=n.lazy((()=>Promise.all([i.e(422),i.e(517),i.e(589)]).then(i.bind(i,1517)))),W=n.lazy((()=>Promise.all([i.e(422),i.e(526),i.e(428)]).then(i.bind(i,5150)))),q=function(e){var l,i,t,r,s,u;const c=window.location.search;let p=new URLSearchParams(c),y=null!=p.get("channel")?p.get("channel"):null,C=null!=p.get("type")?p.get("type"):null,x=!!p.get("seller-domain");null!=p.get("redirect")&&p.get("redirect");try{var b,A=null===(b=JSON.parse(decodeURIComponent(window.atob(y))))||void 0===b?void 0:b.shop_url}catch(e){}let E=null!=p.get("application")?p.get("application"):null,S=(null===(l=new URLSearchParams(null===(i=window)||void 0===i||null===(t=i.location)||void 0===t||null===(r=t.hash)||void 0===r?void 0:r.slice(1)))||void 0===l?void 0:l.get("cart"))||(null!==h.VG&&void 0!==h.VG&&h.VG.includes(A)&&"appmaker"!==E?_.Z.getItem("fastrrCart"):null!=p.get("cart")?p.get("cart"):null),D=null!=p.get("fastrr_transaction_id")?p.get("fastrr_transaction_id"):null,w=null!=p.get("seller_id")?p.get("seller_id"):null,N=null!=p.get("seller")?p.get("seller"):null,I=(null!=p.get("fastrr_status")&&p.get("fastrr_status"),null!=p.get("platform")?p.get("platform"):null),k=null!=p.get("after_sell_id")?p.get("after_sell_id"):null,T=null!=p.get("fastrr_ctp_id")?p.get("fastrr_ctp_id"):null,P=null!=p.get("masonPayload")?p.get("masonPayload"):null,j=null!=p.get("login")?p.get("login"):null,F=null!=p.get("themeColor")?p.get("themeColor"):null,R=null!=p.get("error_msg")?p.get("error_msg"):null,L="shiprocketLogin"==p.get("popupType"),O=null!=p.get("pageType")?p.get("pageType"):null;const[U,q]=(0,n.useState)(!0),[z,Y]=(0,n.useState)(!0),[Q,J]=(0,n.useState)(!0),[K,$]=(0,n.useState)(!1);let X=p.get("fbp"),ee=p.get("fbc"),le=null!=p.get("utm_params")?p.get("utm_params"):null;try{if(le&&(le=function(e){let l="",i=e;for(;l!==i;)l=i,i=decodeURIComponent(i);return i}(escape(window.atob(le))),le)){let e={},l="WOOCOMMERCE"==I?le.split("|||"):le.split("&");for(var ie=0;ie{var n=new Date(i);n.setDate(n.getDate()),document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(l)+"; expires="+n.toUTCString()+";path=/;SameSite=None;Secure"},te="Thu, 01 Jan 2030 00:00:00 UTC";p.get("fbp")&&ne("_fbp",p.get("fbp"),te),p.get("fbc")&&ne("_fbc",p.get("fbc"),te);try{null==S?console.log("Checkout can't be initiated"):S=JSON.parse(decodeURIComponent(window.atob(S)))}catch(e){S=null}null==y?console.log("Checkout can't be initiated"):y=JSON.parse(decodeURIComponent(window.atob(y))),P&&(P=JSON.parse(decodeURIComponent(window.atob(P))));const[oe,ae]=(0,n.useState)(!1),de=()=>{ae(!oe)},re=e=>{Y(e)},se=e=>{J(e)};return(0,v.jsxs)(o.zt,{store:a.Z,children:[(window.ononline=e=>{q(!0)},void(window.onoffline=e=>{q(!1)})),L&&(0,v.jsx)(n.Suspense,{fallback:(0,v.jsx)(v.Fragment,{}),children:(0,v.jsx)(G,{shiprocketLoginPageType:O,onRender:de,onError:re,platform:I})}),U&&z&&Q&&!K&&!k&&!T&&!L&&(D||w?(0,v.jsx)(M,{billDeskTransactionId:D,fastrrSellerId:w,sellerDomain:N,onRender:de}):(0,v.jsx)(n.Suspense,{fallback:(0,v.jsx)(v.Fragment,{}),children:"sr-login"===j?(0,v.jsx)(V,{channel:y,cartItems:S,type:C,onRender:de,onError:re,onNetworkError:se,fbp:X,fbc:ee,utm_params:le,masonPayload:P,platform:I,applicationType:E,themeColor:F}):(0,v.jsx)(W,{channel:y,cartItems:S,type:C,onRender:de,onError:re,onNetworkError:se,fbp:X,fbc:ee,utm_params:le,masonPayload:P,platform:I,applicationType:E,userLimitReachHeadlessError:e=>{$(e)}})})),!U&&!k&&!T&&!L&&(0,v.jsx)(g,{isHeadless:x}),!z&&U&&!k&&!T&&!L&&(0,v.jsx)(f,{isHeadless:x,redirectUrl:null===(s=y)||void 0===s?void 0:s.redirectUrl,platform:I,errorMessage:R,domainName:null===(u=y)||void 0===u?void 0:u.shop_url}),!Q&&U&&!k&&!T&&!L&&(0,v.jsx)(m,{isHeadless:x}),K&&!k&&!T&&!L&&(0,v.jsx)(d.Z,{image:"broken-link",heading:"This page isn't available!",subheading:"Explore similar options or discover something new below",height:"100vh"}),k&&!L&&(0,v.jsx)(n.Suspense,{fallback:(0,v.jsx)(v.Fragment,{}),children:(0,v.jsx)(B,{})}),T&&!L&&(0,v.jsx)(n.Suspense,{fallback:(0,v.jsx)(v.Fragment,{}),children:(0,v.jsx)(H,{})}),(0,v.jsx)(Z,{})]})};var z=i(8789),Y=i(8061),Q=i(564),J=i(8371);const K=()=>((0,n.useEffect)((()=>{Promise.all([i.e(422),i.e(526),i.e(428)]).then(i.bind(i,5150)),Promise.all([i.e(422),i.e(526),i.e(367),i.e(478)]).then(i.bind(i,8438)),window.parent.postMessage({trigger:"set-cookie",data:{name:"fastrr_user_id",data:j.y.getItem("user_id")?j.y.getItem("user_id"):"",...j.y.getItem("user_id")?{}:{time:"Thu, 01 Jan 1970 00:00:00 UTC"}}},"*"),window.parent.postMessage({trigger:"send-collect-events",data:{eventData:{etype:"USER_EVENT_IDENTIFY",knownUser:!!j.y.getItem("user_id"),...j.y.getItem("user_id")?{user_id:j.y.getItem("user_id")}:{}}}},"*")}),[]),(0,v.jsx)("div",{id:"prefetch"}));Y.S({dsn:"fastrr-boost-ui.pickrr.com"===window.location.host?"https://016a0b3c266db14dc680ab53d9ab3310@sentry.pickrr.com/2":"https://ee2edfe5de6af29c8d4db987a895d220@sentry.pickrr.com/3",integrations:[new Q.gE,new J.U],tracesSampleRate:.2});const $=window.location.search;let X=new URLSearchParams($),ee=null!=X.get("after_sell_id")?X.get("after_sell_id"):null,le=null!=X.get("fastrr_ctp_id")?X.get("fastrr_ctp_id"):null,ie=(null!=X.get("login")&&X.get("login"),"shiprocketLogin"==X.get("popupType"));const ne=null==X?void 0:X.get("prefetch");let te=function(e){"headless-storage"===e.data.trigger&&(_.Z.setLocalStorage(e.data.data),ne?t.render((0,v.jsxs)(n.StrictMode,{children:[" ",(0,v.jsx)(K,{})," "]}),document.getElementById("root")):t.render((0,v.jsx)(z.VK,{children:(0,v.jsx)(n.StrictMode,{children:ie?(0,v.jsx)("div",{className:"LoginApp",children:(0,v.jsx)(q,{})}):ee||le?(0,v.jsx)(q,{}):(0,v.jsx)("div",{style:{width:"100%"},children:(0,v.jsx)("div",{className:"App",style:{background:"transparent"},children:(0,v.jsx)(q,{})})})})}),document.getElementById("root")),window.removeEventListener("message",te,!1))};window.onerror=function(e,l,i,n,t){if("string"==typeof e&&e.includes("ResizeObserver loop"))return console.warn("ResizeObserver error suppressed:",e),!0},window.addEventListener("message",te,!1),window.parent.postMessage({trigger:ne?"headless-storage-prefetch":ie?"headless-storage":le||ee?le?"headless-storage-ctp":"headless-storage-upsell":"headless-storage",actions:[{action:"loadStorage",data:{trigger:ne?"headless-storage-prefetch":ie?"headless-storage":le||ee?le?"headless-storage-ctp":"headless-storage-upsell":"headless-storage"}}]},"*"),console.log=function(){}},9094:(e,l,i)=>{i.d(l,{Z:()=>t});var n={};const t={getItem(e){try{return n[e]?n[e]:null}catch(e){return null}},setItem(e,l){n[e]=l,window.parent.postMessage({trigger:"headless-storage",actions:[{action:"setItem",data:{key:e,value:l}}]},"*")},removeItem(e){n.hasOwnProperty(e)&&(delete n[e],window.parent.postMessage({trigger:"headless-storage",actions:[{action:"removeItem",data:{key:e}}]},"*"))},setLocalStorage(e){n=e?JSON.parse(e):localStorage}}},7083:(e,l,i)=>{i.d(l,{Z:()=>h});var n,t,o=i(9094),a=i(9218),d=i(1608),r=i(2199),s=i(7555),u=i(2718);const c=new URLSearchParams(window.location.search),v=null!==(n=c.get("uuid"))&&void 0!==n?n:null,m=null!==(t=c.get("linkId"))&&void 0!==t?t:null,g=i(1881).default,p=(e,l)=>{o.Z.getItem("x-session-token"),d.y.getItem("seller_id"),window.parent.postMessage({trigger:"get-uuid-usid-parent",actions:[{action:"getUUIDParent",data:{sendMessage:!1}}]},"*");let i={headers:{"Content-type":"application/json","X-Device-Id":"fastrr",..."fastrr-boost-ui.pickrr.com"!==window.location.host&&o.Z.getItem("xtestnamespace")&&{"X-Test-Namespace":o.Z.getItem("xtestnamespace")}}};e&&(i.headers.sId=e),v&&(i.headers.uuid=v);const n=g.create(i);return n.interceptors.request.use((async e=>{m&&(e.headers["X-PURCHASE-LINK-ID"]=m);let l=new Date(Date.now()+3e4){e.setExtras({response_headers:l.headers,response:l}),r.uT("Refresh-Token-".concat(a.Q.apiIdentityService,"session/create"))})),d.y.removeItem("refreshToken"),d.y.removeItem("refreshTokenValue"),d.y.removeItem("user_id"),d.y.removeItem("seller_id"),d.y.removeItem("pim_sid"),d.y.removeItem("expireTime"),console.log("Refresh Token Call Failed 1"),c.get("after_sell_id")||c.get("fastrr_ctp_id")||setTimeout((function(){window.location.reload()}),1e3)}catch(e){d.y.removeItem("refreshToken"),d.y.removeItem("refreshTokenValue"),d.y.removeItem("user_id"),d.y.removeItem("seller_id"),d.y.removeItem("pim_sid"),d.y.removeItem("expireTime"),c.get("after_sell_id")||c.get("fastrr_ctp_id")||setTimeout((function(){window.location.reload()}),1e3)}})),l&&(n.defaults.timeout=l),n},h={get:(e,l)=>p(l).get(e),getWithHeaders:(e,l,i)=>{const n=p(l),t={};return i&&Object.keys(i).length&&(t.headers={...i}),n.get(e,t)},getWithParams:(e,l)=>p().get(e,{params:l}),post:(e,l,i)=>p(i).post(e,l),put:(e,l,i)=>p(i).put(e,l),getWithUid:(e,l,i)=>p(i).get(e,{headers:{uId:l}}),deletee:(e,l)=>p(l).delete(e),abandantCartWith:(e,l,i)=>p(i).get(e,{headers:{"user-passport":JSON.stringify(l)}}),getAddressWithHeaders:(e,l,i,n)=>p(n).get(e,{headers:{"X-FETCH-ADDRESS-FLAG":l,...!l&&{"X-IS-ADDRESS-SAVED":i}}}),postwithExtraParmas:(e,l,i,n,t,o)=>p(i).post(e,l,{headers:{"x-fbp":n,...t&&{"x-fbc":t},...o&&{"x-cfip":o}}}),postWithTimeout:(e,l,i,n)=>p(i,n).post(e,l),postWithHeaders:(e,l,i,n)=>{const t=p(i),o={};return n&&Object.keys(n).length&&(o.headers={...n}),t.post(e,l,o)},putWithHeaders:(e,l,i,n)=>{const t=p(i),o={};return n&&Object.keys(n).length&&(o.headers={...n}),t.put(e,l,o)}}},4835:(e,l,i)=>{i.d(l,{Z:()=>a});var n=i(9094);const t=i(1881).default,o=()=>{const e=n.Z.getItem("checkoutToken"),l="x-session-token",i=n.Z.getItem(l);let o={headers:{"Content-type":"application/json"},withCredentials:!0};i&&(o.headers[l]=i),e&&(o.headers.authorization="Bearer "+e);const a=t.create(o);return a.interceptors.response.use((function(e){return e.headers[l]&&n.Z.setItem(l,e.headers[l]),e}),(function(e){return Promise.reject(e)})),a},a={get:(e,l)=>(e=void 0!==l?e+l:e,o().get(e)),getWithParams:(e,l)=>o().get(e,{params:l}),post:(e,l)=>o().post(e,l),update:(e,l,i)=>o().put(e,l),remove:(e,l)=>o().delete(e+l)}},1608:(e,l,i)=>{i.d(l,{y:()=>s});var n=i(9094);let t=new(i(1318))("","").getResult().os.name;const o=(e,l,i)=>{var n=new Date(i);n.setDate(n.getDate()),document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(l)+"; expires="+n.toUTCString()+";path=/;SameSite=None;Secure"},a=e=>{let l=e+"=",i=document.cookie.split(";");for(let e=0;e{try{return!(!localStorage.getItem("refreshTokenValue")||"iOS"===t)}catch(e){return!1}},r=()=>{try{return!("iOS"===t||!a("fastrrTestCookie"))}catch(e){return!1}},s={setItem:(e,l)=>{d()?(localStorage.setItem(e,l),r()&&o(e,l,"Thu, 01 Jan 2070 00:00:00 UTC")):r()?o(e,l,"Thu, 01 Jan 2070 00:00:00 UTC"):n.Z.setItem(e,l)},getItem:e=>d()?(r()&&(a("refreshToken")||(o("pim_sid",localStorage.getItem("pim_sid"),"Thu, 01 Jan 2070 00:00:00 UTC"),o("expireTime",localStorage.getItem("expireTime"),"Thu, 01 Jan 2070 00:00:00 UTC"),o("refreshToken",localStorage.getItem("refreshToken"),"Thu, 01 Jan 2070 00:00:00 UTC"),o("refreshTokenValue",localStorage.getItem("refreshTokenValue"),"Thu, 01 Jan 2070 00:00:00 UTC"),o("user_id",localStorage.getItem("user_id"),"Thu, 01 Jan 2070 00:00:00 UTC"))),localStorage.getItem(e)):r()?decodeURIComponent(a(e)):n.Z.getItem(e),removeItem:e=>{var l,i;(()=>{try{return void 0!==window.localStorage&&"iOS"!==t}catch(e){return!1}})()&&localStorage.removeItem(e),r()?(l=e,"",(i=new Date("Thu, 01 Jan 1970 00:00:00 UTC")).setDate(i.getDate()),document.cookie=encodeURIComponent(l)+"="+encodeURIComponent("")+"; expires="+i.toUTCString()+";path=/;SameSite=None;Secure"):n.Z.removeItem(e)}}},7075:(e,l,i)=>{i.d(l,{Z:()=>le});i(9218);const{gtag:n,install:t}=i(2953);let o=null;const a=e=>{o=e,t(o,{cookie_flags:"max-age=7200;secure;samesite=none"}),e&&n("config",o,{cookie_flags:"max-age=7200;secure;samesite=none"})};var d=i(5749),r=i.n(d),s=i(9563);let u,c;const v=()=>({fbp:(0,s.ej)("_fbp"),fbc:(0,s.ej)("_fbc")}),m=["em","fn","ln","ph","ct","st","zp","country"];async function g(e){const l={...e};return await Promise.all(null==m?void 0:m.map((async e=>{l[e]&&(l[e]=await async function(e){try{var l,i,n,t,o;const a=new TextEncoder,d=null==a?void 0:a.encode(null==e||null===(l=e.trim())||void 0===l?void 0:l.toLowerCase()),r=await(null===(i=crypto)||void 0===i||null===(n=i.subtle)||void 0===n?void 0:n.digest("SHA-256",d));return null==Array||null===(t=Array.from(new Uint8Array(r)))||void 0===t||null===(o=t.map((e=>{var l;return null==e||null===(l=e.toString(16))||void 0===l?void 0:l.padStart(2,"0")})))||void 0===o?void 0:o.join("")}catch(l){return console.log(l),e}}(l[e]))}))),l}const p=(e,l,i)=>{const{fbp:n,fbc:t}=v();u=e,c=l,u&&r().init(u,{external_id:l,fbp:n,fbc:t,...i})},h=async(e,l)=>{const{fbp:i,fbc:n}=v();let t={...l,fbp:i,fbc:n};t=await g(t),r().fbq("track",e,t,{eventID:"".concat(c,"_").concat(e)})};var y=i(9094);const{gtag:f,install:_}=i(2953);let C={id:"",purchase_conversion:""};const x=(e,l)=>{var i;(null==C||null===(i=C.id)||void 0===i?void 0:i.length)>0&&(f("set","user_data",{email:e.email,phone_number:e.mobile_number}),console.log({send_to:C.id+"/"+C.purchase_conversion,value:l.final_total,currency:l.currency,transaction_id:l.id}),f("event","conversion",{send_to:C.id+"/"+C.purchase_conversion,value:l.final_total,currency:l.currency,transaction_id:l.id}))},b=e=>{e&&(C.id=null==e?void 0:e.conversion_id,C.purchase_conversion=null==e?void 0:e.conversion_label,f("config",C.id,{allow_enhanced_conversions:!0,cookie_flags:"max-age=7200;secure;samesite=none"}))};var A=i(4130),E=i(2199);let S="";const D=e=>{const l=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",l).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))},w=e=>{try{window.dataLayer.push(e)}catch(l){E.$e((i=>{i.setExtras({error:JSON.stringify(null==l?void 0:l.response),data:JSON.stringify(e)}),E.uT("GTM-DATALAYER-PUSH-ERROR")}))}},N=e=>{S=e,S&&function(e,l,i,n,t){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=l.getElementsByTagName(i)[0],a=l.createElement(i);a.async=!0,a.src="https://www.googletagmanager.com/gtm.js?id="+t,o.parentNode.insertBefore(a,o)}(window,document,"script","dataLayer","".concat(S))},I=async(e,l,i,n,t,o,a)=>{if(S){var d;w({ecommerce:null});let r={event:"cart-init",...e,cart_id:null==l?void 0:l.id,sso:n,fbp:o,fbc:a,...n&&{new:t},ecommerce:{currency:"INR",value:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,coupon:i,items:null==l||null===(d=l.items)||void 0===d?void 0:d.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(r)}},k=async(e,l,i,n)=>{if(S){var t;let o=await D(e);w({ecommerce:null});let a={event:"phone-entered",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:o,new:"new"===n,ecommerce:{currency:"INR",value:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,coupon:i,items:null==l||null===(t=l.items)||void 0===t?void 0:t.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(a)}},T=async(e,l,i)=>{if(S){var n;let t=await D(e);w({ecommerce:null});let o={event:"log-in",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:t,ecommerce:{currency:"INR",value:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,coupon:i,items:null==l||null===(n=l.items)||void 0===n?void 0:n.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(o)}},P=async(e,l,i,n,t,o,a)=>{if(S){var d,r,u,c,v;let l=await D(e),m=await D(null==i?void 0:i.city),g=await D(null==i?void 0:i.state),p=await D(null==i?void 0:i.pincode),h=await D("in"),y=await D(null==i?void 0:i.firstName),f=await D(null==i?void 0:i.lastName),_=await D(null==i?void 0:i.email);w({ecommerce:null});let C={event:"payment-screen",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:l,city:null==i||null===(d=i.city)||void 0===d||null===(r=d.replace(/\s/g,""))||void 0===r?void 0:r.toLowerCase(),city_SHA256:m,state:null==i||null===(u=i.state)||void 0===u||null===(c=u.replace(/\s/g,""))||void 0===c?void 0:c.toLowerCase(),state_SHA256:g,pincode:null==i?void 0:i.pincode,pincode_SHA256:p,country:"in",country_SHA256:h,first_name:null==i?void 0:i.firstName,last_name:null==i?void 0:i.lastName,email:null==i?void 0:i.email,first_name_SHA256:y,last_name_SHA256:f,email_SHA256:_,Shopify_Customerid:a,ecommerce:{currency:"INR",value:null!=o&&o.prepaidPrice?null==o?void 0:o.prepaidPrice:null==o?void 0:o.codPrice,coupon:n,shipping_tier:t.replace("Pickrr-",""),items:null==o||null===(v=o.lineItems)||void 0===v?void 0:v.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(C)}},j=async(e,l,i,n,t,o,a,d)=>{if(S){var r,u,c,v,m;let l=await D(e),g=await D(null==i?void 0:i.city),p=await D(null==i?void 0:i.state),h=await D(null==i?void 0:i.pincode),y=await D("in"),f=await D(null==i?void 0:i.firstName),_=await D(null==i?void 0:i.lastName),C=await D(null==i?void 0:i.email);w({ecommerce:null});let x={event:"payment-init",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:l,city:null==i||null===(r=i.city)||void 0===r||null===(u=r.replace(/\s/g,""))||void 0===u?void 0:u.toLowerCase(),city_SHA256:g,state:null==i||null===(c=i.state)||void 0===c||null===(v=c.replace(/\s/g,""))||void 0===v?void 0:v.toLowerCase(),state_SHA256:p,pincode:null==i?void 0:i.pincode,pincode_SHA256:h,country:"in",country_SHA256:y,first_name:null==i?void 0:i.firstName,last_name:null==i?void 0:i.lastName,email:null==i?void 0:i.email,first_name_SHA256:f,last_name_SHA256:_,email_SHA256:C,Shopify_Customerid:d,ecommerce:{currency:"INR",payment_type:null==t?void 0:t.toUpperCase(),shipping_tier:o.replace("Pickrr-",""),value:null!=a&&a.prepaidPrice?null==a?void 0:a.prepaidPrice:null==a?void 0:a.codPrice,coupon:n,items:null==a||null===(m=a.lineItems)||void 0===m?void 0:m.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(x)}},F=async(e,l,i,n)=>{if(S){var t,o,a,d,r;let u=await D(e),c=await D(null==i?void 0:i.city),v=await D(null==i?void 0:i.state),m=await D(null==i?void 0:i.pincode),g=await D("in"),p=await D(null==i?void 0:i.email);w({ecommerce:null});let h={event:"address-add",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:u,email:null==i?void 0:i.email,email_SHA256:p,city:null==i||null===(t=i.city)||void 0===t||null===(o=t.replace(/\s/g,""))||void 0===o?void 0:o.toLowerCase(),city_SHA256:c,state:null==i||null===(a=i.state)||void 0===a||null===(d=a.replace(/\s/g,""))||void 0===d?void 0:d.toLowerCase(),state_SHA256:v,pincode:null==i?void 0:i.pincode,pincode_SHA256:m,country:"in",country_SHA256:g,ecommerce:{currency:"INR",value:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,coupon:n,items:null==l||null===(r=l.items)||void 0===r?void 0:r.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(h)}},R=async(e,l,i,n,t,o,a,d,r,u,c)=>{try{if(S){var v,m,g,p,h;let l=await D(e),y=await D(null==i?void 0:i.city),f=await D(null==i?void 0:i.state),_=await D(null==i?void 0:i.pincode),C=await D("in"),x=await D(null==i?void 0:i.firstName),b=await D(null==i?void 0:i.lastName),A=await D(null==i?void 0:i.email);w({ecommerce:null});let E={event:"order-placed",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:l,city:null==i||null===(v=i.city)||void 0===v||null===(m=v.replace(/\s/g,""))||void 0===m?void 0:m.toLowerCase(),state:null==i||null===(g=i.state)||void 0===g||null===(p=g.replace(/\s/g,""))||void 0===p?void 0:p.toLowerCase(),pincode:null==i?void 0:i.pincode,country:"in",city_SHA256:y,state_SHA256:f,pincode_SHA256:_,country_SHA256:C,first_name:null==i?void 0:i.firstName,last_name:null==i?void 0:i.lastName,email:null==i?void 0:i.email,first_name_SHA256:x,last_name_SHA256:b,email_SHA256:A,Shopify_Customerid:c,ecommerce:{currency:"INR",value:"COD"===d||u?null==t?void 0:t.codPrice:null==t?void 0:t.prepaidPrice,coupon:n,tax:null==t?void 0:t.totalTax,shipping:"COD"===d||u?Number(null==t?void 0:t.shippingCharges)+Number(null==t?void 0:t.codCharges):null==t?void 0:t.shippingCharges,transaction_id:r,paymentType:o,shipping_tier:a.replace("Pickrr-",""),items:null==t||null===(h=t.lineItems)||void 0===h?void 0:h.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(E)}}catch(e){E.$e((l=>{l.setExtras({error:JSON.stringify(e)}),E.uT("GTM-DATALAYER-PUSH-ERROR-S")}))}},L=async(e,l,i,n,t,o,a)=>{if(S){var d,r,u,c,v;let m=await D(e),g=await D(null==i?void 0:i.city),p=await D(null==i?void 0:i.state),h=await D(null==i?void 0:i.pincode),y=await D("in");w({ecommerce:null}),console.log(l,"checking cart data");let f={event:"payment-success",phone_num:(0,s.un)(e.toString()),phone_num_SHA256:m,city:null==i||null===(d=i.city)||void 0===d||null===(r=d.replace(/\s/g,""))||void 0===r?void 0:r.toLowerCase(),city_SHA256:g,state:null==i||null===(u=i.state)||void 0===u||null===(c=u.replace(/\s/g,""))||void 0===c?void 0:c.toLowerCase(),state_SHA256:p,pincode:null==i?void 0:i.pincode,pincode_SHA256:h,country:"in",country_SHA256:y,ecommerce:{currency:"INR",payment_type:null==a?void 0:a.toUpperCase(),shipping_tier:o.replace("Pickrr-",""),value:null==t?void 0:t.prepaidPrice,coupon:n,items:null==t||null===(v=t.lineItems)||void 0===v?void 0:v.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(f)}},O=async(e,l,i,n,t,o,a,d,r,u,c)=>{if(S){var v,m,g,p,h;let i=await D(l),y=await D(null==n?void 0:n.city),f=await D(null==n?void 0:n.state),_=await D(null==n?void 0:n.pincode),C=await D("in"),x=await D(null==n?void 0:n.firstName),b=await D(null==n?void 0:n.lastName),A=await D(null==n?void 0:n.email);w({ecommerce:null});let E={event:"order-placed",...e,phone_num:(0,s.un)(l.toString()),phone_num_SHA256:i,city:null==n||null===(v=n.city)||void 0===v||null===(m=v.replace(/\s/g,""))||void 0===m?void 0:m.toLowerCase(),state:null==n||null===(g=n.state)||void 0===g||null===(p=g.replace(/\s/g,""))||void 0===p?void 0:p.toLowerCase(),pincode:null==n?void 0:n.pincode,country:"in",city_SHA256:y,state_SHA256:f,pincode_SHA256:_,country_SHA256:C,first_name:null==n?void 0:n.firstName,last_name:null==n?void 0:n.lastName,email:null==n?void 0:n.email,first_name_SHA256:x,last_name_SHA256:b,email_SHA256:A,Shopify_Customerid:c,ecommerce:{currency:"INR",value:"COD"===r?null==o?void 0:o.codPrice:null==o?void 0:o.prepaidPrice,coupon:t,tax:null==o?void 0:o.totalTax,shipping:"COD"===r?Number(null==o?void 0:o.shippingCharges)+Number(null==o?void 0:o.codCharges):null==o?void 0:o.shippingCharges,transaction_id:u,paymentType:a,shipping_tier:d.replace("Pickrr-",""),items:null==o||null===(h=o.lineItems)||void 0===h?void 0:h.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(E)}},M=async(e,l,i,n,t,o,a,d)=>{if(S){var r,u,c,v,m;let g=await D(l),p=await D(null==n?void 0:n.city),h=await D(null==n?void 0:n.state),y=await D(null==n?void 0:n.pincode),f=await D("in");w({ecommerce:null}),console.log(i,"checking cart data");let _={event:"payment-success",...e,phone_num:(0,s.un)(l.toString()),phone_num_SHA256:g,city:null==n||null===(r=n.city)||void 0===r||null===(u=r.replace(/\s/g,""))||void 0===u?void 0:u.toLowerCase(),city_SHA256:p,state:null==n||null===(c=n.state)||void 0===c||null===(v=c.replace(/\s/g,""))||void 0===v?void 0:v.toLowerCase(),state_SHA256:h,pincode:null==n?void 0:n.pincode,pincode_SHA256:y,country:"in",country_SHA256:f,ecommerce:{currency:"INR",payment_type:null==d?void 0:d.toUpperCase(),shipping_tier:a.replace("Pickrr-",""),value:null==o?void 0:o.prepaidPrice,coupon:t,items:null==o||null===(m=o.lineItems)||void 0===m?void 0:m.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(_)}},U=async(e,l,i,n,t,o,a,d)=>{if(S){var r;w({ecommerce:null});let s={event:"delivery-speed-changed",cart_id:null==e?void 0:e.id,sso:i,...i&&{new:n},Old_delivery_speed_name:t,Old_delivery_speed_price:o,New_delivery_speed_name:a,New_delivery_speed_price:d,ecommerce:{currency:"INR",value:null!=e&&e.totalDiscount?Number(null==e?void 0:e.totalPrice)-Number(null==e?void 0:e.totalDiscount):null==e?void 0:e.totalPrice,coupon:l,items:null==e||null===(r=e.items)||void 0===r?void 0:r.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(s)}},Z=async(e,l,i,n,t)=>{if(S){var o;w({ecommerce:null});let a={event:e,cart_id:null==l?void 0:l.id,sso:n,...n&&{new:t},ecommerce:{currency:"INR",value:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,coupon:i,items:null==l||null===(o=l.items)||void 0===o?void 0:o.map((e=>({item_id:e.sku,item_name:e.name,currency:"INR",price:e.price,quantity:e.quantity})))}};w(a)}},B=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"Checkout created",data:e},"*")},H=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"login",data:e},"*")},V=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"we_phone",data:e},"*")},G=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"we_first_name",data:e},"*")},W=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"we_last_name",data:e},"*")},q=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"we_email",data:e},"*")},z=e=>{window.parent.postMessage({trigger:"Webengage",eventName:"Checkout updated",data:e},"*")};i(8202);const Y=e=>{window.parent.postMessage({trigger:"Moengage",eventName:e.event,data:{...e.data,domain:JSON.stringify(window.location)}},"*")},Q=async(e,l,i,n)=>{var t;let o={event:"fastrr_checkout_initiated",data:{unique_id_value:(0,s.un)(null==i?void 0:i.mobile_number),phoneNo:(0,s.un)(null==i?void 0:i.mobile_number),cart_id:null==e?void 0:e.id,promoCode:l,discount:null==e?void 0:e.totalDiscount,totalAmount:null!=e&&e.totalDiscount?Number(null==e?void 0:e.totalPrice)-Number(null==e?void 0:e.totalDiscount):null==e?void 0:e.totalPrice,items:JSON.stringify(null==e||null===(t=e.items)||void 0===t?void 0:t.map((e=>({id:e.sku,productId:e.productId,title:e.name,variantId:e.itemId,currency:"INR",price:e.price,discount:e.discount,quantity:e.quantity}))))}};Y(o)},J=async(e,l,i,n,t,o,a,d,r)=>{try{var u,c,v,m;const i=null==a||null===(u=a.shippingAddress)||void 0===u?void 0:u.firstName,o=null==a||null===(c=a.shippingAddress)||void 0===c?void 0:c.lastName,g=null==a||null===(v=a.shippingAddress)||void 0===v?void 0:v.email;let p={event:"fastrr_payment_inititated",data:{unique_id_value:"email"==r?g:(0,s.un)(e),platformCustomerId:d.platformCustomerId,firstName:i,lastName:o,email:g,payment_mode:null==t?void 0:t.toUpperCase(),phoneNo:(0,s.un)(e),cart_id:null==l?void 0:l.id,promoCode:n,discount:null==l?void 0:l.totalDiscount,totalAmount:null!=a&&a.prepaidPrice?null==a?void 0:a.prepaidPrice:null==a?void 0:a.codPrice,items:JSON.stringify(null==a||null===(m=a.lineItems)||void 0===m?void 0:m.map((e=>({id:e.sku,productId:e.productId,title:e.name,variantId:e.itemId,currency:"INR",price:e.price,discount:e.discount,quantity:e.quantity}))))}};Y(p)}catch(e){console.log("moengage",e)}},K=async(e,l,i,n,t,o)=>{var a;let d={event:"fastrr_abandon_checkout",data:{unique_id_value:(0,s.un)(null==t?void 0:t.mobile_number),abandon_cart_url:n,phoneNo:(0,s.un)(e||t.mobile_number),cart_id:null==l?void 0:l.id,promoCode:i,discount:null==l?void 0:l.totalDiscount,totalAmount:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,items:JSON.stringify(null==l||null===(a=l.items)||void 0===a?void 0:a.map((e=>({id:null==e?void 0:e.sku,productId:null==e?void 0:e.productId,title:null==e?void 0:e.name,variantId:null==e?void 0:e.itemId,currency:"INR",price:null==e?void 0:e.price,discount:null==e?void 0:e.discount,quantity:null==e?void 0:e.quantity}))))}};Y(d)};var $=i(5763),X=i(804),ee={initialiseAnalytics:(e,l,i,n,t,o,d,r,s)=>{"fireAllEvents"===d?(a(e),b(n),A.Z.initializeWigzo(i)):"onlyPixel"===d&&(console.log(t,"checking cart id"),p(l,t,{}))},createUserProfile:e=>{A.Z.createUserProfile(e)},trackCreateOrder:e=>{var l;null==e||e.currency,null==e||e.total_price,null==e||null===(l=e.line_items)||void 0===l||l.length,y.Z.getItem("user_type")},beginCheckout:(e,l)=>{console.log("cart data ",e),l.checkout_initiated&&h("InitiateCheckout",e)},mobileNumberScreenOpened:()=>{y.Z.getItem("user_type")},checkoutStarted:e=>{const l={...null==e?void 0:e.cart_data,cart_token:null==e?void 0:e.cart_id,phone:e.mobile,buyer_accepts_marketing:!0,price:null==e?void 0:e.total_price,abandoned_checkout_url:null==e?void 0:e.domain_name};A.Z.track("checkoutstarted",l)},pincodeFieldDisplayed:()=>{y.Z.getItem("user_type")},pincodeAdded:()=>{y.Z.getItem("user_type")},addressFieldsDisplayed:()=>{y.Z.getItem("user_type")},addressAdded:(e,l,i,n)=>{y.Z.getItem("user_type"),F(e,l,i,n)},addShippingInfo:e=>{y.Z.getItem("user_type"),null==e||e.currency,null==e||e.totalPrice},addDiscountCodeClicked:()=>{y.Z.getItem("user_type")},discountCodeApplied:()=>{y.Z.getItem("user_type")},discountCodeRemoved:()=>{y.Z.getItem("user_type")},otpRequested:()=>{y.Z.getItem("user_type")},addOtpScreenOpened:()=>{y.Z.getItem("user_type")},otpAdded:()=>{y.Z.getItem("user_type")},changeAddressClicked:()=>{y.Z.getItem("user_type")},savedAddressesDrawerOpened:()=>{y.Z.getItem("user_type")},changeShippingMethodClicked:()=>{y.Z.getItem("user_type")},shippingMethodDrawerOpens:()=>{y.Z.getItem("user_type")},shippingOptionSelected:()=>{y.Z.getItem("user_type")},addNewAddressClicked:(e,l,i)=>{var n;let t={currency:null==e?void 0:e.currency,value:null==e?void 0:e.totalPrice,items:null==e||null===(n=e.lineItems)||void 0===n?void 0:n.length,address_type:"saved",AddressCount:i,coupon:l,userType:y.Z.getItem("user_type")||"new"};console.log("here",t)},savedAddressChanged:(e,l,i)=>{var n;null==e||e.currency,null==e||e.total_price,null==e||null===(n=e.line_items)||void 0===n||n.length,y.Z.getItem("user_type")},newAddressDrawerOpened:()=>{y.Z.getItem("user_type")},newAddressSelected:(e,l)=>{var i;null==e||e.currency,null==e||e.total_price,null==e||null===(i=e.line_items)||void 0===i||i.length,y.Z.getItem("user_type")},upiOptionSelected:()=>{y.Z.getItem("user_type")},paymentScreenOpened:(e,l,i,n,t,o,a)=>{y.Z.getItem("user_type"),P(e,l,i,n,t,o,a)},changePaymentMethodClicked:()=>{y.Z.getItem("user_type")},paymentModesDrawerOpens:()=>{y.Z.getItem("user_type")},orderSummaryExpanded:()=>{y.Z.getItem("user_type")},orderSummaryCollapsed:()=>{y.Z.getItem("user_type")},codButtonDisplayed:()=>{y.Z.getItem("user_type")},addPaymentInfo:(e,l)=>{null!=l&&l.payment_initiated&&h("AddPaymentInfo",e)},purchase:(e,l,i)=>{null!=l&&l.order_placed&&h("Purchase",e),null!=l&&l.prepaid_purchase&&i&&h("prepaid_purchase",e)},purchaseConversion:(e,l)=>{x(l,e)},orderSuccessScreenOpened:()=>{y.Z.getItem("user_type")},exitCheckout:e=>{var l;null==e||e.currency,null==e||e.totalPrice,null==e||null===(l=e.lineItems)||void 0===l||l.length,y.Z.getItem("user_type")},changeNumber:()=>{y.Z.getItem("user_type")},buy:e=>{A.Z.buy(e)},checkoutInitiated:function(e,l,i,n,t,o,a){let d=arguments.length>7&&void 0!==arguments[7]&&arguments[7],r=arguments.length>8?arguments[8]:void 0,s=arguments.length>9?arguments[9]:void 0;I(e,l,i,n,t,o,a),d?"false"==(null==e?void 0:e.moengage_is_active)&&K("",l,i,r,s,null==e||e.moengage_customer_id):"false"==(null==e?void 0:e.moengage_is_active)&&Q(l,i,s,null==e||e.moengage_customer_id)},phoneEntered:(e,l,i,n,t)=>{var o,a,d,r;k(e,l,i,n),"false"==(null==t||null===(o=t.moengage)||void 0===o?void 0:o.is_active)&&(null==t||null===(a=t.moengage)||void 0===a||null===(d=a.events)||void 0===d?void 0:d.phone_number_added)&&(async(e,l,i,n)=>{var t;let o={event:"fastrr_phone_entered",data:{unique_id_value:(0,s.un)(e),phoneNo:(0,s.un)(e),cart_id:null==l?void 0:l.id,promoCode:i,discount:null==l?void 0:l.totalDiscount,totalAmount:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,items:JSON.stringify(null==l||null===(t=l.items)||void 0===t?void 0:t.map((e=>({id:e.sku,productId:e.productId,title:e.name,variantId:e.itemId,currency:"INR",price:e.price,discount:e.discount,quantity:e.quantity}))))}};Y(o)})(e,l,i,null==t||null===(r=t.moengage)||void 0===r||r.customer_id)},loggedIn:(e,l,i,n)=>{var t,o,a,d;T(e,l,i),"false"==(null==n||null===(t=n.moengage)||void 0===t?void 0:t.is_active)&&(null==n||null===(o=n.moengage)||void 0===o||null===(a=o.events)||void 0===a?void 0:a.phone_number_added)&&(async(e,l,i,n)=>{var t;let o={event:"fastrr_otp_verified",data:{unique_id_value:(0,s.un)(e),phoneNo:(0,s.un)(e),cart_id:null==l?void 0:l.id,promoCode:i,discount:null==l?void 0:l.totalDiscount,totalAmount:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,items:JSON.stringify(null==l||null===(t=l.items)||void 0===t?void 0:t.map((e=>({id:e.sku,productId:e.productId,title:e.name,variantId:e.itemId,currency:"INR",price:e.price,discount:e.discount,quantity:e.quantity}))))}};Y(o)})(e,l,i,null==n||null===(d=n.moengage)||void 0===d||d.customer_id)},paymentInIt:function(e,l,i,n,t,o,a,d,r){var u,c,v,m,g,p,h,y,f,_;let C=arguments.length>9&&void 0!==arguments[9]&&arguments[9];if("SHOPIFY"===(null===(u=l.platform)||void 0===u?void 0:u.toUpperCase())){var x,b,A,E,S,D,w,N,I,k,T;let n={phone_num:(0,s.un)(null==e?void 0:e.mobileNumber.toString()),city:null==i||null===(x=i.city)||void 0===x||null===(b=x.replace(/\s/g,""))||void 0===b?void 0:b.toLowerCase(),state:null==i||null===(A=i.state)||void 0===A||null===(E=A.replace(/\s/g,""))||void 0===E?void 0:E.toLowerCase(),pincode:null==i?void 0:i.pincode,country:"in",first_name:null==i?void 0:i.firstName,last_name:null==i?void 0:i.lastName,email:null==i?void 0:i.email,ecommerce:{currency:"INR",payment_type:null==t?void 0:t.toUpperCase(),shipping_tier:null==o||null===(S=o.selected_service_data)||void 0===S?void 0:S.pickrr_tag,value:"COD"===t?null==l||null===(D=l.orderDetails)||void 0===D?void 0:D.codPrice:null!==(w=null==l||null===(N=l.orderDetails)||void 0===N?void 0:N.prepaidPrice)&&void 0!==w?w:null==l||null===(I=l.Cart_data)||void 0===I?void 0:I.totalPrice,items:null==l||null===(k=l.Cart_data)||void 0===k||null===(T=k.items)||void 0===T?void 0:T.map((e=>({id:null==e?void 0:e.productId,name:null==e?void 0:e.name,variant:null==e?void 0:e.itemId,brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity})))}};window.parent.postMessage({trigger:"shopify-custom-events",data:{eventName:"Add_PaymentInfoSR",eventData:n}},"*")}if(null!=e&&null!==(c=e.sellerConfig)&&void 0!==c&&null!==(v=c.marketingConfig)&&void 0!==v&&null!==(m=v.ga4)&&void 0!==m&&null!==(g=m.events)&&void 0!==g&&g.payment_initiated&&(null==e||null===(p=e.sellerConfig)||void 0===p||!p.enableGa4MpEvents)){var P,F,R,L,O,M,U,Z,B,H,V,G,W;const i={event:"add_payment_info",data:{event_category:"ecommerce",send_to:null==e||null===(P=e.sellerConfig)||void 0===P||null===(F=P.marketingConfig)||void 0===F||null===(R=F.ga4)||void 0===R?void 0:R.measurement_id,currency:"INR",ecomm_prodid:null==l||null===(L=l.Cart_data)||void 0===L||null===(O=L.items)||void 0===O?void 0:O.map((e=>(0,$.Wv)(e))),value:((null==l||null===(M=l.orderDetails)||void 0===M?void 0:M.totalPrice)||0)+((null===(U=l.orderDetails)||void 0===U?void 0:U.shippingCharges)||0)+((null==l||null===(Z=l.orderDetails)||void 0===Z?void 0:Z.totaltax)||0)-((null==l||null===(B=l.orderDetails)||void 0===B?void 0:B.prepaidDiscount)||0)-((null==l||null===(H=l.orderDetails)||void 0===H?void 0:H.couponDiscount)||0),items:null==l||null===(V=l.Cart_data)||void 0===V||null===(G=V.items)||void 0===G?void 0:G.map((e=>({id:(0,$.Wv)(e),name:null==e?void 0:e.name,variant:"",brand:null==e?void 0:e.brand,category:null==e?void 0:e.type,price:null==e?void 0:e.price,quantity:null==e?void 0:e.quantity}))),payment_type:null==l||null===(W=l.orderDetails)||void 0===W?void 0:W.paymentGateway,coupon:n}};window.parent.postMessage({trigger:"gtag",data:i},"*")}var q,z;j(null==e?void 0:e.mobileNumber,null==l?void 0:l.Cart_data,i,n,t,null==o||null===(h=o.selected_service_data)||void 0===h?void 0:h.pickrr_tag,a,d),"false"==(null==r||null===(y=r.moengage)||void 0===y?void 0:y.is_active)&&!C&&null!=r&&null!==(f=r.moengage)&&void 0!==f&&null!==(_=f.events)&&void 0!==_&&_.payment_initiated&&J(null==e?void 0:e.mobileNumber,null==l?void 0:l.Cart_data,0,n,t,null==o||null===(q=o.selected_service_data)||void 0===q||q.pickrr_tag,a,o,null==r||null===(z=r.moengage)||void 0===z?void 0:z.customer_id),(0,X.N)("payment_initiated",{method:t})},orderPlaced:(e,l,i,n,t,o,a,d,r,u,c,v,m)=>{var g,p,h,y,f,_;R(e,l,i,n,t,o,null==a||null===(g=a.selected_service_data)||void 0===g?void 0:g.pickrr_tag,d,r,u,m),"false"==(null==v||null===(p=v.moengage)||void 0===p?void 0:p.is_active)&&(null==v||null===(h=v.moengage)||void 0===h||null===(y=h.events)||void 0===y?void 0:y.order_placed)&&(async(e,l,i,n,t,o,a,d,r,u,c,v,m)=>{try{var g,p,h,y;const i=null==t||null===(g=t.shippingAddress)||void 0===g?void 0:g.firstName,o=null==t||null===(p=t.shippingAddress)||void 0===p?void 0:p.lastName,a=null==t||null===(h=t.shippingAddress)||void 0===h?void 0:h.email;let r={event:"fastrr_order_placed",data:{unique_id_value:"email"==m?a:(0,s.un)(e),platformCustomerId:v.platformCustomerId,firstName:i,lastName:o,email:a,transaction_id:c,payment_mode:d,phoneNo:(0,s.un)(e),cart_id:null==l?void 0:l.id,promoCode:n,discount:null==l?void 0:l.totalDiscount,totalAmount:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,items:JSON.stringify(null==l||null===(y=l.items)||void 0===y?void 0:y.map((e=>({id:null==e?void 0:e.sku,productId:null==e?void 0:e.productId,title:null==e?void 0:e.name,variantId:null==e?void 0:e.itemId,currency:"INR",price:null==e?void 0:e.price,discount:null==e?void 0:e.discount,quantity:null==e?void 0:e.quantity}))))}};Y(r)}catch(e){}})(e,l,0,n,t,0,null==a||null===(f=a.selected_service_data)||void 0===f||f.pickrr_tag,d,0,0,c,a,null==v||null===(_=v.moengage)||void 0===_?void 0:_.customer_id)},initialiseGTM:e=>{N(e)},paymentSuccess:(e,l,i,n,t,o,a)=>{L(e,l,i,n,t,o,a)},orderPlacedBilldesk:(e,l,i,n,t,o,a,d,r,s,u)=>{O(e,l,i,n,t,o,a,d,r,s,u)},paymentSuccessBilldesk:(e,l,i,n,t,o,a,d)=>{M(e,l,i,n,t,o,a,d)},deliverySpeedChanged:(e,l,i,n,t,o,a,d)=>{U(e,l,i,n,t,o,a,d)},additionalEvents:(e,l,i,n,t)=>{Z(e,l,i,n,t)},checkoutStartedWebengage:e=>{B(e)},loginWebengage:e=>{H(e)},phoneWebengage:e=>{V(e)},firstNameWebengage:e=>{G(e)},lastNameWebengage:e=>{W(e)},emailWebengage:e=>{q(e)},checkoutUpdatedWebengage:e=>{z(e)},viewEventsFB:e=>{h("PageView"),h("ViewContent",e)},orderScreen:(e,l,i,n,t,o,a,d,r,u,c)=>{var v,m,g,p;"false"==(null==c||null===(v=c.moengage)||void 0===v?void 0:v.is_active)&&(null==c||null===(m=c.moengage)||void 0===m||null===(g=m.events)||void 0===g?void 0:g.order_screen)&&(async(e,l,i,n,t,o,a,d,r,u,c)=>{var v,m,g,p;const h=null==t||null===(v=t.shippingAddress)||void 0===v?void 0:v.firstName,y=null==t||null===(m=t.shippingAddress)||void 0===m?void 0:m.lastName,f=null==t||null===(g=t.shippingAddress)||void 0===g?void 0:g.email;let _={event:"fastrr_order_screen",data:{unique_id_value:"email"==c?f:(0,s.un)(e),platformCustomerId:a.platformCustomerId,phoneNo:(0,s.un)(e),firstName:h,lastName:y,email:f,cart_id:null==l?void 0:l.id,promoCode:n,discount:null==l?void 0:l.totalDiscount,totalAmount:null!=l&&l.totalDiscount?Number(null==l?void 0:l.totalPrice)-Number(null==l?void 0:l.totalDiscount):null==l?void 0:l.totalPrice,items:JSON.stringify(null==l||null===(p=l.items)||void 0===p?void 0:p.map((e=>({id:e.sku,productId:e.productId,title:e.name,variantId:e.itemId,currency:"INR",price:e.price,discount:e.discount,quantity:e.quantity}))))}};Y(_)})(e,l,0,n,t,0,a,0,0,0,null==c||null===(p=c.moengage)||void 0===p?void 0:p.customer_id)}};try{typeof sessionStorage==typeof localStorage&&console.log("Analytics enabled")}catch(e){for(let e in ee)ee[e]=()=>{};console.log("Analytics disabled")}const le=ee},2569:(e,l,i)=>{i.d(l,{pj:()=>t,ij:()=>o,Ln:()=>a});const n=e=>{try{window.parent.postMessage({trigger:"shiprocket-checkout-custom-listener",data:JSON.stringify(e)},"*")}catch(e){console.log(e)}},t=e=>{n({data:e})},o=e=>{n({event:"order_placed",data:e})},a=e=>{try{window.parent.postMessage({trigger:"shiprocket-checkout-listener",actions:[{action:"mobileAppPostMessage",data:{event:"exitCheckout",data:{exitCheckout:"exit-checkout"}}}]},"*")}catch(e){console.log(e)}}},4130:(e,l,i)=>{i.d(l,{Z:()=>t});var n="";const t={track:(e,l)=>{let i={...l};if(""!=n){console.log("checkoutsarted",i);const l={eventName:e,wigzoProperties:i};window.parent.postMessage({trigger:"Wigzo",eventName:"track",data:l},"*")}},initializeWigzo:function(e){null!=e&&(n=e,window.parent.postMessage({trigger:"Wigzo",eventName:"configure",data:e},"*"))},createUserProfile:e=>{""!=n&&(console.log("identify",{phone:e}),window.parent.postMessage({trigger:"Wigzo",eventName:"identify",data:{phone:e}},"*"))},buy:e=>{n&&(console.log("buy",e),window.parent.postMessage({trigger:"Wigzo",eventName:"trackBuy",data:e},"*"))},addEmail:(e,l)=>{""!=n&&window.parent.postMessage({trigger:"Wigzo",eventName:"identifyEmail",data:{email:e,fullName:l}},"*")}}},804:(e,l,i)=>{i.d(l,{N:()=>n});const n=(e,l)=>{try{(e=>{try{window.parent.postMessage({trigger:"shiprocket-checkout-custom-listener",data:JSON.stringify(e)},"*")}catch(e){console.log(e)}})({event:e,data:l})}catch(e){console.log(e)}}},6933:(e,l,i)=>{i.d(l,{Z:()=>o});var n=i(7313);var t=i(6417);const o=e=>{console.log(e,"props");const[l,i]=(0,n.useState)(!1),{children:o,label:a,value:d,mandatory:r,disabled:s}=e,u=s?l||d&&0!==d.length||"Pincode"===a?"label label-float-disabled":"label":l||d&&0!==d.length||"Pincode"===a?"label label-float":"label";return(0,t.jsxs)("div",{className:"float-label",onBlur:()=>i(!1),onFocus:()=>i(!0),children:[o,(0,t.jsxs)("label",{className:u,children:[a," ",r&&(0,t.jsx)("span",{className:"".concat(l||d&&0!==d.length||"Pincode"===a?"FloatLabel_asteriskRed__UFUTf":"FloatLabel_asteriskGrey__MQzae"),children:"*"})]})]})}},4460:(e,l,i)=>{i.d(l,{oE:()=>n,i:()=>t,TJ:()=>o,hC:()=>a});const n={pincode:"Please enter a valid 6 digit Pincode",name:"Enter your full name",line1:"Enter required address details",city:"Enter your City",email:"Enter valid email",contact:"Please enter a valid 10 digit phone number",gender:"Please select your gender",tags:"Enter a valid value"},t={pincode:"Please enter a valid 6 digit Pincode",name:"Enter your first name",lastName:"Enter your last name",line1:"Enter required address details",line2:"Enter required address details",landmark:"Enter a landmark",city:"Enter your City",email:"Enter valid email",contact:"Please enter a valid 10 digit phone number",gender:"Please select your gender",tags:"Enter valid upto 25 letters tag"},o=["guest","name","test","firstname","lastname","mr","dr","mrs","m/s","ms","m s"],a=["fastrr.com","gmail.con","gmial.com","gamail.com","gemail.com","gmal.com","gmail.come","gimel.com","gmail.comcom","gmail.cim","gmail.comm","phone.healthifyme.com","gmaill.com","gmail.vom","nomail.com","hotmail.co.in","gmaul.com","gemal.com","g.com","pickrrcustomer.com","gamli.com","gmail.cam","gmail.om","beatouser.com","kaybeebio.co.in","gamil.come","gmila.co","gmale.com","gmail.in","eoc.org","gmail.coml","giml.com","gmail.xom","gmail.coms","gamil.con","g-mail.com","gov.in","gmail.comp","greenherbalcoffee.com","77gmail.com","g.mail","gmail.ckm","gmil.come","gmail.comn","mel.com","ayurslimax.com","gail.co.in","external.swiggy.in","gimel.come","gmail.comi","gmail.coom","gemail.come","gmail.comU","gmail.comail.com","iima.ac.in","myloanonymous.com","121gmail.com","345gmail.com","42gmail.com","3gmail.com","a.com","bhel.in","gamil.cim","gemil.co","gmile.come","gmail.conm","gmail.comr","gmaik.com","gmail.comom","3137gmail.com","9296gmail.com","221gemail.com","1992gmail.com","8229gmail.com","869gmail.com","819gimal.com","8196gmail.com","818gimal.com","240.com","805gmail.com","207gmail.com","8010gamil.com","1999gmail.com","800gmail.com","7gmall.com","148gmail.com","927gmail.com","123gemell.coom","7gmai.com","1045gmail.com","3445icloud.com","8888gmail.com","793.com","2323gmail.com","786.gmail","2161gmail.com","9191gimll.com","2020gimel.com","877gmail.com","772gmail.com","1994gmail.com","766gmail.com","1980gmail.com","176gmail.com","75gamil.com","156email.com","757.come","13gmail.com","756gmail.com","123mail.com","755gmail.com","755455gmail.com","8521218961gmail.com","743gamil.com","850gmail.com","741gmail.com","8899.com","7371gmail.com","888gmail.com","729201787gmaiul.com","30.com","915gmail.com","29.gmail.com","7196gmail.com","2699gmail.com","6gmil.com","253.come","69331gmail.com","240gimail.com","692.com","238gmail.com","690gmail.come","2250gmail.com","688gmail.com","20rawatgmail.com","684gmail.com","2032006email.com","6819gmail.com","672gmail.com","2004gimail.com","66gmail.com","9098gmail.com","1995gmail.com","65873547.com","1994gamli.com","6540gamil.com","64.in","1778email.com","64.gmail.com","63636gmai.com","161199gmail.com","1516gmail.com","62email.com","1435icloud.com","130482313.com","6244gmail.com","129594733.com","623gmail.com","85gemil.com","620gmail.com","8584gmail.com","62034gmii.com","617gmail.com","85245gmail.com","6164gmail.cam","108gmail.com","603gmail.com","101gmaile.com","60026.gmail.com","1.com","9027gmail.com","3467gmail.com","5gaimail.com","345.com","5911.com","3435email.com","59.com","584email.com","30gmali.com","5817.gmail.com","307gimail.com","570gmail.com","887gmail.com","2978gmail.com","569gmail.com","56837gmail.com","27062006.com","560043730.com","2699gimal.com","2561gmail.com","558gaiml.com","555gmail.com","2428gmail.com","5556gmail.com","2409gmail.com","5555gamil.com","886556gmail.com","901gmail.com","882gmail.com","54gamil.com","222gmail.com","547gamil.com","2204gmail.com","54321gmail.com","533gmail.com","2141gmail.com","52gmail.com","523gmail.com","2073.com","514gmail.com","2021gmail.com","512gmail.com","503gmail.com","2004gmail.com","9512gamil.com","49gamil.com","89990gmaip.com","4842gmail.com","4764gmail.com","1994gimel.com","4718gmail.com","1993gamil.com","198gmail.com","1986gamil.com","45gemail.com","1975gmail.com","444gmail.com","195gmail.com","44.com","890Gmail.com","17420gmile.com","4246gmail.com","1720gmail.com","16gimeil.in","156Gmail.come","1520.gmail","40gamil.com","409gamil.com","142gmail.com","407gmail.com","13456789354gmail.com","406gmail.com","089gamil.com","078gmail.com","128887341.com","0707tgmail.com","123gmali.com","050396gmail.com","123gemail.com","032gmail.com","1234emal.com","02330gmail.com","0132.gmail.com","12325.com","0088gmail.com","122gmail.com","0079gmail.com","11gimal.com","0000gmail.com","11.gmail.com","954gmail.com","105gmail.com","37.gmail.com","101983gmail.com","363gmail.com","1005.com","360gmail.com","844gmail.com","349gmail.com","076gmail.com","3gamil.com","07018.com","394gmali.com","3838gmail.com","380gamil.com","00369gmail.com","37gamil.com","953gmail.com","370gmail.com","adiconstructions.com","anandinda.in","canarabank.in","calmado.in","brewmart.in","abfrl.adityabirla.com","brandhawkers.com","a.con","990ys.com","bmcm.in","anandinida.in","classplus.co","bikedid.com","addsystem.in","chinternationalmovers.com","997gamil.com","983gmail.com","chimpad.com","bdrprojects.in","appsforbhatrat.com","ap045cisce.org","bbpltech.com","barodauprrb.co.in","anonpharmaceutical.in","badedeals.in","alphabazaar.in","alphasupply.in","alonemedicines.in","axyabio.in","autoxperties.in","abhivyakti.co.in","ambiencearchitects.in","asiainformationtechnology.in","beveres.org","96gmail.com","klinechemical.in","akasglobal.in","africalogistics.co.in","49qmail.com","citibyblos.in","pantrybuddy.in","apploot.in","bridgeelc.com","benedynehealthcare.in","com.in","beautyfairy.in","bajranginfra.co.in","balajiagri.in","azzahra.in","bookmyraze.in","bigchemind.in","99gmail.com","besscopvtltd.in","pradhamcare.in","99chmail.com","aptart.in","altoprealty.in","89gmil.com","ammolite.in","akprandin.com","beedynehealthcare.in","9.gmail.com","10com","ayushbhar.in","202.com","bizbuzzindia.in","12756432gmail.com","adwitiya.in","sunpharma.co.in","powerprojects.in","990029885gmail.com","9gmaile.com","archanaembellishments.in","5gmail.com","angadfoods.in","90457gmail.com","swarnabuildtech.in","simts.org","carefay.in","aikagra.in","91.gamil.com","gymityoga.com","angelkart.in","gumdigitalltd.in","anaadi.in","calgniorbeverages.in","21gamil.com","abhishekpathlabs.in","agriniral.co.in","99mail.com","abrsolution.in","aaaconstructions.co.in","10abc.in","gift2home.in","cannandino.in","7-mail.com","ammanyadalath.in","aluminiumsmelter.co.in","10gamil.com","9mail.com","9710gmail.com","satyasiddhimaa.in","ambertubes.in","arshadco.in","99gamial.com","9email.com","swatifire.in","akashyogcoaching.in","amaxlogistics.in","ccmcl.co.in","1gmail.com","animaldefence.in","789gmail.com","91gmail.com","elitepharmahealthcare.in","984gmail.com","almeezan.in","cognisone.in","97gmali.com","9lmail.com","advancehealingcenters.in","85091gmail.com","artfly.in","9979gmail.com","amanpharmaceuticals.in","980gmail.com","808gamil.com","anandsagargroup.co.in","808@gmail.com","alphaene.co.in","80gmail.com","82mail.com","808.mail.com","7gemail.com","agitated.in","anucool.co.in","antonellanicola.it","foresightcapital.co","automation.co","akaonlineshopping.in","babamil.com","akssolutions.in","graftoncorporation.co","anyaorganic.in","97gmail.com","aadiimpex.co","craft.co","deccanexim.in","royalfreight.in","bluebaylogistics.in","nomail.in","901gamil.com","tribelands.in","notallowed.in","4mail.com","wellmattresses.in","powerhubsolution.in","moiakventures.in","pixilbook.in","9gml.com","aphiven.in","79mail.com","sarangbiofuels.in","5gmail.comcom","risingstar.co","tmail.com","info@noida.gstin","xxx.com","trol.io","igloo.io","justlikethat.in","knowitbetter.co","kareyourstore.com","milkstore.in","68mail.com","p1gemail.com","mahajanbank.in","bless.in","blanks.com","cantstopthebeat.com","paradise.com","bornwild.com","phone.welcome.com","weatheralert.io"]},7088:(e,l,i)=>{i.d(l,{aW:()=>c,c2:()=>v,Ve:()=>m,r1:()=>g,lA:()=>p,Oy:()=>h});var n=i(8846),t=i(4460);const o=window.location.search;new URLSearchParams(o);const a=/^[ A-Za-z0-9_@./,#&+-/\n]*$/,d=/^[ A-Za-z0-9_@./,#&+-/\n]*$/,r=/[a-zA-Z0-9]/g,s={maxChar:"Address line 1 cannot be longer than 255 characters",minChar:"Address should have atleast 10 characters",specialChar:"Allowed special characters _ @ . / , # & + - ",whiteSpace:"White space is not allowed in starting",newLayout:"Address should have atleast 11 characters",newLayoutSingleSentence:"Enter full address: Flat/House number, Street and Area.",specialCharError:"Use only alphabets (A-Z, a-z) and number (0-9)",onlyZero:"Only 0 is not allowed",verifyAddressApiError:"Address seems short, please complete for better delivery"},u={errorMandatory:"Enter your landmark",space:"Avoid starting with a space",minChar:"Minimum character cannot be less than 1 else it can be blank",maxChar:"Landmark can’t be longer than 49 characters",specialChar:"Allowed special characters _ @ . / , # & + - "},c=(e,l,i)=>{var o,d,u;const c=e.replace(/[^a-zA-Z]/g,""),v=e.match(r),m=i?11:1,g=i?475:255,p=n.Z.getState().Address;let h={errorMessage:"",activeErrorMessage:""};return h.errorMessage=""===e.trim()?t.i.line1:"",""===e.trim()?h.activeErrorMessage="":" "===(null==e?void 0:e[0])?h.activeErrorMessage=null==s?void 0:s.whiteSpace:p.addressFailMsg?h.activeErrorMessage=null==s?void 0:s.verifyAddressApiError:/^[0\s]+$/.test(null==e?void 0:e.trim())?h.errorMessage=null==s?void 0:s.onlyZero:null!==v||i?(null==v?void 0:v.length)g?h.activeErrorMessage=null==s?void 0:s.maxChar:a.test(e.trim())?(null==e||null===(d=e.toString())||void 0===d||null===(u=d.split(" "))||void 0===u?void 0:u.length)<2&&i?h.activeErrorMessage=null==s?void 0:s.newLayoutSingleSentence:"thehatke.com"===l&&e.trim().length<4?h.activeErrorMessage=null==s?void 0:s.minChar:h.activeErrorMessage="":h.activeErrorMessage=null==s?void 0:s.specialChar:h.activeErrorMessage=s.specialCharError,h},v=e=>{let l={errorMessage:"",activeErrorMessage:""};const i=e.replace(/[^a-zA-Z]/g,"");return e.match(r),""===e.replace(/\s/g,"")?l.errorMessage=t.i.line2:" "===(null==e?void 0:e[0])?l.errorMessage=null==s?void 0:s.whiteSpace:(null==i?void 0:i.length)<10?l.errorMessage="Minimum 10 characters required":l.errorMessage="",""===e.trim()?l.activeErrorMessage="":" "===(null==e?void 0:e[0])?l.activeErrorMessage=null==s?void 0:s.whiteSpace:(null==i?void 0:i.length)<10?l.errorMessage="Minimum 10 characters required":i.length>170?l.activeErrorMessage="Address line 2 cannot be longer than 170 characters":d.test(e.trim())?l.activeErrorMessage="":l.activeErrorMessage="Allowed special characters _ @ . / , # & + - ",l},m=(e,l)=>{let i={errorMessage:"",activeErrorMessage:""};return l&&""===e?i.errorMessage=null==u?void 0:u.errorMandatory:" "===(null==e?void 0:e[0])?i.errorMessage=null==s?void 0:s.whiteSpace:i.errorMessage="",""===e?i.activeErrorMessage="":" "===(null==e?void 0:e[0])?i.errorMessage=null==s?void 0:s.whiteSpace:e.length<1?i.activeErrorMessage=null==u?void 0:u.minChar:" "==e[0]?i.activeErrorMessage=null==u?void 0:u.space:e.length>49?i.activeErrorMessage=null==u?void 0:u.maxChar:d.test(e.trim())?i.activeErrorMessage="":i.activeErrorMessage=null==u?void 0:u.specialChar,i},g=(e,l,i,n)=>{const t=e&&l?l:0;return e&&(null==i?void 0:i.length)<20?{isError:!0,errorMessage:"Address characters should be greater than 20"}:e&&t&&(null==i?void 0:i.length)>t?{isError:!0,errorMessage:"Address characters should be less than ".concat(t)}:{isError:!1,errorMessage:""}},p=e=>"400 Line1 or Line2 character limits not as per old address layout."===e?"Line 1 or Line 2 character limits not as per old address layout.":"400 Enter full address: Flat/House number, Street and Area."===e?"Enter full address: Flat/House number, Street and Area.":"",h=(e,l)=>{try{var i;let n;return n=(null==e||null===(i=e.split("\n"))||void 0===i?void 0:i.length)>1&&l?e.split("\n").join(" "):e,n}catch(e){return finalAddress}}},8515:(e,l,i)=>{i.d(l,{a:()=>n});const n=(e,l,i)=>{try{var n,t,o;if(!e)return null;const i=JSON.parse(JSON.parse(decodeURIComponent(window.atob(e)))),a=null==i||null===(n=i.split("Cart/"))||void 0===n?void 0:n[1],d=(null==a||null===(t=a.split("?key="))||void 0===t||t[0],null==a||null===(o=a.split("?key="))||void 0===o||o[1],{token:a,total_price:100*(null==l?void 0:l.totalPrice),items_subtotal_price:100*(null==l?void 0:l.totalPrice)});return window.btoa(JSON.stringify(d))}catch(e){return null}}},9563:(e,l,i)=>{i.d(l,{PO:()=>a,qS:()=>y,xb:()=>u,_7:()=>v,z5:()=>E,un:()=>c,Pm:()=>S,$U:()=>D,qs:()=>r,no:()=>s,z2:()=>w,E$:()=>N,Uw:()=>I,fb:()=>k,G7:()=>T,IW:()=>P,T7:()=>F,pv:()=>R,n1:()=>L,bq:()=>j,ej:()=>O,BA:()=>M,zU:()=>U});var n=i(9094),t=(i(1608),i(1805));const o=i(1318),a=(e,l)=>e&&0!==e.length?e.map((e=>null==e?void 0:e[l])).join("+"):"";function d(e,l){if(e.length!==l.length)return!1;for(let i=0;i{if(e===l)return!0;if(null==e||null==l||"object"!=typeof e||"object"!=typeof l)return e!=e&&l!=l;if(e.constructor!==l.constructor)return!1;if(e instanceof Date)return e.getTime()===l.getTime();if(e instanceof RegExp)return e.toString()===l.toString();if(Array.isArray(e)){if(e.length!==l.length)return!1;for(let i=0;ie?12===(e=e.toString()).length&&e.startsWith("91")||11===e.length&&e.startsWith("0")?"+91".concat(e.slice(-10)):"+91".concat(e):e;function v(e){try{if(!e)return null;function l(e,l){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=e.getDate(),o=e.getMonth(),a=e.getFullYear();switch(l){case"MMM DD YYYY":return"".concat(n[o]," ").concat(t.toString().padStart(2,"0")," ").concat(a);case"MMM DD":return"".concat(n[o]," ").concat(t.toString().padStart(2,"0"));case"dddd":return i[e.getDay()];default:return e.toString()}}function i(i){return l(e,i)}return e=new Date(e),{format:i}}catch(e){return null}}const m=new Date,g=v(m).format("MMM DD YYYY"),p=v(m).format("MMM DD"),h=v(m).format("dddd");function y(e,l){let i=[];return e.forEach((e=>{let n=l.find((l=>l.productId===e.productId));n&&function(e,l){if(Object.keys(e).length!==Object.keys(l).length)return!1;for(let i in e)if(Array.isArray(e[i])&&Array.isArray(l[i])){if(!d(e[i],l[i]))return!1}else if(e[i]!==l[i])return!1;return!0}(e,n)||i.push(e)})),i}console.log(g),console.log(p),console.log(h);function f(e,l,i,n,t,o){return A(function(e,l){return e<>>32-l}(A(A(l,e),A(n,o)),t),i)}function _(e,l,i,n,t,o,a){return f(l&i|~l&n,e,l,t,o,a)}function C(e,l,i,n,t,o,a){return f(l&n|i&~n,e,l,t,o,a)}function x(e,l,i,n,t,o,a){return f(l^i^n,e,l,t,o,a)}function b(e,l,i,n,t,o,a){return f(i^(l|~n),e,l,t,o,a)}function A(e,l){var i=(65535&e)+(65535&l);return(e>>16)+(l>>16)+(i>>16)<<16|65535&i}const E=(e,l)=>{try{var i,t;n.Z.setItem("sc_user_id",l),n.Z.setItem("sc_mid",function(e){for(var l,i="0123456789ABCDEF",n="",t=0;t>>4&15)+i.charAt(15&l);return n}(function(e){for(var l="",i=0;i<32*e.length;i+=8)l+=String.fromCharCode(e[i>>5]>>>i%32&255);return l}(function(e,l){e[l>>5]|=128<>>9<<4)]=l;for(var i=1732584193,n=-271733879,t=-1732584194,o=271733878,a=0;a>2),i=0;i>5]|=(255&e.charCodeAt(i/8))<{try{return void 0!==window.localStorage}catch(e){return!1}},w=e=>{const l=null==e?void 0:e.toLowerCase();return null!=l&&l.includes("android")?"android":null!=l&&l.includes("ios")?"iOS":null!=l&&l.includes("mac")?"macOS":null!=l&&l.includes("windows")?"windows":null!=l&&l.includes("linux")?"linux":"unknown"},N=e=>({check_payment_eligibility_request:{customer:{id:null==e?void 0:e.userProfileId,address:null==e?void 0:e.address},seller_id:null==e?void 0:e.sellerId,cart_id:null==e?void 0:e.cartId,payment_platforms:["Credpay","Simpl","Potlee","SimplPi3","Snapmint","SimplPod"],amount:null==e?void 0:e.amount,currency:"INR",agent:{platform:null!=e&&e.credInstalled?"app":"web",os:w(null==e?void 0:e.deviceOS),device:"mobile"===(null==e?void 0:e.deviceType)?"mobile":"desktop"},cred_app_present:null==e?void 0:e.credInstalled,item_details:null==e?void 0:e.items}}),I=e=>{var l;const i=null==e||null===(l=e.couponData)||void 0===l?void 0:l.custom_attributes;return!!(i&&"object"==typeof i&&Object.keys(i).length>0&&(i.easyreward_coupon_discount_data||i.casa_coupon_discount_data))},k=e=>{const l=t.mJ;return null==l?void 0:l.filter((l=>l.method!==e))},T=()=>{try{var e;const l=JSON.parse(null===n.Z||void 0===n.Z?void 0:n.Z.getItem("srCartSelectedFreebies"));return null!=Array&&Array.isArray(null==l?void 0:l.freebieVariantIds)&&(null==l||null===(e=l.freebieVariantIds)||void 0===e?void 0:e.length)>0?null==l?void 0:l.freebieVariantIds:null}catch(e){return null}},P=e=>{let{festivalDateTime:l,eddDateTime:i}=e;try{const e=Math.round((Number(new Date(l))-Number(new Date(i)))/864e5);return e>0?e:0}catch(e){return 0}},j=(e,l)=>{if(!l||0===(null==l?void 0:l.length))return!0;if(e){for(let e=0;e<(null==l?void 0:l.length);e++){var i,n;if(null===(i=l[e])||void 0===i||null===(n=i.custom_attributes)||void 0===n||!n.allowRewardCombination)return!1}return!0}return!1},F=(e,l)=>{const i=e.toString().slice(-4);return parseInt(i,16)/65535*100{try{var l;const i="; ".concat(document.cookie),n=null==i?void 0:i.split("; ".concat(e,"="));return 2===(null==n?void 0:n.length)?null==n||null===(l=n.pop())||void 0===l?void 0:l.split(";").shift():void 0}catch(e){return}},M=e=>{try{window.parent.postMessage({trigger:"shiprocket-checkout-listener",actions:[{action:"showErrorOnPreloader",data:e}]},"*")}catch(e){}},U=function(e,l,i){var n,t,o;return!((null==e||null===(n=e.discountDetail)||void 0===n||null===(t=n.discount_data)||void 0===t||null===(o=t.filter((e=>"automatic"===(null==e?void 0:e.discount_type))))||void 0===o?void 0:o.length)>0)}},1805:(e,l,i)=>{i.d(l,{ZW:()=>n,Wx:()=>a,Q6:()=>t,VG:()=>d,N9:()=>u,bG:()=>c,$I:()=>s,$$:()=>r,mJ:()=>v,Zd:()=>p,v8:()=>m,VY:()=>o,aC:()=>g});const n={shopify:"SHOPIFY",wooCommerce:"WOOCOMMERCE",magento:"MAGENTO"},t={"50/50":/[a-sA-S]/,"80/20":/[0-6]/,"100/0":[]},o=10,a=["contentId","quantity","Quantity","gift_wrap","varient_id"];let d=["ranbazaar.com","thehouseofrare.com","aramya.in","blackberrys.com","wordpress-dev.pickrr.com","teescult.in","stayclassy.in","printymind.com","arabianaroma.co.in","zyka.in","casemonkey.in","inkarto.com","lovedky.com","thejunket.in","www.faebeauty.in","cristaspices.com","99bookstores.com","estailofashion.com","marscosmetics.in","jewelsmars.com","www.liliorigin.com","verymiss.in","warriorworld.in","innovist.com","kayandquekids.com","includ.com","prao.com","banjaratrail.com","justrealdeal.com","www.wishluck.in","animemart.in","popmelle.com","theaffordableorganicstore.com","iblamebeads.com","www.dchica.in","sadhna.co","kitabay.com","madhuryarakhi.com","suroskie.com","chicnutrix.com","in.fastandup.com","athflex.com","www.duneanddrizzle.com"];const r=["cforcover.com","coconutcases.com"],s=["cforcover.com","coconutcases.com"],u=/^[A-Za-z0-9-\s&().]*$/,c="Allowed special characters -, &, ()",v=[{method:"emi"},{method:"cardless_emi"},{method:"paylater"},{method:"upi"},{method:"netbanking"},{method:"wallet"},{method:"card"}],m=["inkbolt.myshopify.com","harish-30.myshopify.com","innovist.com"],g=["www.anveshan.farm","snooplay.in"],p="shopify_IN_"},2183:(e,l,i)=>{i.d(l,{kf:()=>a,Vw:()=>d,i4:()=>r});var n=i(1881),t=i.n(n),o=i(9218);const a=async e=>{try{const l={etype:null==e?void 0:e.name,et:(new Date).toISOString(),ptype:null!=e&&e.category?null==e?void 0:e.category:"N/A",data:{env:"PROD",payload:JSON.stringify({...(null==e?void 0:e.payload)&&(null==e?void 0:e.payload),site:null==e?void 0:e.domain})}};await t().post(o.Q.COLLECT_EVENT,l)}catch(e){}},d=e=>{try{window.parent.postMessage({trigger:"shiprocket-checkout-listener",actions:[{action:"ucEventHandler",data:{eventName:null==e?void 0:e.eventName,payload:null==e?void 0:e.payload}}]},"*")}catch(e){}},r=e=>{try{window.parent.postMessage({trigger:"shiprocket-checkout-listener",actions:[{action:"ucRegisterCIDHandler",data:e}]},"*")}catch(e){}}},7555:(e,l,i)=>{i.d(l,{ce:()=>u,ky:()=>c,Ck:()=>v,Hi:()=>r,Oq:()=>a,S5:()=>d,x:()=>s});var n,t=i(9094),o=i(9563);let a,d,r=!!(0,o.$U)()&&(null!==(n=null===t.Z||void 0===t.Z?void 0:t.Z.getItem("logout_temp"))&&void 0!==n?n:localStorage.getItem("logout_temp")),s=null;const u=e=>{var l,i,n;a=null===(l=e.initateCheckoutData)||void 0===l?void 0:l.headers["pim-sid"],d=null===(i=e.initateCheckoutData)||void 0===i?void 0:i.headers["expires-at"],(0,o.$U)()&&(null===(n=localStorage)||void 0===n||n.removeItem("logout_temp"))},c=e=>{var l;(0,o.$U)()&&(null===(l=localStorage)||void 0===l||l.removeItem("logout_temp"),null===t.Z||void 0===t.Z||t.Z.removeItem("logout_temp")),e&&((0,o.$U)()&&(null===t.Z||void 0===t.Z||t.Z.removeItem("logout_temp")),a=null,d=null,r=null,s=!0)},v=()=>{r=!0}},7023:(e,l,i)=>{i.d(l,{X:()=>n});const n=(e,l)=>{"SHOPIFY"===(null==e?void 0:e.toUpperCase())&&null!=l&&l.includes("authenticate")?setTimeout((()=>{try{window.parent.postMessage({trigger:"headless-redirect-post",data:l},"*")}catch(e){console.log()}}),4e3):setTimeout((()=>{window.parent.postMessage({trigger:"headless-redirect",actions:[{action:"redirectTo",data:{url:l}}]},"*")}),4e3)}},5896:()=>{},3052:()=>{},976:(e,l,i)=>{i.d(l,{Z:()=>n});const n={row:"address_row__ccTYX",addressContainerCard:"address_addressContainerCard__1uISq",selected:"address_selected__1HHtA",newAddress:"address_newAddress__3o76H","text-primary":"address_text-primary__v9c-t",extraDiv:"address_extraDiv__nmYZ4",nameHeading:"address_nameHeading__PltBj",addressDetail:"address_addressDetail__XBbhH",dropdownMenu:"address_dropdownMenu__qbsyv",dropdownMenuActive:"address_dropdownMenuActive__+fGaq",dropdownOption:"address_dropdownOption__x96Gu",paymentButton:"address_paymentButton__w6CdP",tags_pill:"address_tags_pill__7A8mo",paymentButtonBanner:"address_paymentButtonBanner__gm8pi"}}},d={};function r(e){var l=d[e];if(void 0!==l)return l.exports;var i=d[e]={id:e,loaded:!1,exports:{}};return a[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.m=a,r.amdO={},e=[],r.O=(l,i,n,t)=>{if(!i){var o=1/0;for(u=0;u=t)&&Object.keys(r.O).every((e=>r.O[e](i[d])))?i.splice(d--,1):(a=!1,t0&&e[u-1][2]>t;u--)e[u]=e[u-1];e[u]=[i,n,t]},r.F={},r.E=e=>{Object.keys(r.F).map((l=>{r.F[l](e)}))},r.n=e=>{var l=e&&e.__esModule?()=>e.default:()=>e;return r.d(l,{a:l}),l},r.d=(e,l)=>{for(var i in l)r.o(l,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:l[i]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((l,i)=>(r.f[i](e,l),l)),[])),r.u=e=>"static/js/"+({61:"customLogin",91:"codToPrepaid",428:"LoadingScreen",478:"paymentContainer",589:"ShiprocketLogin",945:"upSell"}[e]||e)+"."+{61:"8ce66039",91:"42d8b277",367:"399ea06a",428:"8ba3395e",478:"caa836f5",517:"456b9e57",526:"758653bb",568:"1d107c02",589:"627fb45f",945:"24499d92"}[e]+".chunk.js",r.miniCssF=e=>"static/css/"+({61:"customLogin",91:"codToPrepaid",428:"LoadingScreen",478:"paymentContainer",589:"ShiprocketLogin",945:"upSell"}[e]||e)+"."+{61:"798bb51f",91:"e9380df6",428:"cc2483db",478:"26402bb3",526:"597f01fd",589:"6a3c1f9b",945:"9080df12"}[e]+".chunk.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),l={},i="sr-checkout:",r.l=(e,n,t,o)=>{if(l[e])l[e].push(n);else{var a,d;if(void 0!==t)for(var s=document.getElementsByTagName("script"),u=0;u{a.onerror=a.onload=null,clearTimeout(m);var t=l[e];if(delete l[e],a.parentNode&&a.parentNode.removeChild(a),t&&t.forEach((e=>e(n))),i)return i(n)},m=setTimeout(v.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=v.bind(null,a.onerror),a.onload=v.bind(null,a.onload),d&&document.head.appendChild(a)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",n=e=>new Promise(((l,i)=>{var n=r.miniCssF(e),t=r.p+n;if(((e,l)=>{for(var i=document.getElementsByTagName("link"),n=0;n{var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.onerror=t.onload=o=>{if(t.onerror=t.onload=null,"load"===o.type)i();else{var a=o&&("load"===o.type?"missing":o.type),d=o&&o.target&&o.target.href||l,r=new Error("Loading CSS chunk "+e+" failed.\n("+d+")");r.code="CSS_CHUNK_LOAD_FAILED",r.type=a,r.request=d,t.parentNode.removeChild(t),n(r)}},t.href=l,document.head.appendChild(t)})(e,t,l,i)})),t={179:0},r.f.miniCss=(e,l)=>{t[e]?l.push(t[e]):0!==t[e]&&{61:1,91:1,428:1,478:1,526:1,589:1,945:1}[e]&&l.push(t[e]=n(e).then((()=>{t[e]=0}),(l=>{throw delete t[e],l})))},(()=>{var e={179:0};r.f.j=(l,i)=>{var n=r.o(e,l)?e[l]:void 0;if(0!==n)if(n)i.push(n[2]);else if(/^(478|589|61)$/.test(l))e[l]=0;else{var t=new Promise(((i,t)=>n=e[l]=[i,t]));i.push(n[2]=t);var o=r.p+r.u(l),a=new Error;r.l(o,(i=>{if(r.o(e,l)&&(0!==(n=e[l])&&(e[l]=void 0),n)){var t=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;a.message="Loading chunk "+l+" failed.\n("+t+": "+o+")",a.name="ChunkLoadError",a.type=t,a.request=o,n[1](a)}}),"chunk-"+l,l)}},r.F.j=l=>{if(!(r.o(e,l)&&void 0!==e[l]||/^(478|589|61)$/.test(l))){e[l]=null;var i=document.createElement("link");r.nc&&i.setAttribute("nonce",r.nc),i.rel="prefetch",i.as="script",i.href=r.p+r.u(l),document.head.appendChild(i)}},r.O.j=l=>0===e[l];var l=(l,i)=>{var n,t,o=i[0],a=i[1],d=i[2],s=0;if(o.some((l=>0!==e[l]))){for(n in a)r.o(a,n)&&(r.m[n]=a[n]);if(d)var u=d(r)}for(l&&l(i);sPromise.all(l).then((()=>{var l=o[e];Array.isArray(l)&&l.map(r.E)})),r.O(0,[179],(()=>{[422,526,428,367,478].map(r.E)}),5);var s=r.O(void 0,[422],(()=>r(972)));s=r.O(s)})();