PageSourceSearch

https://www.bnesim.com/component---src-pages-sim-cards-plans-[location]-checkout-tsx-4f7df70a882e22580d67.js

js bnesim.com collected 2026-10-01 11:44:36 UTC 30,367 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkbnesim_esim=self.webpackChunkbnesim_esim||[]).push([[9398],{35922:function(e,t,a){a.d(t,{B:function(){return n},d:function(){return r}});const n=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),r=e=>{const t=e.trim();return""===t?"invalid":n(t)?"email":/^\d+$/.test(t)?9===t.length?"account":"invalid_length":"invalid"}},60438:function(e,t,a){a.r(t);var n=a(96540),r=a(40638),s=a(98027),o=a(39197),l=a(72169),i=a(16512),c=a(61409),d=a(5227),u=a(24755),m=a(6214),p=a(97574),y=a(78349),f=a(65421),g=a(24319),x=a(69018),v=a(49602),h=a(26434),E=a(25593),w=a(99364),b=a(38643),_=a(49418),N=a(17462),C=a(87037),S=a(63600),I=a(68158),A=a(46084),k=a(49577),P=a(6428),F=a(22217),R=a(11042),O=a(35812),T=a(60170),M=a(22154),U=a(37317),j=a(72987),z=a(83325),L=a(54817),D=a(58605),B=a(56611),H=a(69903),G=a(62172),q=a(23594),J=a(53686),V=a(88419),$=a(29145),W=a(55206),X=a(92710),K=a(25164),Y=a(7083);t.default=()=>{var e,t,a,Z,Q;(0,U.D)("sim-cards-checkout");const{t:ee,navigate:te,language:ae}=(0,u.useI18next)(),ne=(0,H.V)(),re=(0,B.l)(),se=(0,D.Z)(),oe=(0,L.v)();(0,n.useEffect)(()=>{z.BI.includes(ne.gateway)||ne.setGateway(z.jH)},[]),(0,n.useEffect)(()=>{if(re.currency!==z.R3)return;const e=(0,z.$c)(re.currencies);void 0!==e&&re.updateCurrency(e)},[re.currency,re.currencies.length]);const{0:le,1:ie}=(0,n.useState)("");(0,n.useEffect)(()=>{if("undefined"!=typeof window){var e;const t=null===(e=window.location.pathname.split("/sim-cards/plans/")[1])||void 0===e?void 0:e.split("/")[0];ie(null!=t?t:"")}},[]);const{data:ce}=(0,j.$)(),de=(0,n.useMemo)(()=>ne.tempProduct?ne.tempProduct:ce?ce.products.find(e=>e.id===ne.productId):void 0,[ne.tempProduct,ce]),ue=!(!le||!ce)&&(0,X.dL)(ce,ee,ae,le,ne.tempProduct||null==de?void 0:de.id);if(le&&!ue)return void("undefined"!=typeof window&&te("/sim-cards"));const me=ue?ue.locationText:"",pe=ue?ue.imgSrc:"",ye=!!ue&&ue.isRegional,fe=ue?ue.coverageList:[],ge=ue?ue.title:"",xe=ue?ue.description:"";(0,n.useEffect)(()=>{if("undefined"!=typeof window){const e=new URLSearchParams(window.location.search);window.opener&&(window.opener.postMessage({status:e.get("status")},window.location.origin),window.close())}se.isAuthenticated()&&ne.isCheckout&&de||"undefined"!=typeof window&&!wt&&le&&te(ne.productId?"/sim-cards/plans/"+le+"/?product="+ne.productId:"/sim-cards/plans/"+le+"/")},[ne.isCheckout,se.isAuthenticated(),de,le]);const ve=async()=>{if(!de)return;let e=null;Me&&(e=Me,Ne(!0),await et(!1)),await(0,V.f)(de,re.currency,"sim").then(async t=>{if(null==t||!t.paymentIntentId)return c.oR.error(ee("unexpected_error_occurred"),{autoClose:5e3}),void te(ne.productId?"/sim-cards/plans/"+le+"?product="+ne.productId:"/sim-cards/plans/"+le);e&&(await Qe(e,null==t?void 0:t.paymentIntentId),Ne(!1))})};(0,n.useEffect)(()=>{const e=setTimeout(async()=>{await(async()=>{if(se.isAuthenticated()&&de){var e,t;Ne(!0);const a=(0,q.uS)(re.currency,de.price)+(0,q.uS)(re.currency,null!==(e=null==ce?void 0:ce.shipment_price)&&void 0!==e?e:0)+(0,q.uS)(re.currency,null!==(t=null==ce?void 0:ce.data_sim_price)&&void 0!==t?t:0);Ie(a.toFixed(2)),Pe(a),await ve(),Ne(!1)}})()},500);return()=>{clearTimeout(e)}},[de,re.currency,se.getToken(),ne.gateway]);const{0:he,1:Ee}=(0,n.useState)([]),{0:we,1:be}=(0,n.useState)(!1);(0,n.useEffect)(()=>{var e;Ee((0,W.X4)(null!==(e=null==de?void 0:de.coverages)&&void 0!==e?e:[]))},[null==de?void 0:de.coverages]);const{0:_e,1:Ne}=(0,n.useState)(!0),Ce=(0,q.uS)(re.currency,0),{0:Se,1:Ie}=(0,n.useState)(0),{0:Ae,1:ke}=(0,n.useState)(0),Pe=e=>{ke((parseFloat(e.toString())+parseFloat(e.toString())*z.zb[ne.gateway]).toFixed(2))},{0:Fe,1:Re}=(0,n.useState)(!1),{0:Oe,1:Te}
1=(0,n.useState)(!1),{0:Me,1:Ue}=(0,n.useState)(null),{0:je,1:ze}=(0,n.useState)(0),{0:Le,1:De}=(0,n.useState)(0),{0:Be,1:He}=(0,n.useState)(""),{0:Ge,1:qe}=(0,n.useState)(null),{0:Je,1:Ve}=(0,n.useState)(!1),{0:$e,1:We}=(0,n.useState)(!1),Xe=(0,n.useRef)(null),Ke=ee("failed_to_apply_coupon"),Ye=()=>{ne.paymentIntentId&&!$e&&(Me?et():Ze())};(0,n.useEffect)(()=>{re.couponCode&&ne.paymentIntentId&&!Me&&(He(re.couponCode),Ze(re.couponCode))},[ne.paymentIntentId,re.couponCode]);const Ze=async e=>{if(!e&&!Be||!ne.paymentIntentId)return;const t=null!=e?e:Be;Xe.current=c.oR.loading(ee("applying_coupon")),We(!0);const a=oe.paymentMethods.coupons.find(e=>e.code.toUpperCase()===t.toUpperCase());if(a)return void Qe(a);const n=se.isAuthenticated()?"/payment_methods/":"/country_rates_ext/",r=new FormData;r.append("action","add-coupon"),r.append("coupon_code",t.toUpperCase()),r.append("piid",ne.paymentIntentId),r.append("publishable_key",(0,V.Hb)()),await G.A.post(n,r).then(e=>{if((0,V.Bb)()&&console.log("JSON response:",e.data),"done"===e.data.message_status){const a=e.data.coupons.find(e=>e.code.toUpperCase()===t.toUpperCase());a?Qe(a):(Xe.current&&c.oR.update(Xe.current,{render:e.data.message,type:"warning",isLoading:!1,autoClose:5e3}),Xe.current=null,e.data.transaction_id&&ne.setPaymentIntentId(e.data.transaction_id),e.data.client_secret&&ne.setClientSecret(e.data.client_secret),We(!1))}else Xe.current&&c.oR.update(Xe.current,{render:e.data.message,type:"warning",isLoading:!1,autoClose:5e3}),Xe.current=null,We(!1),t.toUpperCase()===re.couponCode.toUpperCase()&&re.resetCouponCode()}).catch(e=>{e.response?console.error("Response status: "+e.response.status):console.error(e.message),Xe.current&&c.oR.update(Xe.current,{render:e.message||Ke,type:"warning",isLoading:!1,autoClose:5e3}),Xe.current=null,We(!1),t.toUpperCase()===re.couponCode.toUpperCase()&&re.resetCouponCode()})},Qe=async(e,t)=>{if(!e)return;const a=se.isAuthenticated()?"/payment_methods/":"/country_rates_ext/",n=null!=t?t:ne.paymentIntentId,r=new FormData;r.append("action","apply-coupon"),r.append("coupon_id",e.id.toString()),r.append("coupon_code",e.code),r.append("piid",n),r.append("publishable_key",(0,V.Hb)()),await G.A.post(a,r).then(t=>{if((0,V.Bb)()&&console.log("JSON response:",t.data),"done"===t.data.message_status){if(Ue(e),ne.setAppliedCouponCode(e.code),He(e.code),Xe.current&&(c.oR.update(Xe.current,{render:t.data.message,type:"success",isLoading:!1,autoClose:5e3}),setTimeout(()=>{c.oR.dismiss()},6e3)),De((0,q.uS)(re.currency,parseFloat(t.data.cashback_value)||0)),t.data.coupon_detail){let e=t.data.coupon_detail.find(e=>e.language==ae);e||(e=t.data.coupon_detail[0]),qe(e)}else qe(null);ze(t.data.coupon_applied_converted_discount),Ie(t.data.new_converted_price),Pe(t.data.new_converted_price),Xe.current=null,We(!1)}else Xe.current&&(c.oR.update(Xe.current,{render:t.data.message,type:"warning",isLoading:!1,autoClose:5e3}),setTimeout(()=>{c.oR.dismiss()},6e3)),Xe.current=null,We(!1),e.code.toUpperCase()===re.couponCode.toUpperCase()&&re.resetCouponCode()}).catch(t=>{t.response?console.error("Response status: "+t.response.status):console.error(t.message),Xe.current&&(c.oR.update(Xe.current,{render:t.message||Ke,type:"warning",isLoading:!1,autoClose:5e3}),setTimeout(()=>{c.oR.dismiss()},6e3)),Xe.current=null,We(!1),e.code.toUpperCase()===re.couponCode.toUpperCase()&&re.resetCouponCode()})},et=async function(e){if(void 0===e&&(e=!0),!Me||!ne.paymentIntentId)return;e&&(Xe.current=c.oR.loading(ee("canceling_coupon"))),We(!0);const t=se.isAuthenticated()?"/payment_methods/":"/country_rates_ext/",a=new FormData;a.append("action","cancel-coupon"),a.append("piid",ne.paymentIntentId),a.append("publishable_key",(0,V.Hb)()),await G.A.post(t,a).then(t=>{if((0,V.Bb)()&&console.log("JSON response:",t.data),"done"===t.data.message_status){var a,n,r;Ue(null),ne.setAppliedCouponCode(""),De(0),qe(null),He(""),e&&Xe.current&&c.oR.update(Xe.current,{render:t.data.message,type:"success",isLoading:!1,autoClose:5e3});const s=(0,q.uS)(re.currency,null!==(a=null==de?void 0:de.price)&&void 0!==a?a:0)+(0,q.uS)(re.currency,null!==(n=null==ce?void 0:ce.shipment_price)&&void 0!==n?n:0)+(0,q.uS)(re.currency,null!==(r=null==ce?void 0:ce.data_sim_price)&&void 0!==r?r:0);Ie(s.toFixed(2)),Pe(s),Xe.current=null,We(!1)}else e&&Xe.current&&c.oR.update(Xe.current,{render:t.data.message,type:"warning",isLoading:!1,autoClose:5e3}),Xe.current=null,We(!1)}).catch(t=>{t.response?console.error("Response status: "+t.response.status):console.error(t.message),e&&Xe.current&&c.oR.update(Xe.current,{render:t.message||Ke,type:"warning",isLoading:!1}),Xe.current=null,We(!1)})},{0:tt,1:at}
1=(0,n.useState)(!1),{0:nt,1:rt}=(0,n.useState)(""),st=oe.addresses,{0:ot,1:lt}=(0,n.useState)(null),{0:it,1:ct}=(0,n.useState)(!1),{0:dt,1:ut}=(0,n.useState)(!1),{0:mt,1:pt}=(0,n.useState)(!1),yt=(0,n.useMemo)(()=>{var e;return ot&&null!==(e=st.find(e=>e.id===ot))&&void 0!==e?e:null},[ot,st]);(0,n.useEffect)(()=>{if(st.length>0){ct(!1);const e=st.find(e=>"1"===e.default_address&&"shipping"===e.type);e&&lt(e.id)}},[st]);const ft=e=>{var t;lt(null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null)},{0:gt,1:xt}=(0,n.useState)(!1),{0:vt,1:ht}=(0,n.useState)(null),Et=e=>{(null==yt?void 0:yt.id)===e.id&&ft(null)};(0,n.useEffect)(()=>{(()=>{if("undefined"!=typeof window&&window.gtag)try{var e,t;window.gtag("event","begin_checkout",{value:parseFloat(Se.toString()),currency:re.currency,coupon:Me?Me.code:"",items:[{item_id:null==de?void 0:de.id,item_name:null==de?void 0:de.name,price:parseFloat((0,q.uS)(re.currency,null!==(e=null==de?void 0:de.price)&&void 0!==e?e:0).toFixed(2)),discount:parseFloat(Se.toString())-parseFloat((0,q.uS)(re.currency,null!==(t=null==de?void 0:de.price)&&void 0!==t?t:0).toFixed(2)),quantity:1}]}),(0,$.gq)({value:parseFloat(Se.toString()),currency:re.currency,contentIds:[null==de?void 0:de.id],contentName:null==de?void 0:de.name})}catch(a){(0,J.N)(a,T.A.GA_EXCEPTION)}})()},[]);const{0:wt,1:bt}=(0,n.useState)(!1),_t=()=>[M.A.STRIPE].includes(ne.gateway),{0:Nt,1:Ct}=(0,n.useState)(!1);(0,n.useEffect)(()=>{ne.setIsSmartTopUpChecked(_t()&&!(null!=de&&de.unlimited))},[de]);const St=(0,n.useRef)(null),{0:It,1:At}=(0,n.useState)(!1),{0:kt,1:Pt}=(0,n.useState)(!1),Ft=()=>he.length>0&&!we||kt||parseFloat(Se.toString())<Ce&&!!Me||$e||ne.gateway===M.A.STRIPE&&!ne.clientSecret||!It&&0!==Se,Rt=async(e,t)=>{var a;if(!se.isAuthenticated()||!de)return;if(Ft())return;Pt(!0);const n=se.isAuthenticated()?"/payment_methods/":"/country_rates_ext/",r=new FormData;r.append("action","sim"),r.append("product",de.id),r.append("currency",re.currency),r.append("piid",ne.paymentIntentId),r.append("bundle_name",null!==(a="landing-page-new")?a:""),r.append("publishable_key",(0,V.Hb)()),yt&&r.append("address",yt.id),r.append("request_smart_top_up",ne.isSmartTopUpChecked?"1":"0"),r.append("shipment","regular"),t&&Object.keys(t).forEach(e=>{r.append(e,t[e])});let s=0;const o=async(t,a)=>{s++,await G.A.post(t,a).then(n=>{var r,l;switch(null===(r=n.data)||void 0===r||null===(l=r.transaction)||void 0===l?void 0:l.status){case"3D_SECURE":e&&e(()=>{s<=10?o(t,a):Tt({message:ee("payment_failed_error_message")})});break;case"PAID":case"PAID_WITH_WALLET":Ot(n);break;default:Tt({message:ee("payment_failed_error_message")})}(0,V.Bb)()&&console.log("JSON response:",n.data)}).catch(e=>{Tt(e)})};o(n,r)},Ot=e=>{var t,a;let n=ne.paymentIntentId;var r,s;null!==(t=e.data)&&void 0!==t&&null!==(a=t.transaction)&&void 0!==a&&a.external_id&&(n=null===(r=e.data)||void 0===r||null===(s=r.transaction)||void 0===s?void 0:s.external_id,ne.setPaymentIntentId(n));ne.setTotal(parseFloat(Se.toString())),ne.setCurrency(re.currency),Pt(!1),c.oR.success(ee("payment_successful"),{autoClose:5e3}),setTimeout(()=>{ne.setIsOrdered(!0),te("/sim-cards/plans/"+le+"/thank-you")},0)},Tt=e=>{Pt(!1),c.oR.error(ee("payment_failed_error_message"),{autoClose:5e3}),e.response?console.error("Response status: "+e.response.status):console.error(e.message)},{0:Mt,1:Ut}=(0,n.useState)(!1),jt=async()=>{yt?(Pt(!0),0===Se?(0,V.VD)().then(()=>{Rt()}).catch(e=>{Tt(e)}):St.current&&(Pt(!1),Ut(!0))):pt(!0)};(0,n.useEffect)(()=>{!kt&&Mt&&St.current&&(St.current.onConfirmPayment(),Ut(!1))},[kt,Mt]);const zt=()=>n.createElement(n.Fragment,null,n.createElement("p",{className:"px-3"},n.createElement(u.Trans,{i18nKey:"by_completing_this_order_accept_term_policy",components:{"term-link":n.createElement(d.r,{href:"https://www.bnesim.com/terms-and-conditions",target:"_blank",rel:"noreferrer",className:"custom-link-primary"}),"refund-policy-link":n.createElement(d.r,{href:"https://www.bnesim.com/terms-and-conditions",target:"_blank",rel:"noreferrer",className:"custom-link-primary"}),"privacy-policy-link":n.createElement(d.r,{href:"https://www.bnesim.com/privacy-policy-and-cookie-policy",target:"_blank",rel:"noreferrer",className:"custom-link-primary"})}})),n.createElement("div",{className:"w-full"},he.length>0&&((e,t)=>{if(1===he.length)return n.createElement(I.A,{value:we,handleCheck:()=>{be(!we)},title:null!==(e=ee(W.Cn[he[0]]))&&void 0!==e?e:""});{let e=null!==(t=ee(W.Cn[he[0]]))&&void 0!==t?t:"";const r=(0,V.Dx)();var a;return r&&he.includes(r.toUpperCase())&&(e=null!==(a=ee(W.Cn[r.toUpperCase()]))&&void 0!==a?a:""),n.createElement(I.A,{value:we,handleCheck:()=>{be(!we)},title:e})}})()));return n.createElement(n.Fragment,null,n.createElement(R.A,{title:ee("checkout")+" | "+ge,description:xe,lang:ae}),n.createElement("div",{className:"container relative"},n.createElement(K.N,null,n.createElement(n.Fragment,null,n.createElement(Y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},n.createElement("div",{className:"relative mb-5 flex h-fit flex-col gap-2"},n.createElement("div",{className:"flex w-full flex-row items-center justify-between gap-2"},n.createElement("button",{onClick:async()=>{Me&&await et(!1),ne.setIsCheckout(!1),bt(!0),te(ne.productId?"/sim-cards/plans/"+le+"/?product="+ne.productId:"/sim-cards/plans/"+le+"/")},ref:V.HG,className:"custom-link-primary focus:custom-primary-focus-shadow flex flex-row items-center gap-2 text-nowrap rounded-full border border-transparent px-4 py-2 text-[#333] hover:bg-primary/20 hover:text-primary"},n.createElement(i.m6W,{className:"rtl:-scale-x-100"}),n.createElement("span",{className:"text-sm"},ee("back"))),n.createElement("button",{onClick:()=>{Te(!0)},ref:V.HG,className:"custom-link-primary focus:custom-primary-focus-shadow flex flex-row items-center gap-2 text-nowrap rounded-full border border-transparent px-4 py-2 text-[#333] hover:bg-primary/20 hover:text-primary"},n.createElement(C.A,{className:"size-4"}),n.createElement("span",{className:"text-sm underline"},re.currency))),n.createElement("h1",{className:"w-full text-center text-xl md:text-2xl"},ee("checkout"))),n.createElement("div",{className:"mb-5 flex flex-wrap items-center justify-center gap-2 border-b-2 border-solid border-gray-200 pb-5 pt-3 md:gap-3"},ye?n.createElement(F.A,{region:me,imgSrc:pe,coverageList:fe.filter(e=>(e=>!(0,W.Y6)().includes(re.countryCodeFromApi.toUpperCase())||re.countryCodeFromApi.toUpperCase()!==e.coverage.toUpperCase())(e))}):n.createElement(n.Fragment,null,n.createElement("span",null,ee("coverage")+":"),n.createElement("div",{className:"relative size-8 overflow-hidden rounded-full border border-solid"},n.createElement("img",{src:pe,alt:me,width:"32",height:"32",className:"absolute top-0 block h-full w-auto object-cover"})),n.createElement("span",null,me))),n.createElement("div",{className:(0,V.cn)({"flex flex-col gap-4 roun
1ded-3xl bg-primary/20 p-4":null==de?void 0:de.unlimited})},(null==de?void 0:de.unlimited)&&n.createElement("div",{className:"flex flex-row items-center justify-between gap-4"},n.createElement("h2",{className:"ps-3 uppercase"},ee("unlimited_gb")),n.createElement("button",{ref:V.AR,className:"focus:custom-primary-focus-ring ms-auto rounded-full !border-0 opacity-80 outline-none transition duration-300 hover:text-primary/80",onClick:()=>{Re(!0)}},n.createElement(s.__w,null))),n.createElement("div",{className:"grid w-full grid-cols-3 items-center gap-1 rounded-2xl bg-white p-4 shadow-sm shadow-gray-300"},n.createElement("div",{className:"flex flex-col items-center justify-center"},n.createElement("span",{className:"inline-flex items-center justify-center gap-2 font-semibold uppercase"},de&&n.createElement(n.Fragment,null,de.unlimited?ee("unlimited_gb"):de.amount+" "+de.unit)),n.createElement("span",{className:"text-sm text-gray-500"},ee("size"))),n.createElement("div",{className:"relative flex flex-col items-center justify-center before:absolute before:left-0 before:h-2/3 before:w-[2px] before:rounded before:bg-gray-200 after:absolute after:right-0 after:h-2/3 after:w-[2px] after:rounded after:bg-gray-200"},n.createElement("span",{className:"font-semibold"},de?(0,V.E9)(ee,de):""),n.createElement("span",{className:"text-sm text-gray-500"},ee("duration"))),n.createElement("div",{className:"flex flex-col items-center justify-center"},n.createElement("span",{className:"font-semibold text-primary"},(0,q.uS)(re.currency,null!==(e=null==de?void 0:de.price)&&void 0!==e?e:0).toFixed(2)," ",re.currency),n.createElement("span",{className:"text-sm text-gray-500"},ee("price"))))),n.createElement("h2",{className:"mt-5 ps-3"},ee("price")),n.createElement("div",{className:(0,V.cn)("relative z-[1] mt-4 grid rounded-2xl bg-white px-5 shadow-sm shadow-gray-300",{"mb-8":!Ge})},n.createElement("div",{className:"grid grid-cols-2 items-center gap-4 border-b-2 border-solid border-gray-200 py-4"},n.createElement("span",{className:"me-auto flex h-8 w-full items-center gap-3 text-start"},n.createElement(S.A,{className:"me-3 block size-8 text-primary"}),ee("shipping")),n.createElement("span",{className:"text-end"},(0,q.uS)(re.currency,null!==(t=null==ce?void 0:ce.shipment_price)&&void 0!==t?t:0).toFixed(2)," ",re.currency)),n.createElement("div",{className:"grid grid-cols-2 items-center gap-4 border-b-2 border-solid border-gray-200 py-4"},n.createElement("span",{className:"me-auto flex h-8 w-full items-center gap-3 text-start"},n.createElement(h.A,{className:"me-3 block size-8 text-primary"}),ee("activation")),n.createElement("span",{className:"text-end"},(0,q.uS)(re.currency,null!==(a=null==ce?void 0:ce.data_sim_price)&&void 0!==a?a:0).toFixed(2)," ",re.currency)),n.createElement("div",{className:"grid grid-cols-2 items-center gap-4 border-b-2 border-solid border-gray-200 py-4"},n.createElement("span",{className:"me-auto flex h-8 w-full items-center gap-3 text-start"},n.createElement(E.A,{className:"me-3 block size-8 text-primary"}),ee("plan")),n.createElement("span",{className:"text-end"},(0,q.uS)(re.currency,null!==(Z=null==de?void 0:de.price)&&void 0!==Z?Z:0).toFixed(2)," ",re.currency)),Me&&je>0&&n.createElement(Y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"grid grid-cols-2 items-center gap-4 border-b-2 border-solid border-primary-400 py-4"},n.createElement("div",{className:"me-auto flex h-8 w-full items-center gap-3 text-start"},n.createElement(N.A,{className:"me-3 size-8 text-primary"}),n.createElement("div",{className:"flex flex-row items-center gap-2"},n.createElement("span",null,ee("saved")),n.createElement("div",{className:"flex items-center justify-center rounded-full bg-gray-100 px-2 py-1 text-sm"},null==Me?void 0:Me.code))),n.createElement("span",{className:"text-end text-primary-400"},"-"+je+" "+re.currency)),n.createElement("div",{className:(0,V.cn)("grid min-h-8 grid-cols-2 items-center gap-4",{"pt-4":parseFloat(Se.toString())<Ce&&!!Me,"py-4":!(parseFloat(Se.toString())<Ce&&Me)})},n.createElement("span",{className:"me-auto flex gap-3 text-start"},ee("total")),n.createElement("span",{className:"text-end font-semibold text-primary-400"},parseFloat(Se.toString()).toFixed(2)," ",re.currency)),parseFloat(Se.toString())<Ce&&!!Me&&n.createElement(Y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"w-full pb-4"},n.createElement("span",{className:"me-auto flex text-start text-sm text-red-400"},ee("minimum_payment_required",{amount:Ce,unit:re.currency})))),n.createElement(K.N,null,Ge&&n.createElement(Y.P.div,{initial:{opacity:0,marginBottom:0},animate:{opacity:1,marginBottom:"2rem"},exit:{opacity:0,marginBottom:0},transition:{duration:.3},className:"relative -mt-6 flex rounded-b-2xl border-green-200 bg-green-100 px-5 pt-6 shadow-sm shadow-gray-300"},n.createElement("div",{className:"flex w-full flex-row items-start justify-between gap-4 py-4"},n.createElement("div",{className:"me-auto flex w-full flex-col items-start gap-1"},n.createElement("div",{className:"flex flex-row items-center gap-2"},n.createElement("span",{className:"font-semibold"},Ge.title),n.createElement("div",{className:"flex items-center justify-center rounded-full bg-white px-2 py-1 text-sm"},null==Me?void 0:Me.code)),Ge.description&&n.createElement(Y.P.span,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},Ge.description),Ge.inner_content&&n.createElement(Y.P.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onClick:()=>{Ve(!0)},className:"cursor-pointer text-green-600 underline transition duration-300 hover:no-underline focus:no-underline focus:outline-none"},ee("how_it_works_arrow"))),!!Ge.extra_reward_amount&&n.createElement(Y.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"flex flex-row items-center gap-1 text-green-600"},n.createElement("span",{className:"font-semibold"},Ge.extra_reward_amount),n.createElement("span",{className:"font-semibold"},Ge.extra_reward_unit))))),n.createElement("h2",{className:"mt-5 ps-3"},ee("where_should_we_send_your_order")),n.createElement("div",{className:"relative mb-8 mt-4 flex flex-col gap-4"},n.createElement("div",{className:"relative rounded-2xl bg-white shadow-sm shadow-gray-300"},n.createElement(K.N,null,it?n.createElement(Y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"flex min-h-[66px] w-full items-center justify-center"},n.createElement(r.AhV,{className:"size-6 animate-spin text-primary"})):yt?n.createElement(Y.P.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:V.HG,onClick:()=>{ut(!0)},className:"focus:custom-primary-focus-ring group flex min-h-[66px] w-full cursor-pointer flex-row items-center justify-between rounded-2xl border border-transparent px-5 py-4 transition duration-300"},n.createElement("div",{className:"flex flex-row items-center gap-3"},yt.countryflag&&n.createElement("img",{src:"https://flagcdn.com/48x36/"+yt.countryflag.toLowerCase()+".png",alt:yt.country_name,className:"size-6 rounded-sm object-cover"}),n.createElement("div",{className:"flex flex-col gap-0.5 text-start"},n.createElement("span",{className:"text-sm font-semibold transition duration-300 group-hover:text-primary"},yt.first_name," ",yt.last_name),n.createElement("span",{className:"text-xs text-gray-500"},yt.full_address),yt.label&&n.createElement("span",{className:"text-xs text-gray-400"},yt.label))),n.createElement(s.X6T,{className:"size-5 opacity-60 transition duration-300 group-hover:text-primary rtl:-scale-x-100"})):n.createElement(Y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"flex h-[66px] w-full flex-row items-center justify-between px-5 py-4"},n.createElement("span",{className:"text-sm text-gray-500"},ee("no_address_added_yet")),n.createElement("button",{ref:V.AR,onClick:()=>{pt(!0)},className:"custom-btn-primary !px-4 !py-1.5 text-sm font-semibold"},ee("add_new_address")))))),_t()&&!(null!=de&&de.unlimited)&&n.createElement(n.Fragment,null,n.createElement("div",{className:"flex flex-row items-center justify-start gap-2 ps-3 md:gap-4"},n.createElement("h2",null,ee("smart_top_up")),n.createElement("button",{onClick:()=>{Ct(!0)},className:"focus:custom-primary-focus-ring rounded-full !border-0 opacity-80 outline-none transition duration-300 hover:text-primary/80"},n.createElement(s.__w,null))),n.createElement("div",{className:"mb-8 mt-4 flex flex-row items-center justify-between gap-4 rounded-2xl bg-white px-5 py-4 shadow-sm shadow-gray-300 md:gap-4"},n.createElement("div",{className:"text-justify text-sm"},ee("smart_top_up_desc",{amount:null==de?void 0:de.threshold,unit:null==de?void 0:de.threshold_unit})),n.createElement(I.A,{value:ne.isSmartTopUpChecked,handleCheck:()=>{const e=!ne.isSmartTopUpChecked;ne.setIsSmartTopUpChecked(e)}}))),n.createElement("h2",{className:"ps-3"},ee("coupon_code")),n.createElement("div",{className:"mb-8 mt-4 flex flex-col gap-2"},n.createElement("div",{className:"flex w-full rounded-2xl bg-white px-5 py-4 shadow-sm shadow-gray-300"},n.createElement("input",{placeholder:null!==(Q=ee("enter_here"))&&void 0!==Q?Q:"",autoComplete:"on",autoCorrect:"on",className:"block w-full pe-5 text-start uppercase text-black outline-none placeholder:normal-case disabled:bg-white",type:"text","aria-label":"Coupon Code",disabled:!!Me||$e,onChange:e=>{He(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&Ye()},value:Be}),n.createElement("button",{ref:V.AR,onClick:Ye,disabled:!((Be||Me)&&!$e),className:(0,V.cn)("flex flex-row items-center gap-1 rounded-xl border px-5 py-1 text-white transition duration-300",{"focus:custom-primary-focus-ring cursor-pointer border-primary bg-primary hover:bg-primary/85":!(!Be&&!Me||$e),"cursor-default !border-gray-400 bg-gray-400":!((Be||Me)&&!$e)})},$e&&n.createElement(Y.P.span,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},n.createElement(r.AhV,{className:"animate-spin"})),ee(Me?"remove":"apply"))),Me&&n.createElement(Y.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"ps-3"},n.createElement("span",{className:"flex text-start text-sm text-green-500"},ee("coupon_apply_success_message")))),0!==Se?n.createElement(n.Fragment,null,z.BI.length>1&&n.createElement(n.Fragment,null,n.createElement("hr",{className:"mb-4 border-t-2 border-primary-400"}),n.createElement("div",{className:"mb-8 rounded-2xl bg-white p-2"},n.createElement("div",{className:"relative"},n.createElement("div",{className:"flex flex-col items-stretch gap-2 rounded-xl sm:flex-row"},z.BI.map(e=>{if(e===M.A.STRIPE)return n.createElement("button",{ref:V.HG,className:(0,V.cn)("group relative flex w-full items-center gap-2 overflow-hidden rounded-xl border-2 bg-white p-4 text-primary transition duration-300 focus:text-primary-400 focus:outline-none",{"border-primary text-primary":ne.gateway===e,"border-transparent text-black hover:border-primary-400 hover:text-primary":ne.gateway!==e}),key:e,onClick:()=>{(async e=>{if(ne.gateway===e)return;Ne(!0),z.BI.includes(e)&&ne.setGateway(e);const t=re.currencies.find(e=>e.currency===re.currency);if(null!=t&&t.gateways&&!t.gateways.includes(e)){const t=re.currencies.find(t=>{var a;return null===(a=t.gateways)||void 0===a?void 0:a.includes(e)});t&&re.updateCurrency(t.currency)}})(e)}},n.createElement("span",{className:(0,V.cn)("flex aspect-square size-6 items-center justify-center rounded-full border-2 p-1 transition duration-300 group-hover:border-primary-400",{"border-transparent bg-white":ne.gateway!==e,"border-primary bg-primary/10":ne.gateway===e})},n.createElement(o.CMH,{className:(0,V.cn)("size-full transition duration-300 group-hover:text-primary-400",{"text-primary":ne.gateway===e,"text-white":ne.gateway!==e})})),n.createElement("span",{className:(0,V.cn)("w-full text-start",{"font-semibold":ne.gateway===e})},ee("pay_by_card")),n.createElement("div",{className:"ms-auto flex flex-wrap items-center justify-end gap-2"},n.createElement(s.eMv,{className:"size-4 origin-right transition duration-300"}),n.createElement(l.F4b,{className:"size-4 origin-right transition duration-300"}),n.createElement(_.A,{className:"size-4 origin-right transition duration-300"}),n.createElement(b.A,{className:"size-4 origin-right transition duration-300"}),n.createElement(w.A,{className:"size-4 origin-right transition duration-300"})))}))))),(()=>{if(ne.gateway===M.A.STRIPE)return n.createElement(P.A,{ref:St,selectedProduct:de,location:le,ableToChooseCard:(e=ne.gateway,[M.A.STRIPE].includes(e)),setPaymentInfoComplete:At,setIsProcessingOrder:Pt,processOrder:Rt,processOrderFailed:Tt,recreatePaymentIntent:ve,total:Se,appliedCoupon:Me,setShowNotAllowedPaymentModal:at,setPaymentNotAllowedType:rt,displayTotal:Ae,isNotAbleToProcessOrder:Ft,onConfirmPayment:jt,isProcessingOrder:kt,postContentElement:zt});var e})()):n.createElement(k.A,{displayTotal:Ae,isNotAbleToProcessOrder:Ft,onConfirmPayment:jt,isProcessingOrder:kt,postContentElement:zt})),!(ne.gateway===M.A.STRIPE&&ne.clientSecret&&de&&!_e)&&n.createElement(Y.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"absolute inset-0 z-[5] flex w-full items-center justify-center backdrop-blur-sm"},n.createElement(A.A,null)))),n.createElement(v.A,{isModalOpen:Oe,setIsModalOpen:Te}),n.createElement(x.A,{selectedProduct:de,isModalOpen:Nt,setIsModalOpen:Ct}),n.createElement(O.A,{isModalOpen:Fe,setIsModalOpen:Re}),n.createElement(g.A,{isModalOpen:tt,setIsModalOpen:at,paymentType:nt}),n.createElement(f.A,{isModalOpen:Je,setIsModalOpen:Ve,content:(null==Ge?void 0:Ge.inner_content)||""}),n.createElement(p.A,{isModalOpen:dt,setIsModalOpen:ut,addresses:st,selectedAddress:yt,onSelect:ft,onAddNew:()=>{pt(!0)},onEdit:e=>{ht(e),xt(!0)},onDelete:Et}),n.createElement(y.A,{isModalOpen:gt,setIsModalOpen:xt,address:vt,onSave:(e,t)=>{ft(e)},onDelete:Et}),n.createElement(m.Ay,{isModalOpen:mt,setIsModalOpen:pt,onSave:e=>{lt(e.id),ct(!0),oe.load()}})))}},69018:function(e,t,a){var n=a(96540),r=a(24755),s=a(20533),o=a(88419);t.A=e=>{let{selectedProduct:t,isModalOpen:a,setIsModalOpen:l}=e;const{t:i}=(0,r.useI18next)();return n.createElement(s.A,{type:"info",isModalOpen:a,setIsModalOpen:l},n.createElement("div",{className:"flex flex-col gap-4"},n.createElement("div",{className:"text-justify"},t?t.duration>0?i("smart_top_up_onetime_info",{thresholdAmount:t.threshold,thresholdUnit:t.threshold_unit,amount:t.amount,unit:t.unit,duration:t.duration}):i("smart_top_up_lifetime_info",{thresholdAmount:t.threshold,thresholdUnit:t.threshold_unit,amount:t.amount,unit:t.unit}):""),n.createElement("button",{ref:o.AR,className:"custom-btn-primary w-full",onClick:()=>{l(!1)}},i("got_it"))))}}}]);
2//# sourceMappingURL=component---src-pages-sim-cards-plans-[location]-checkout-tsx-4f7df70a882e22580d67.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.