PageSourceSearch

https://topmate.io/_next/static/chunks/52448.17ac767aaa7f110b.js

js topmate.io collected 2026-10-01 11:26:27 UTC 3,701 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[52448],{52448:(e,t,i)=>{i.r(t),i.d(t,{default:()=>_});var r=i(95155),s=i(35625),a=i(99362),n=i(87056),d=i(428),l=i(96073),c=i(61866),y=i(8208),o=i(12115),p=i(38323),x=i(34386),f=i(17077),u=i(49635),g=i(98584);let{Text:h}=a.A,j=[7,14,30,60],b=({children:e})=>(0,r.jsx)(h,{style:{fontSize:11,fontWeight:600,letterSpacing:.4,textTransform:"uppercase",color:"#8c8c8c"},children:e}),_=({open:e,onClose:t,booking:i,onSuccess:a})=>{let _=(0,s.useQueryClient)(),[w,k]=(0,o.useState)(30),[m,A]=(0,o.useState)(!1),S=i?.extended_days??0,v=S+(w||0)>3650,C=i?.effective_expiry?i.new_expiry_date||(0,u.br)(i.effective_expiry):"No time limit",z=w&&w>=1?(0,g.Z)(i,w):null,E=()=>{k(30),A(!1)},N=async()=>{if(i?.id&&w&&!(w<1)&&!(w>365)&&!v){A(!0);try{let e=await (0,x.erd)(i.id,w);f.j0.track("Package Validity Extended",{booking_id:i.id,days:w,prior_extended_days:S}),n.Ay.success(`Validity extended by ${w} days.`),_.setQueriesData({queryKey:["packageCalls"]},t=>t?.data?.results?{...t,data:{...t.data,results:t.data.results.map(t=>t?.id===i.id?{...t,effective_expiry:e?.effective_expiry??t.effective_expiry,new_expiry_date:e?.new_expiry_date??t.new_expiry_date,last_renewed:new Date().toISOString()}:t)}}
1:t),_.invalidateQueries({queryKey:["packageCalls"]}),a?.(),E(),t()}catch(t){let e=(0,u.Bi)(t);n.Ay.error("string"==typeof e&&e?e:"Could not extend validity. Please try again."),A(!1)}}},Q=!w||w<1||v;return(0,r.jsx)(d.default,{open:e,onCancel:()=>{m||(E(),t())},footer:null,destroyOnHidden:!0,centered:!0,width:480,title:(0,r.jsx)("span",{style:{fontSize:18,fontWeight:600},children:"Extend package validity"}),closeIcon:(0,r.jsx)(p.$8F,{fontSize:22,color:"#141414"}),children:(0,r.jsxs)(l.A,{vertical:!0,gap:20,style:{width:"100%",paddingTop:4},children:[(0,r.jsxs)(l.A,{vertical:!0,gap:6,style:{background:"#fafafa",border:"1px solid #f0f0f0",borderRadius:12,padding:"12px 16px"},children:[(0,r.jsxs)(l.A,{justify:"space-between",align:"center",gap:12,children:[(0,r.jsx)(h,{type:"secondary",style:{fontSize:13},children:"Current expiry"}),(0,r.jsx)(h,{strong:!0,style:{fontSize:13},children:C})]}),(0,r.jsxs)(l.A,{justify:"space-between",align:"center",gap:12,children:[(0,r.jsx)(h,{type:"secondary",style:{fontSize:13},children:"Extended so far"}),(0,r.jsxs)(h,{strong:!0,style:{fontSize:13},children:[S," day",1===S?"":"s"]})]})]}),(0,r.jsxs)(l.A,{vertical:!0,gap:10,children:[(0,r.jsx)(b,{children:"Quick add"}),(0,r.jsx)(l.A,{gap:8,wrap:"wrap",children:j.map(e=>{let t=w===e;return(0,r.jsxs)(c.Ay,{type:t?"primary":"default",onClick:()=>k(e),disabled:m,style:{minWidth:88,borderRadius:8},children:["+",e," days"]},e)})})]}),(0,r.jsxs)(l.A,{vertical:!0,gap:6,children:[(0,r.jsx)(b,{children:"Custom amount"}),(0,r.jsxs)(l.A,{align:"center",gap:10,children:[(0,r.jsx)(y.A,{min:1,max:365,value:w,onChange:e=>k(Number(e)||0),disabled:m,style:{width:110}}),(0,r.jsxs)(h,{type:"secondary",style:{fontSize:13},children:["days \xb7 1–",365," per extension"]})]})]}),z&&(0,r.jsxs)(l.A,{justify:"space-between",align:"center",gap:12,style:{background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:12,padding:"12px 16px"},children:[(0,r.jsxs)(h,{type:"secondary",style:{fontSize:13},children:["New expiry after +",w," day",1===w?"":"s"]}),(0,r.jsx)(h,{strong:!0,style:{fontSize:14},children:(0,u.br)(z)})]}),v&&(0,r.jsxs)(h,{style:{color:"#b91c1c",fontSize:12},children:["Cumulative limit reached. Total extension cannot exceed"," ",3650," days (currently ",S,")."]}),(0,r.jsx)(c.Ay,{type:"primary",block:!0,size:"large",loading:m,disabled:Q,onClick:N,style:{marginTop:4,borderRadius:10,fontWeight:600},children:"Apply extension"})]})})}}}]);

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.