1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4570],{23767:(e,l,n)=>{n.d(l,{nE:()=>i,rr:()=>t});var i=function(e){return e.FAILED="FAILED",e.OPEN="OPEN",e.PROCESSING="PROCESSING",e.COMPLETE="COMPLETE",e}({}),t=function(e){return e.CARD="CARD",e.MANDATE="MANDATE",e}({})},34570:(e,l,n)=>{n.r(l),n.d(l,{default:()=>I});var i=n(10762),t=n(52162),o=n(27620),d=n(50472),s=n(85937),r=n(62635),a=n(61607),u=n(18030),c=n(23767),v=n(39379),m=n(37767),p=n(85919),x=n(76595),b=n(25194),g=n(33912),f=n(17353),h=n(55620);let _=e=>{var l,n,x,_,E,N;let{finverseStatus:y,onTryAgain:w}=e,A=(0,v.useTranslations)(),{unitType:j,building:k,activeOrder:C,isReservation:S,unit:I,localZendeskTicketId:O}=(0,t.useContext)(r.g),T=(0,d.useRouter)(),F=(0,v.useLocale)(),P=JSON.parse(null!==(E=sessionStorage.getItem("checkoutFormData"))&&void 0!==E?E:"{}"),M=JSON.parse(null!==(N=sessionStorage.getItem("insuranceValue"))&&void 0!==N?N:"{}"),R=Number((null==M?void 0:null===(n=M.title)||void 0===n?void 0:null===(l=n.en)||void 0===l?void 0:l.replace(/[^0-9]/g,""))||0),L=()=>{(0,p.Nu)(),T.push("/".concat(F,"/account/your-units"))},D=()=>{(0,p.Nu)(),T.push("/".concat(F,"/storage-facilities"))},V={backgroundClass:"payment-success",textClass:"text-[#00AA3E]",Icon:(0,i.jsx)(s.A,{animationData:a,className:"inline-block h-28",loop:!1}),title:A(S?"reservation_success":"booking_success"),description:(0,i.jsxs)(i.Fragment,{children:[A(S?"check_reservation_email":"check_booking_email")," "]})},B={PROCESSING:{backgroundClass:"payment-processing",textClass:"text-amber-500",Icon:(0,i.jsx)(u.oe,{className:"w-full mb-4"}),title:A("booking_processed"),description:A("booking_processed_description")},FAILED:{backgroundClass:"payment-failed",textClass:"text-red-500",Icon:(0,i.jsx)(u.KQ,{className:"w-full mb-4"}),title:A("booking_failed"),description:(null==y?void 0:null===(_=y.payment)||void 0===_?void 0:null===(x=_.error)||void 0===x?void 0:x.details)||A("booking_failed_description")},DEFAULT:V,COMPLETED:V}
1[(null==y?void 0:y.session_status)||"DEFAULT"]||V,G=t.useRef(!1);return(0,t.useEffect)(()=>{var e,l,n,i,t,o,d,s,r,a,u,c,v,m,p,x,b,_,E,N,y,w,A,O,T,F,M,L;if(!k||!j||G.current||!g.n.shouldFireForOrder(null==P?void 0:P.id))return;G.current=!0;let D=S?{value:(null==j?void 0:j.price)||0,user_name:null!==(a=null==P?void 0:P.name)&&void 0!==a?a:null,building_name:null!==(u=null==k?void 0:k.name)&&void 0!==u?u:null,item_id:null!==(c=null==j?void 0:j.id)&&void 0!==c?c:null,item_name:null!==(v=null==j?void 0:null===(e=j.title)||void 0===e?void 0:e.en)&&void 0!==v?v:null,item_brand:"StorHub",item_category:"Self Storage",item_price:(null==C?void 0:null===(l=C.invoicePreview)||void 0===l?void 0:l.total)||0,item_variant:null==j?void 0:null===(i=j.code)||void 0===i?void 0:null===(n=i.split("-"))||void 0===n?void 0:n[0],item_location_id:null!==(m=null==j?void 0:j.siteId)&&void 0!==m?m:null,email:null!==(p=null==P?void 0:P.email)&&void 0!==p?p:null,phone:null!==(x=null==P?void 0:P.phone)&&void 0!==x?x:null}:{value:(null==j?void 0:j.price)||0,user_id:null!==(b=null==P?void 0:P.id_no)&&void 0!==b?b:null,user_name:null!==(_=null==P?void 0:P.name)&&void 0!==_?_:null,building_name:null!==(E=null==k?void 0:k.name)&&void 0!==E?E:null,unit_name:null!==(N=null==I?void 0:I.name)&&void 0!==N?N:null==j?void 0:null===(t=j.title)||void 0===t?void 0:t.en,currency:"SGD",coupon:null!==(y=null==C?void 0:C.promoCode)&&void 0!==y?y:null,insurance_price:R||0,item_id:null!==(w=null==j?void 0:j.id)&&void 0!==w?w:null,item_name:null!==(A=null==j?void 0:null===(o=j.title)||void 0===o?void 0:o.en)&&void 0!==A?A:null,item_brand:"StorHub",item_category:"Self Storage",item_price:(null==C?void 0:null===(d=C.invoicePreview)||void 0===d?void 0:d.total)||0,item_variant:null==j?void 0:null===(r=j.code)||void 0===r?void 0:null===(s=r.split("-"))||void 0===s?void 0:s[0],item_location_id:null!==(O=null==j?void 0:j.siteId)&&void 0!==O?O:null,email:null!==(T=null==P?void 0:P.email)&&void 0!==T?T:null,phone:null!==(F=null==P?void 0:P.phone)&&void 0!==F?F:null};g.n.pushEvent(S?g.n.EVENT_NAME.COMPLETE_RESERVATION:g.n.EVENT_NAME.COMPLETE_BOOKING,D);try{let e=document.cookie.split("; ").find(e=>e.startsWith("_fbc=")),l=e?e.substring(5):void 0,n=document.cookie.split("; ").find(e=>e.startsWith("_fbp=")),i=n?n.substring(5):void 0,t=(0,h.A)(D,{userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,email:null!==(M=null==P?void 0:P.email)&&void 0!==M?M:void 0,phone:null!==(L=null==P?void 0:P.phone)&&void 0!==L?L:void 0,fbc:l,fbp:i});f.FB.pushEvent(S?f.FB.EVENT_NAME.COMPLETE_RESERVATION:f.FB.EVENT_NAME.PURCHASE,t)}catch(e){console.error("[OrderSuccess] FB push failed",e)}},[k,j,S]),(0,i.jsx)(i.Fragment,{children:k&&j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{className:"flex w-full items-center pt-[18px] pb-[120px] md:pb-[32px] box-content",children:[(0,i.jsx)("span",{className:"w-full absolute"}),(0,i.jsxs)("span",{className:"relative flex flex-col justify-center mx-auto w-full px-4 md:px-0 bg-transparent fade-in",children:[(0,i.jsx)("div",{className:"fixed top-[12px] left-[14px] md:left-[0] mx-auto md:w-[640px] md:relative cursor-pointer z-[50] ",children:(0,i.jsx)("div",{className:"w-[24px] h-[24px]",onClick:D,children:(0,i.jsx)(u.Br,{})})}),(0,i.jsx)("p",{className:"".concat(B.textClass," text-xl font-bold capitalize text-center mb-3 leading-[24px]"),children:null==B?void 0:B.title}),(null==y?void 0:y.session_status)===c.nE.FAILED&&w&&(0,i.jsx)(m.A,{className:(0,o.A)("cursor-pointer bg-secondary border-[1.5px] border-secondary text-center uppercase font-bold text-xs max-[330px]:text-sm max-[360px]:text-base leading-[19.2px] text-white py-[9px] md:py-[13.9px] self-center rounded-[100px] px-20 mt-4"),onClick:w,title:A("try_again")}),!S&&(0,i.jsxs)("div",{className:"flex gap-1 sm:gap-3 pt-4 pb-8 md:pb-2 w-full md:w-[640px] mx-auto justify-center",children:[(0,i.jsx)("button",{className:(0,o.A)("bg-transparent h-fit md:max-h-10 hover:text-white hover:bg-secondary border-secondary text-secondary py-2.5 rounded-[100px] w-[200px] font-bold text-xs sm:text-sm leading-[16.8px] md:py-2.5 uppercase border-[2px]"),onClick:D,children:A("back_to_home_page")}),(0,i.jsx)("button",{className:(0,o.A)("text-white h-fit md:max-h-10","border-secondary bg-secondary hover:text-secondary hover:bg-white py-2.5 rounded-[100px] w-[200px] font-bold text-xs sm:text-sm leading-[16.8px] md:py-2.5 uppercase border-[2px]"),onClick:L,children:A("view_your_unit")})]}),(0,i.jsx)(b.default,{})]})]}),S&&(0,i.jsx)("div",{className:"fixed md:relative bottom-0 bg-white md:bg-transparent w-full py-2.5 px-2.5 border-t-[1px] md:border-t-0 border-t-lightGray-200 fade-in",children:(0,i.jsx)("div",{className:"w-full flex items-center justify-center",children:(0,i.jsx)("button",{className:(0,o.A)("cursor-pointer bg-secondary border-[1.5px] border-secondary text-center uppercase font-bold text-sm sm:text-base leading-[19.2px] text-white py-[9px] md:py-[13.9px] self-center rounded-[100px] ml-2 md:ml-3 w-full sm:w-[314px]"),onClick:L,children:A("view_your_units")})})})]})})};var E=n(84127),N=n(3319),y=n(47035),w=n(56423),A=n(88769),j=n(28490),k=n(62307),C=n(30451);let S=()=>{var e,l,n,c;let{unitType:b,building:_,activeOrder:S,isReservation:I,leadType:O,invoicePreviewLoading:T,localZendeskTicketId:F,unit:P,bookingSetting:M}=(0,t.useContext)(r.g),{user:R}=(0,A.A)(),L=(0,d.useRouter)(),D=(0,v.useLocale)(),V=(0,v.useTranslations)(),B=(0,d.useSearchParams)(),G=B.get("fpx_session_id"),z=null==B?void 0:B.get("orderId"),U=null==B?void 0:B.get("zendeskTicketId"),H=null==B?void 0:B.get("success"),Y=null==M?void 0:M.enableNewBookingInterface,J=JSON.parse(null!==(n=sessionStorage.getItem("checkoutFormData"))&&void 0!==n?n:"{}"),W=JSON.parse(null!==(c=sessionStorage.getItem("insuranceValue"))&&void 0!==c?c:"{}"),K=Number((null==W?void 0:null===(l=W.title)||void 0===l?void 0:null===(e=l.en)||void 0===e?void 0:e.replace(/[^0-9]/g,""))||0),q=()=>{(0,p.Nu)(),L.push("/".concat(D,"/account/your-units"))},Q=()=>{(0,p.Nu)(),L.push("/".concat(D,"/storage-facilities"))},X=t.useRef(!1);return((0,t.useEffect)(()=>{(null==R?void 0:R.id)&&(0,j.Pf)({url:"/api/booking/user/billing?userId=".concat(null==R?void 0:R.id),method:w.B1.PUT,body:{billingMethod:G?y.gA.INVOICE:y.gA.DEFAULT,billingTrigger:
1R.billingTrigger}})},[R,G]),(0,t.useEffect)(()=>{let e=U||(0,p.eq)();if(e&&O&&"true"===H&&z){var l;(0,k.zt)({zendeskTicketId:e,newTags:[w.jY.PAID],leadType:O,isFlowComplete:!0,orderId:z,zendeskAssigneeEmail:null==_?void 0:null===(l=_.json)||void 0===l?void 0:l.zendeskAssigneeEmail,zendeskStatus:C.fV.CLOSED}).then(e=>{(0,p.ix)()})}},[z,U,H,O]),(0,t.useEffect)(()=>{var e,l,n,i,t,o,d,s,r,a,u,c,v,m,p,x,E,N,y,w,A,j,k,C,O,T,F,M;if(!_||!b||X.current||!g.n.shouldFireForOrder(null==J?void 0:J.id))return;X.current=!0;let R=I?{value:(null==b?void 0:b.price)||0,user_name:null!==(a=null==J?void 0:J.name)&&void 0!==a?a:null,building_name:null!==(u=null==_?void 0:_.name)&&void 0!==u?u:null,item_id:null!==(c=null==b?void 0:b.id)&&void 0!==c?c:null,item_name:null!==(v=null==b?void 0:null===(e=b.title)||void 0===e?void 0:e.en)&&void 0!==v?v:null,item_brand:"StorHub",item_category:"Self Storage",item_price:(null==S?void 0:null===(l=S.invoicePreview)||void 0===l?void 0:l.total)||0,item_variant:null==b?void 0:null===(i=b.code)||void 0===i?void 0:null===(n=i.split("-"))||void 0===n?void 0:n[0],item_location_id:null!==(m=null==b?void 0:b.siteId)&&void 0!==m?m:null,email:null!==(p=null==J?void 0:J.email)&&void 0!==p?p:null,phone:null!==(x=null==J?void 0:J.phone)&&void 0!==x?x:null}:{value:(null==b?void 0:b.price)||0,user_id:null!==(E=null==J?void 0:J.id_no)&&void 0!==E?E:null,user_name:null!==(N=null==J?void 0:J.name)&&void 0!==N?N:null,building_name:null!==(y=null==_?void 0:_.name)&&void 0!==y?y:null,unit_name:null!==(w=null==P?void 0:P.name)&&void 0!==w?w:null==b?void 0:null===(t=b.title)||void 0===t?void 0:t.en,currency:"MYR",coupon:null!==(A=null==S?void 0:S.promoCode)&&void 0!==A?A:null,insurance_price:K||0,item_id:null!==(j=null==b?void 0:b.id)&&void 0!==j?j:null,item_name:null!==(k=null==b?void 0:null===(o=b.title)||void 0===o?void 0:o.en)&&void 0!==k?k:null,item_brand:"StorHub",item_category:"Self Storage",item_price:(null==S?void 0:null===(d=S.invoicePreview)||void 0===d?void 0:d.total)||0,item_variant:null==b?void 0:null===(r=b.code)||void 0===r?void 0:null===(s=r.split("-"))||void 0===s?void 0:s[0],item_location_id:null!==(C=null==b?void 0:b.siteId)&&void 0!==C?C:null,email:null!==(O=null==J?void 0:J.email)&&void 0!==O?O:null,phone:null!==(T=null==J?void 0:J.phone)&&void 0!==T?T:null};g.n.pushEvent(I?g.n.EVENT_NAME.COMPLETE_RESERVATION:g.n.EVENT_NAME.COMPLETE_BOOKING,R);try{let e=document.cookie.split("; ").find(e=>e.startsWith("_fbc=")),l=e?e.substring(5):void 0,n=document.cookie.split("; ").find(e=>e.startsWith("_fbp=")),i=n?n.substring(5):void 0,t=(0,h.A)(R,{userAgent:"undefined"!=typeof navigator?navigator.userAgent:void 0,email:null!==(F=null==J?void 0:J.email)&&void 0!==F?F:void 0,phone:null!==(M=null==J?void 0:J.phone)&&void 0!==M?M:void 0,fbc:l,fbp:i});f.FB.pushEvent(I?f.FB.EVENT_NAME.COMPLETE_RESERVATION:f.FB.EVENT_NAME.PURCHASE,t)}catch(e){console.error("[OrderSuccess] FB push failed",e)}},[_,b,I]),T)?(0,i.jsx)(N.default,{}):(0,i.jsx)(i.Fragment,{children:_&&b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{className:(0,o.A)("payment-success flex w-full items-center pt-[18px] md:pb-[32px] box-content",I?"pb-[120px]":"pb-[68px]"),children:[(0,i.jsx)("span",{className:"w-full absolute"}),(0,i.jsxs)("span",{className:"relative flex flex-col justify-center mx-auto w-full px-4 md:px-0 bg-transparent fade-in",children:[I&&(0,i.jsx)("div",{className:"fixed top-[12px] left-[14px] md:left-[0] mx-auto md:w-[640px] md:relative cursor-pointer z-[50] ",children:(0,i.jsx)("div",{className:"w-[24px] h-[24px]",onClick:Q,children:(0,i.jsx)(u.Br,{})})}),(0,i.jsx)(s.A,{animationData:a,className:"inline-block h-28",loop:!1}),(0,i.jsx)("p",{className:"text-xl font-bold text-center mb-3 leading-[24px]",children:V(I?"reservation_success":"booking_success")}),(0,i.jsxs)("p",{className:"text-lightGray text-sm font-medium leading-[19.6px] text-center",children:[V(I?"check_reservation_email":"check_booking_email")," ",(0,i.jsxs)("span",{className:"font-bold",children:[(null==R?void 0:R.email)||"","."]})]}),!I&&(0,i.jsxs)("div",{className:"flex gap-1 sm:gap-3 pt-4 pb-8 md:pb-2 w-full md:w-[640px] mx-auto justify-center",children:[(0,i.jsx)("button",{className:(0,o.A)("bg-transparent h-fit hover:text-white hover:bg-secondary border-secondary text-secondary py-2.5 rounded-[100px] w-[200px] font-bold text-xs sm:text-sm leading-[16.8px] md:py-2.5 uppercase border-[2px]"),onClick:Q,children:V("back_to_home_page")}),(0,i.jsx)("button",{className:(0,o.A)("text-white h-fit","border-secondary bg-secondary hover:text-secondary hover:bg-white py-2.5 rounded-[100px] w-[200px] font-bold text-xs sm:text-sm leading-[16.8px] md:py-2.5 uppercase border-[2px]"),onClick:q,children:V("view_your_unit")})]}),(0,i.jsx)(E.A,{})]})]}),Y?(0,i.jsx)(i.Fragment,{children:I&&(0,i.jsx)("div",{className:"fixed md:relative bottom-0 bg-white md:bg-transparent w-full py-2.5 px-2.5 border-t-[1px] md:border-t-0 border-t-lightGray-200 fade-in",children:(0,i.jsx)("div",{className:"w-full flex items-center justify-center",children:(0,i.jsx)("button",{className:(0,o.A)("cursor-pointer bg-secondary border-[1.5px] border-secondary text-center uppercase font-bold text-sm sm:text-base leading-[19.2px] text-white py-[9px] md:py-[13.9px] self-center rounded-[100px] ml-2 md:ml-3 w-full sm:w-[314px]"),onClick:q,children:V("view_your_units")})})})}):(0,i.jsxs)("div",{className:"fixed md:relative bottom-0 bg-white md:bg-transparent w-full py-2.5 px-2.5 border-t-[1px] md:border-t-0 border-t-lightGray-800 fade-in",children:[(0,i.jsx)("div",{className:"w-full flex items-center justify-center",children:I&&(0,i.jsx)(m.A,{className:(0,o.A)("cursor-pointer bg-secondary border-[1.5px] border-secondary text-center uppercase font-bold text-sm sm:text-base leading-[19.2px] text-white py-[9px] md:py-[13.9px] self-center rounded-[100px] ml-2 md:ml-3","w-full sm:w-[314px]"),onClick:()=>{let e=F||(0,p.eq)(),l=(0,x.y)(),n="".concat(l,"/storage-facilities/").concat(null==_?void 0:_.slug,"/checkout/reservation?order_id=").concat(null==S?void 0:S.id,"&zendesk_ticket_id=").concat(e);(null==P?void 0:P.id)&&(n+="&unit_id=".concat(null==P?void 0:P.id)),(0,p.Nu)(),window.location.replace(n)},title:V("complete_booking")})}),I&&(0,i.jsx)("div",{className:"sm:text-center mt-2.5 md:mt-4 md:mb-5",children:(0,i.jsxs)("p",{className:"font-semibold text-sm md:text-base text-[#757575] leading-[16.8px] md:leading-[19.2px]",children:[V("before_complete_booking")," ",(0,i.jsx)("span",{className:"text-secondary cursor-pointer",onClick:q,children:V("Your_units")})]})})]})]})})},I=e=>{let{finverseStatus:l,onTryAgain:n}=e,{brand:o}=(0,t.useContext)(r.g),d=(()=>{switch(null==o?void 0:o.slug){case w.Yx.SINGAPORE:return _;case w.Yx.MALAYSIA:return S;default:return null}})();return((0,t.useEffect)(()=>{localStorage.removeItem("signatureUrl"),(0,p.z3)()},[]),d)?(0,i.jsx)(d,{finverseStatus:l,onTryAgain:n}):(0,i.jsx)(i.Fragment,{})}}}]);
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.