const tourMoney=n=>new Intl.NumberFormat('en-GB',{style:'currency',currency:'GBP'}).format(n/100);
const tourDays=n=>n===1?'1 day':(n??'')+' days';
function tourCancellationCopy(record){
 const state=tourCancellationState(record?.payment,record?.booking?.status);
 if(!state.cancelled)return null;
 if(state.expired)return {title:'Your booking expired.',description:'No payment was taken. Your temporary places have been released.'};
 if(state.needsReview)return {title:'Your cancelled booking is being checked.',description:'Your payment and refund details are still being checked. Contact the operator if you need help.'};
 if(state.fullyRefunded)return {title:'Your refund is confirmed.',description:'Your booking is cancelled. Your payment and refund history stays here for your records.'};
 return {title:'Your booking is cancelled.',description:state.unpaid?'No payment was taken. Your booking details stay here for your records.':'Your payment and refund history shows the amounts refunded and retained.'};
}
// New copy goes through the operator interface runtime when the page has loaded it.
const tourCopy=(value,values)=>typeof window!=='undefined'&&typeof window.operatorText==='function'?window.operatorText(value,values):values?value.replace(/\{(\w+)\}/g,(token,key)=>Object.hasOwn(values,key)?String(values[key]):token):value;
// A channel referral is captured by the inline script at the top of operator-tour.html (before any
// third-party script runs) and kept per tour. It is sent only with this tour's checkout; the server
// verifies it and decides the booking source. The address bar's ?source= is never used for a booking.
const tourReferralKey=id=>'bookuno-tour-referral:'+id;
function tourReferral(id,storage=sessionStorage){try{const v=id&&storage.getItem(tourReferralKey(id));return typeof v==='string'&&v.length<=1024&&/^[A-Za-z0-9._-]+$/.test(v)?v:null;}catch{return null;}}
function tourCheckoutBooking(tourId,booking,commerce,storage){const referral=commerce?tourReferral(tourId,storage):null;return {...booking,booking_source:'website',...(commerce?{tour_id:tourId,...(referral?{referral}:{})}:{})};}
// One reading of a departure's places. Newer data carries places_left/bookable/places_reason/max_quantity;
// older data only has available, max_per_booking and closed.
function tourPlaces(s){
 if(!s)return {bookable:false,left:0,max:0,reason:'closed'};
 const left=Math.max(0,Number.isInteger(s.places_left)?s.places_left:Number.isInteger(s.available)?s.available:0);
 const bookable=(typeof s.bookable==='boolean'?s.bookable:!s.closed)&&left>0;
 const reason=bookable?'ok':s.places_reason==='full'||(!s.places_reason||s.places_reason==='ok')&&left===0?'full':'closed';
 const cap=Math.min(left,Number.isInteger(s.max_quantity)?s.max_quantity:left,Number.isInteger(s.max_per_booking)?s.max_per_booking:left);
 return {bookable,left,reason,max:bookable?Math.max(0,cap):0};
}
function tourPlacesLabel(p){return p.bookable?(p.left===1?tourCopy('1 place left'):tourCopy('{0} places left',{0:p.left})):p.reason==='full'?tourCopy('Sold out'):tourCopy('Booking closed');}
function tourCheckedTime(date){try{return (window.BOOKUNO_REGION?.dateFormatter({timeStyle:'short'})||new Intl.DateTimeFormat('en-GB',{hour:'2-digit',minute:'2-digit'})).format(date);}catch{return new Intl.DateTimeFormat('en-GB',{hour:'2-digit',minute:'2-digit'}).format(date);}}
function applyTourPlanPresentation(answer){
 if(typeof document==='undefined')return;
 const root=document.documentElement,key=answer?.plan_theme;
 if(typeof key==='string'&&/^[a-z][a-z0-9_]{1,39}$/.test(key))root.dataset.planTheme=key;else delete root.dataset.planTheme;
 if(answer?.simple_workspace===true)root.dataset.simpleWorkspace='true';else delete root.dataset.simpleWorkspace;
}
function OperatorTour(){
 const params=new URLSearchParams(location.search),tourId=params.get('tour'),bookingId=params.get('booking');
 const pendingKey='bookuno-guest-pending:'+tourId+':website';
 const [access,setAccess]=React.useState(()=>guestAccess(bookingId));
 const [catalogue,setCatalogue]=React.useState(null),[sessions,setSessions]=React.useState([]),[selected,setSelected]=React.useState(params.get('departure')||'');
 const [qty,setQty]=React.useState(2),[details,setDetails]=React.useState(()=>emptySessionContact('',2));
 const [record,setRecord]=React.useState(null),[error,setError]=React.useState(''),[busy,setBusy]=React.useState(false),[loading,setLoading]=React.useState(true);
 const [retry,setRetry]=React.useState(()=>JSON.parse(sessionStorage.getItem(pendingKey)||'null'));
 const [openReturn,setOpenReturn]=React.useState(false),[returnValue,setReturnValue]=React.useState('');
 const [checkedAt,setCheckedAt]=React.useState(null),[announce,setAnnounce]=React.useState(''),[invalid,setInvalid]=React.useState(null);
 const running=React.useRef(false),live=React.useRef(true),polling=React.useRef(false),lastPlaces=React.useRef(null);
 const tour=catalogue?.tour,operator=catalogue?.operator,operatorName=operator?.display_name||'Your operator',tourUrl='operator-tour.html?tour='+encodeURIComponent(tourId||'');
 const cancellation=tourCancellationCopy(record);
 const session=sessions.find(s=>s.id===(retry?.booking.session_id||selected)),places=tourPlaces(session),guests=retry?.booking.quantity||qty,total=(session?.unit_price_cents||tour?.price_cents||0)*guests,initial=tourInitialPayment(session,guests,tour?.deposit_bps),deposit=initial.amount_cents,fullPayment=initial.kind==='full';
 async function refresh(sync=false){
  setError('');try{
   const c=await operatorTourRequest('public_tour',{service_id:tourId});if(!live.current)return;applyTourPlanPresentation(c);setCatalogue(c);setSessions(c.sessions);setCheckedAt(new Date());setSelected(old=>old&&c.sessions.some(s=>s.id===old)?old:params.get('departure')?'':c.sessions.find(s=>tourPlaces(s).bookable)?.id||'');
   if(bookingId){
    const token=guestAccess(bookingId);setAccess(token);
    if(token){const r=await guestTourRequest(sync?'sync':'record',{reservation_id:bookingId,access_token:token});if(r.booking.session.service_id!==tourId)throw Error("This link belongs to a different tour.");if(live.current){setRecord(r);if(r.booking.status!=="held"){const saved=JSON.parse(sessionStorage.getItem(pendingKey)||"null");if(saved?.reservation_id===bookingId)sessionStorage.removeItem(pendingKey);}}}
    else {const auth=await window.BOOKUNO_API.getSession();if(auth?.user){const r=await tourCareRequest('record',{reservation_id:bookingId});if(r.booking.session.service_id!==tourId)throw Error("This link belongs to a different tour.");if(live.current){setRecord(r);if(r.booking.status!=="held"){const saved=JSON.parse(sessionStorage.getItem(pendingKey)||"null");if(saved?.reservation_id===bookingId)sessionStorage.removeItem(pendingKey);}}}}
   }
  }catch(e){if(live.current){setError(e.message);if(e.status===403||e.status===401)setRecord(null);}}finally{if(live.current)setLoading(false);}
 }
 function placesAnswer(c){if(!live.current)return;applyTourPlanPresentation(c);setCatalogue(c);setSessions(c.sessions);setCheckedAt(new Date());setSelected(old=>old&&!c.sessions.some(s=>s.id===old)?'':old);}
 async function refreshPlaces(){
  if(polling.current||!tourId)return;polling.current=true;
  try{placesAnswer(await operatorTourRequest('public_tour',{service_id:tourId}));}
  catch{/* Keep the last answer; the next check or checkout confirms places again. */}finally{polling.current=false;}
 }
 // After a refusal: the server said why (lib/bookuno-tour-commerce.js, e.reason). Nothing was saved, so the
 // saved request is dropped and the next try is a new request with the corrected details or places.
 async function recover(e,id){
  sessionStorage.removeItem(pendingKey);if(id)sessionStorage.removeItem(guestAccessKey(id));setRetry(null);
  if(e.reason==='invalid_details'){const problem=(typeof sessionContactProblem==='function'?sessionContactProblem(details,qty):null);setInvalid(problem?.field||(e.field==='guests'?'guest-0':'phone'));setError(problem?.message||e.message);requestAnimationFrame(()=>typeof sessionFocusField==='function'&&sessionFocusField('tour',problem?.field||(e.field==='guests'?'guest-0':'phone')));return;}
  if(e.reason==='places'||e.reason==='departure'){
   let c=null;try{c=await operatorTourRequest('public_tour',{service_id:tourId});placesAnswer(c);}catch{}
   const fresh=c?.sessions.find(s=>s.id===selected),left=fresh?tourPlaces(fresh):null;
   if(e.reason==='places'&&left?.bookable&&left.max>0){const n=Math.min(qty,left.max);setQty(n);setDetails(d=>sessionGuestCount(d,n));
    setError(n<qty?(left.left===1?tourCopy('Only 1 place is left on this departure. Your booking is now for 1 guest. Check the details and pay again.'):tourCopy('Only {0} places are left on this departure. Your booking is now for {1}. Check the details and pay again.',{0:left.left,1:n===1?'1 guest':n+' guests'})):tourCopy('The places changed while you were booking. Check the details and pay again.'));return;}
   if(e.reason==='departure'||c)setSelected('');
   setError(e.reason==='places'?tourCopy('This departure has just sold out. Choose another date.'):e.message);return;
  }
  if(e.quoteChanged){await refresh();setError(e.message);return;}
  setError(e.message);
 }
 React.useEffect(()=>{live.current=true;refresh(!!bookingId);return()=>{live.current=false;};},[]);
 // Places can change on another channel. Check every 15 s while the page is visible, and on focus.
 React.useEffect(()=>{if(bookingId||!catalogue)return;const visible=()=>document.visibilityState==='visible';const id=setInterval(()=>{if(visible())refreshPlaces();},15000);const back=()=>{if(visible())refreshPlaces();};window.addEventListener('focus',back);document.addEventListener('visibilitychange',back);return()=>{clearInterval(id);window.removeEventListener('focus',back);document.removeEventListener('visibilitychange',back);};},[bookingId,!!catalogue]);
 React.useEffect(()=>{const label=session?tourPlacesLabel(places):'',prev=lastPlaces.current;lastPlaces.current={id:session?.id,label};if(prev&&session&&prev.id===session.id&&prev.label!==label)setAnnounce(tourCopy('{0}: now {1}.',{0:operatorDateRange(session),1:label}));},[session?.id,places.left,places.bookable,places.reason]);
 React.useEffect(()=>{if(retry||bookingId||!session)return;const max=Math.max(1,Math.min(session.max_quantity??session.max_per_booking,session.places_left??session.available??1,session.max_per_booking??session.max_quantity));setQty(old=>Math.min(old,max));setDetails(old=>sessionGuestCount(old,Math.min(qty,max)));},[session?.id,session?.max_per_booking,session?.available,session?.places_left,session?.max_quantity]);
 React.useEffect(()=>{document.title=(tour?.name||'Tour')+' · '+operatorName;document.documentElement.dataset.tourTheme=operator?.theme||'forest';},[tour?.name,operatorName,operator?.theme]);
 React.useEffect(()=>{if(!record||record.booking.status!=='held')return;let n=0;const id=setInterval(()=>{if(++n>10){clearInterval(id);return;}refresh(true);},3000);return()=>clearInterval(id);},[record?.booking.id,record?.booking.status]);
 function checkoutResult(r){if(r.url){if(!r.url.startsWith('https://checkout.stripe.com/'))throw Error('Secure checkout could not be verified.');location.assign(r.url);}else location.assign(tourUrl+'&booking='+r.reservation_id);}
 async function pay(e){
  e.preventDefault();if(running.current)return;
  // The server's checks first: a mistyped phone number is fixed here, before anything is saved or sent.
  if(!retry){const problem=(typeof sessionContactProblem==='function'?sessionContactProblem(details,qty):null);if(problem){setInvalid(problem.field);setError(problem.message);typeof sessionFocusField==='function'&&sessionFocusField('tour',problem.field);return;}}
  running.current=true;setBusy(true);setError('');setInvalid(null);let p;
  try{
   p=retry||{reservation_id:crypto.randomUUID(),access_token:newGuestSecret(),booking:tourCheckoutBooking(tourId,{session_id:selected,quantity:qty,details,...(tourCommerceEnabled()?{expected_initial_payment_cents:deposit,expected_quote_hash:initial.quote_hash}:{})},tourCommerceEnabled())};
   sessionStorage.setItem(pendingKey,JSON.stringify(p));sessionStorage.setItem(guestAccessKey(p.reservation_id),p.access_token);setRetry(p);
   checkoutResult(await startGuestCheckout(p,!!retry));
  }catch(e){
   // Refused (not a network fault, a 5xx or a wait): drop the saved request. A refusal while resuming an
   // existing booking keeps it, so that booking is never duplicated.
   if(e.reason||e.quoteChanged||(e.rejected&&e.stage!=='resume'))await recover(e,p?.reservation_id);
   else{if(e.status===409)await refreshPlaces();setError(e.message);}
  }finally{running.current=false;setBusy(false);}
 }
 async function bookingPayment(kind){
  if(running.current)return;running.current=true;setBusy(true);setError('');try{
   let r;
   if(access)r=kind==='balance'?await guestBalancePayment(bookingId,access):await guestTourRequest('resume',{reservation_id:bookingId,access_token:access});
   else{const auth=await window.BOOKUNO_API.getSession();if(!auth?.user)throw Error('Open your private booking link to continue.');r=await tourCareMutation('balance',{reservation_id:bookingId,expected_actor_id:auth.user.id});}
   if(r.url)checkoutResult(r);else await refresh(true);
  }catch(e){setError(e.message);}finally{running.current=false;setBusy(false);}
 }
 async function closeBalance(){setBusy(true);setError('');try{if(access)await guestTourRequest('close_balance',{reservation_id:bookingId,access_token:access});else await tourCareRequest('close_balance',{reservation_id:bookingId});await refresh();}catch(e){setError(e.message);}finally{setBusy(false);}}
 function openSaved(e){
  e.preventDefault();
  try{
   const u=new URL(returnValue),id=u.searchParams.get('booking'),token=new URLSearchParams(u.hash.slice(1)).get('access');
   if(u.origin!==location.origin||u.pathname!=='/operator-tour.html'||!id||!/^[0-9a-f]{64}$/.test(token||''))throw Error();
   if(u.pathname===location.pathname&&u.search===location.search){
    // A replacement key can change only the fragment. That does not remount
    // this page, so consume it and recheck access rather than retaining the
    // previous key and private view until an unrelated reload.
    sessionStorage.setItem(guestAccessKey(id),token);
    history.replaceState(null,'',u.pathname+u.search);
    setAccess(token);setRecord(null);setOpenReturn(false);setLoading(true);
    refresh(true);
   }else location.assign(u.href);
  }catch{setError(typeof tourSimpleMode==='function'&&tourSimpleMode()?'Paste the complete private booking link you saved.':'Paste the complete private booking link saved from this preview.');}
 }
 function newBooking(){sessionStorage.removeItem(pendingKey);location.assign(tourUrl);}
 // Until the tour has loaded nobody knows which plan theme it wears, so the loading screen says nothing about test or demo.
 if(!catalogue)return <><header className="north-nav"><a className="north-logo" href="/">Bookuno</a></header><main className="north-layout"><section className="north-story"><p className="north-kicker">Tour bookings</p><h1>{loading?'Finding your tour…':'We couldn’t open this tour.'}</h1>{loading?<p role="status">Checking the latest tour details and available dates.</p>:<><p role="alert">{error||'The tour is temporarily unavailable.'}</p><p>Your booking details stay private. Try again, or contact the operator if the link no longer works.</p><button className="north-button" onClick={()=>{setLoading(true);refresh();}}>Try again</button><p><a href="/">Back to Bookuno</a></p></>}</section></main></>;
 // A tour wearing a simple plan theme carries no private-test wording: one note, only when the server says test.
 // Plain wording on a simple plan, and always in live mode (QA D5): the demo and test wording is for test mode only.
 const simple=(typeof tourSimpleMode==='function'&&tourSimpleMode(catalogue.simple_workspace===true))||(typeof tourTestWording==='function'&&!tourTestWording(catalogue));
 return <>{simple?(catalogue.test_mode===true&&<div className="demo-strip">{TOUR_TEST_NOTE}</div>):<div className="demo-strip">Private demonstration · fictional operator · Stripe test payments only</div>}<header className="north-nav"><a className="north-logo" href={tourUrl}>{operatorName}</a><nav><a href="#itinerary">The experience</a><button onClick={()=>setOpenReturn(!openReturn)}>Already booked?</button>{!simple&&<a href="test-drive.html">Demo guide</a>}</nav></header>
 {openReturn&&<form className="guest-open north-form" onSubmit={openSaved}><label>Your private booking link<input type="url" required value={returnValue} onChange={e=>setReturnValue(e.target.value)} placeholder="Paste the link you saved"/></label><button className="north-button">Open my booking</button><p className="north-small">Lost your link? The operator can replace it after checking your identity. A booking reference alone cannot open private details.</p></form>}
 <main>{!bookingId&&<section className="north-hero"><div><p className="north-kicker">{operator?.tagline}</p><h1>{tour?.name||'Your next adventure.'}</h1><p>{tour?.description}</p><div className="north-facts"><span>{tourDays(tour?.days)}</span><span>Small group tours</span><span>{tourMoney(tour?.price_cents||0)} per person</span></div><a className="north-button" href="#reserve">Choose your departure</a><p className="guest-no-account">No account to create. Just your next adventure.</p></div></section>}
 <div className="north-layout"><section className="north-story" id="itinerary">{bookingId?<><p className="north-kicker">Your {operatorName} booking</p><h1>{cancellation?cancellation.title:record?.booking.status==='confirmed'?'You’re coming with us.':'Your places, your plans.'}</h1><p>{cancellation?cancellation.description:record?.booking.status==='confirmed'?(record.payment.remaining_cents===0?'Your trip is paid in full. Your guest details and payment history are here whenever you need them.':'Your booking, guests and payments are together. Pay the balance securely whenever you’re ready.'):'Use your private booking link to check your trip and payments.'}</p></>:<><p className="north-kicker">Your itinerary</p><h2>{tour?.days===1?'One day to remember.':tourDays(tour?.days)+' to remember.'}</h2><ol className="north-days">{tour?.itinerary.map((day,i)=><li key={i}><span>{String(i+1).padStart(2,'0')}</span><div><h3>Day {i+1}</h3><p>{day}</p></div></li>)}</ol><div className="north-included"><h3>Know before you book</h3><p><strong>Meeting point</strong><br/>{tour?.meeting_point}</p><p>{tour?.inclusions}</p><h3>Changes and cancellation</h3><p>{tour?.cancellation_policy}</p><p>Balance due {tourDays(tour?.balance_due_days)} before departure. Bookings on or after that date require full payment.{simple?'':' This is a fictional tour for private testing.'}</p></div></>}
 {record&&<><div className="north-reference"><span>Booking reference</span><strong>{record.booking.reference}</strong><p>{record.booking.quantity} {record.booking.quantity===1?'guest':'guests'} · {operatorDateRange(record.booking.session)} · {tourDays(tour?.days)}</p><p>{record.booking.status==='confirmed'?'Confirmed':record.booking.status==='held'?'Places held while payment is checked':record.booking.status}</p></div><SessionContactSummary details={record.booking.details}/>{access&&<GuestReturnLink tour={tourId} id={bookingId} token={access}/>}</>}
 </section><aside id="reserve" className="north-reserve"><p className="north-kicker">{record?.booking.booking_source==='dirt_house'?'Found on Dirt House · booked with '+operatorName:'Book directly with '+operatorName}</p><h2>{bookingId?'Your booking':'Make it your next ride.'}</h2>{loading&&<p role="status">Checking the latest details…</p>}{params.get('departure')&&catalogue&&!bookingId&&!sessions.some(s=>s.id===params.get('departure'))&&<p role="status" className="north-error">The requested departure is closed or unavailable. Choose another available date below.</p>}{error&&<p className="north-alert" role="alert">{error}</p>}
 {record?<><TourDepositSummary payment={record.payment}/>{record.booking.status==='confirmed'&&record.payment.remaining_cents>0&&<button className="north-button" disabled={busy||record.payment.needs_review||record.payment.refund_pending} onClick={()=>bookingPayment('balance')}>{busy?'Opening checkout…':record.payment.payment_pending?'Continue balance payment':'Pay '+tourMoney(record.payment.remaining_cents)+(simple?' balance':' balance (test)')}</button>}{record.booking.status==='confirmed'&&record.payment.payment_pending&&!(typeof tourCommerceEnabled==='function'&&tourCommerceEnabled()&&access)&&<button className="north-button secondary" disabled={busy} onClick={closeBalance}>Close unpaid balance checkout</button>}<button className="north-button secondary" disabled={busy} onClick={()=>refresh(true)}>Refresh payment status</button>{record.booking.status==='held'&&record.payment.paid_cents===0&&access&&<button className="north-button" disabled={busy} onClick={()=>bookingPayment('deposit')}>{simple?'Return to secure checkout':'Return to secure test checkout'}</button>}<p className="north-small">{simple?'Save your private link before leaving this page.':'Emails are paused. Save your private link before leaving this page.'}</p><button className="north-text-button" onClick={newBooking}>View the tour again</button></>:!loading&&bookingId?<div className="guest-empty"><h3>Open your private booking link.</h3><p>It contains the key to your booking. Your reference by itself cannot show personal details.</p><button className="north-button secondary" onClick={()=>setOpenReturn(true)}>I have my booking link</button><p className="north-small">If it is lost or expired, ask the operator for a replacement after an identity check.</p></div>:!loading&&<><div className="north-quote"><label>Departure<select value={retry?.booking.session_id||selected} disabled={busy||!!retry} onChange={e=>setSelected(e.target.value)}><option value="" disabled>Choose an available departure</option>{sessions.map(s=>{const p=tourPlaces(s),range=operatorDateRange(s);return <option key={s.id} value={s.id} disabled={!p.bookable&&s.id!==retry?.booking.session_id} aria-label={p.bookable?undefined:tourCopy('{0}, {1}. Not available to book.',{0:range,1:tourPlacesLabel(p)})}>{range} · {tourPlacesLabel(p)}</option>;})}</select></label><label>Guests<select value={guests} disabled={busy||!!retry} onChange={e=>{setQty(Number(e.target.value));setDetails(sessionGuestCount(details,Number(e.target.value)));}}>{Array.from({length:Math.max(1,places.max,retry?guests:0)},(_,i)=><option key={i+1} value={i+1}>{i+1} {i===0?'guest':'guests'}</option>)}</select></label>{session&&!retry&&!places.bookable&&<p className="north-alert" role="alert">{places.reason==='full'?tourCopy('This departure is sold out. Choose another date.'):tourCopy('Booking for this departure is closed. Choose another date.')}</p>}<p className="north-small tour-places-live" aria-live="polite" style={announce?undefined:{margin:0}}>{announce}</p>{checkedAt&&!retry&&<p className="north-small tour-places-checked">{session&&places.bookable?tourPlacesLabel(places)+' · ':''}{tourCopy('Places checked {0}',{0:tourCheckedTime(checkedAt)})}</p>}{retry?<p>Your saved checkout keeps its original amount. Review it securely on Stripe.</p>:<dl><div><dt>{tourDays(tour?.days)} · {guests} {guests===1?'guest':'guests'}</dt><dd>{tourMoney(total)}</dd></div><div className="north-quote-deposit"><dt>{fullPayment?'Pay in full today':`Pay ${initial.bps/100}% today`}</dt><dd>{initial.ready?tourMoney(deposit):'Refresh to check'}</dd></div><div><dt>Remaining after this payment</dt><dd>{initial.ready?tourMoney(total-deposit):'—'}</dd></div></dl>}{!retry&&fullPayment&&<p className="north-small">This departure is inside the balance-due window, so the full tour price is due now.</p>}</div>
 {!catalogue?.payments_ready&&<p role="status">{simple?'This operator is still setting up payments. Checkout will be available when setup is complete.':'This operator is still connecting test payments. Checkout will be available when setup is complete.'}</p>}{sessions.length===0&&<p>No departures are available yet.</p>}<form onSubmit={pay} className="north-form"><p className="guest-form-intro"><strong>Book as a guest.</strong> No account or password needed.</p><SessionContactFields details={retry?.booking.details||details} onChange={d=>{setDetails(d);if(invalid)setInvalid(null);}} disabled={busy||!!retry} prefix="tour" invalid={invalid}/>{retry&&<p className="north-small">Your previous request is saved. Continue it safely without creating another payment.</p>}<p className="north-small">Pay securely on Stripe. Save your private booking link to check the trip and any remaining balance. No email is sent.</p><button className="north-button" disabled={busy||!catalogue?.payments_ready||!session||!retry&&(!initial.ready||!places.bookable||qty>places.max)}>{busy?'Opening secure checkout…':retry?(simple?'Continue saved checkout':'Continue saved test checkout'):'Pay '+tourMoney(deposit||0)+(simple?(fullPayment?' in full':' deposit'):(fullPayment?' in full (test)':' test deposit'))}</button></form></>}
 </aside></div></main><footer className="north-footer"><strong>{operatorName}</strong><p>{operator?.tagline}</p><span>{simple?'Bookings powered by Bookuno':'Bookings powered by Bookuno · private test environment · no real money or emails'}</span></footer></>;
}
ReactDOM.createRoot(document.getElementById('root')).render(<OperatorTour/>);
