PageSourceSearch

https://camp.com/assets/_page._location.activities._slug.booking.tickets-B7TIJtQH.js

js camp.com collected 2026-09-25 07:38:38 UTC 17,363 bytes, 2 lines download raw bytes

1import{c as $e}from"./compiler-runtime-DxhGMidE.js";import{j as n}from"./jsx-runtime-CQksViU1.js";import{r as v}from"./index-BBoARLeU.js";import{D as Ce}from"./datetime-BGxK8RTU.js";import{u as tt}from"./BookingFlowContext-BfZk195d.js";import{d as nt,A as qe}from"./shopify-CsVLMp4a.js";import{A as st}from"./ActivityTypeFormTicketBundles-BObLTTDO.js";import{c as it}from"./format-D2QT8i2k.js";import{N as lt}from"./NumberSpinner-ClKlTD4q.js";import{B as Fe}from"./Button-C63jXhQf.js";import Oe from"./Button-k5zc9u-9.js";import{q as je}from"./transition-CXvpng87.js";import{_ as z}from"./dialog-Bvu1B6dN.js";import{p as ae}from"./pluralize-DG9-4mza.js";import{S as Ve}from"./Spinner-BBX8pSrI.js";import{R as at}from"./index-CL7i9JQ9.js";import{q as rt}from"./index-DkV7tWsE.js";import{b as K}from"./routes-B-Fz0LXv.js";import{C as ot}from"./colors-p2iHJrYl.js";import{b as ct}from"./meta-tags-BBByOwsn.js";import{u as dt,e as ut,b as mt}from"./index-ChgXnHiE.js";import{u as pt}from"./useMutation-BXc1xTp_.js";import"./index.module-CTb8NRFw.js";import"./index-qFevD1Km.js";import"./compact-DPxGzxHn.js";import"./useQuery-DGTVmkfQ.js";import"./index-B-wdoswJ.js";import"./Star-e1ExqoPp.js";import"./index-DjMNg0y_.js";import"./ChevronDown-M1gdR6sw.js";import"./Close-R069WbEn.js";import"./menu-CkcfmUJj.js";import"./use-is-mounted-DsN8yxfe.js";import"./use-owner-wvvGWkJc.js";import"./use-resolve-button-type-BPIJnhEw.js";import"./use-text-value-BAY5-BB7.js";import"./range-D-WD-LRY.js";import"./toInteger-4blijS68.js";import"./NumberSpinner-CidMgbSg.js";import"./ticketBundleDiscounts-C0VFtQ-6.js";import"./Link-CGhXP-VG.js";import"./hidden-Cu8QcgaP.js";import"./___vite-browser-external_commonjs-proxy-osQ3K3mc.js";import"./location-dPuLFKYn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0f83b9f106262b0ac68fcc612207ea452ac0c789"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aa52b51a-0127-4545-8456-fda5c3bc0760",e._sentryDebugIdIdentifier="sentry-dbid-aa52b51a-0127-4545-8456-fda5c3bc0760")})()}catch{}const re=({state:e,onClose:t,message:d,title:a="Your Selected Time Is Not Available",confirmLabel:i="Proceed with new time",cancelLabel:r="Go Back",tertiaryLabel:o,onTertiary:c,onGoBack:m})=>n.jsx(je,{show:e!="closed",as:v.Fragment,children:n.jsxs(z,{onClose:()=>{},className:"fixed inset-0 z-60 flex overflow-hidden py-0 md:overflow-auto md:py-8",children:[n.jsx(je.Child,{as:v.Fragment,enter:"transition ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:n.jsx(z.Backdrop,{
1className:"fixed inset-0 z-60 bg-black bg-opacity-40"})}),n.jsx("div",{className:"mt-auto w-full max-w-page-width md:m-auto md:px-4",children:n.jsx(je.Child,{as:v.Fragment,enter:"transition ease-out duration-300 md:duration-100",enterFrom:"opacity-0 translate-y-full md:translate-y-0 md:scale-95",enterTo:"opacity-100 translate-y-0 md:scale-100",leave:"transition ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 md:scale-100",leaveTo:"opacity-0 translate-y-full md:translate-y-0 md:scale-95",children:n.jsxs(z.Panel,{className:"mx-auto flex max-h-[90vh] w-full max-w-4xl transform flex-col items-center overflow-y-auto rounded-t-2xl bg-white py-8 md:max-h-none md:overflow-y-visible md:rounded-2xl",children:[n.jsx(z.Title,{className:"mb-6 w-full px-5 text-left font-serif text-lg text-camp-primary md:px-8 md:text-2xl",children:a}),n.jsx(z.Description,{className:"mb-8 w-full px-5 text-left text-lg text-camp-primary/80 md:px-8",children:d}),n.jsxs("div",{className:"flex w-full flex-col items-stretch gap-4 px-5 md:w-auto md:px-8",children:[o&&c&&n.jsx("button",{type:"button",onClick:c,className:"text-center text-base text-camp-primary underline",children:o}),n.jsxs("div",{className:"flex flex-col-reverse items-stretch gap-3 md:flex-row md:items-center md:justify-center",children:[m&&n.jsx(Oe,{size:"large",variant:"primary",style:"outlined",full:{sm:!0},ariaLabel:r,onClick:m,children:r}),n.jsx(Oe,{size:"large",variant:"primary",full:{sm:!0},ariaLabel:i,onClick:t,children:i})]})]})]})})})]})}),ft=({remainingTickets:e,currentTickets:t,nextActivity:d,onProceed:a,onCancel:i,onGoBack:r,onStayAtLimit:o})=>{const c=n.jsxs(n.Fragment,{children:["There ",e===1?"is":"are"," ",n.jsxs("strong",{className:"font-bold",children:["only ",ae(e,"ticket","tickets")," left"]})," ","for this time slot."]});if(!d)return n.jsx(re,{state:"open",title:"Not Enough Tickets Left",message:n.jsxs(n.Fragment,{children:[c," No later time on this date has room for that many — you can stay on this time with"," ",ae(e,"ticket","tickets"),", or go back to try another date."]}),confirmLabel:`Stay with ${ae(e,"ticket","tickets")}`,cancelLabel:"Go Back",onClose:o,onGoBack:r});const m=Ce.fromISO(d.startsAt).setZone(d.location.timezone);return n.jsx(re,{state:"open",title:"Not Enough Tickets Left",message:n.jsxs(n.Fragment,{children:[c," Would you like to change your reservation to the next time slot with sufficient capacity?",n.jsx("span",{className:"mt-4 block",children:"Next available time:"}),n.jsx("strong",{className:"mt-3 block text-center font-bold",children:m.toFormat("cccc, LLLL d 'at' h:mm a")})]}),confirmLabel:"Proceed with next available time",cancelLabel:"Select different time",tertiaryLabel:`Keep current time with ${ae(t,"ticket","tickets")}`,onTertiary:i,onClose:a,onGoBack:r})},ht={Adult:"Ages 15+",Kids:"Ages 2-15",Infant:"Under 2"},Qe=({title:e,price:t,value:d,onChange:a,max:i,min:r=0})=>{const o=ht[e]??"";return n.jsxs("div",{className:"flex items-center justify-between py-5",children:[n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-bold text-camp-primary",children:e}),o&&n.jsx("p",{className:"text-sm text-gray-400",children:o})]}),n.jsx("div",{className:"text-base font-medium text-gray-300 whitespace-nowrap",children:t&&t>0?n.jsxs("span",{className:"flex items-baseline gap-1",children:[n.jsx("p",{className:"text-xl text-camp-primary",children:`${it(t)}`}),n.jsx("p",{className:"text-xl",children:"/ person"})]}):"Free"})]}),n.jsx(lt,{value:d,onChange:a,min:r,max:i,label:e})]})},xt=e=>{const t=$e.c(22),{show:d,childrenTitle:a,childrenValue:i,adultsValue:r,ticketBundlesValue:o,bundleAddonsValue:c,adultsTitle:m,onChildrenChange:s,onAdultsChange:l,color:T,error:O,clearError:oe,maxChild:W,maxAdult:ce,adultsEnabled:G,ticketBundles:p,onBundleQuantityChange:de,onBundleAddonQuantityChange:ue,ticketBundlePrices:B,childPrice:A,adultPrice:V,isWeekend:I,onClearAllBundleAddons:me,ticketBundleAddonsRef:E,scrollToSubmitButton:f,getIsKeyboardNavigating:b,activityTypeId:pe}=e;let N;t[0]!==r||t[1]!==i||t[2]!==o?(N=i&&i>0||r&&r>0||Object.values(o).some(gt),t[0]=r,t[1]=i,t[2]=o,t[3]=N):N=t[3];const h=N;let k;
1t[4]!==c||t[5]!==p||t[6]!==o?(k=()=>{const u=Object.entries(o).filter(yt);if(u.length===0)return!0;for(const[Q,_]of u){const S=p==null?void 0:p.find(D=>D.id===Q);if(!S)continue;const w=S.ticketBundleAddonSlots.filter(bt);if(w.length===0)continue;const L=w.reduce(kt,0)*_;if(Object.values(c).reduce(Ct,0)<L)return!1}return!0},t[4]=c,t[5]=p,t[6]=o,t[7]=k):k=t[7];const x=k,P=Object.values(c).reduce(Tt,{});let j;t[8]!==b||t[9]!==x||t[10]!==h||t[11]!==f?(j=()=>{let u=null;return h&&x()&&f&&b&&!b()&&(u=setTimeout(()=>{f()},500)),()=>{u&&clearTimeout(u)}},t[8]=b,t[9]=x,t[10]=h,t[11]=f,t[12]=j):j=t[12];let C;t[13]!==r||t[14]!==c||t[15]!==i||t[16]!==b||t[17]!==x||t[18]!==h||t[19]!==f||t[20]!==o?(C=[h,x,f,i,r,o,c,b],t[13]=r,t[14]=c,t[15]=i,t[16]=b,t[17]=x,t[18]=h,t[19]=f,t[20]=o,t[21]=C):C=t[21],v.useEffect(j,C);const M=p&&p.length>0&&B&&B.length>0;return d?n.jsxs("div",{children:[!M&&n.jsxs("div",{className:"divide-y divide-gray-100",children:[G&&n.jsx(Qe,{title:m||"Adult",price:V,value:r??0,onChange:u=>l(String(u)),max:ce}),n.jsx(Qe,{title:G?a||"Kids":"General Admission",price:A,value:i??0,onChange:u=>s(String(u)),max:W})]}),p&&p.length>0&&B&&B.length>0&&n.jsx("div",{className:"-mx-4 md:-mx-6 -mt-2 border-b border-gray-100",children:n.jsx(st,{ticketBundlesValue:o,ticketBundles:p,color:T,onBundleQuantityChange:de,error:O,bundleAddonsValue:P,onBundleAddonQuantityChange:ue,ticketBundlePrices:B??[],compareAtPrice:A,isWeekend:I,maximumQuantity:W,onClearAllBundleAddons:me,clearError:oe,ticketBundleAddonsRef:E,useNumberSpinner:!0,activityTypeId:pe})}),O&&n.jsx("p",{className:"text-sm text-red-600 pt-2",children:O})]}):null};function gt(e){return e>0}function yt(e){const[,t]=e;return t>0}function bt(e){return e.applicableProducts.length>1}function kt(e,t){return e+t.quantity}function jt(e,t){return e+t.quantity}function Ct(e,t){return e+t.reduce(jt,0)}function Tt(e,t){return t.forEach(d=>{e[d.variantId]=d.quantity}),e}const bn=({matches:e,location:t})=>ct(e,t,{hidden:!0}),vt=()=>{var Be,Ae,Ne,Se,we,Ie,Ee;const e=$e.c(63),t=dt(),d=ut(),{slug:a,location:i}=mt(),{track:r}=nt(),o=d.state==="loading"&&((Be=d.location)==null?void 0:Be.pathname.includes("/schedule")),{activityType:c,selectedDate:m,selectedActivity:s,quantityState:l,stableQuantityProps:T,maxChildQuantity:O,maxAdultQuantity:oe,handleChildrenChange:W,handleAdultsChange:ce,handleTicketBundlesChange:G,handleBundleAddonsChange:p,handleClearAllBundleAddons:de,formError:ue,clearError:B,timeSlotsLoading:A,savePersistedState:V,initializeTicketQuantities:I,slotChangeWarningState:me,closeSlotChangeWarning:E,capacityPrompt:f,confirmCapacityPrompt:b,confirmCapacityPromptAtLimit:pe,dismissCapacityPrompt:N}=tt();let h,k;e[0]!==I?(h=()=>{I()},k=[I],e[0]=I,e[1]=h,e[2]=k):(h=e[1],k=e[2]),v.useEffect(h,k);let x,P;e[3]!==r?(x=()=>{r(qe.BOOKING_TICKET_QUANTITY_SCREEN_LOADED)},P=[r],e[3]=r,e[4]=x,e[5]=P):(x=e[4],P=e[5]),v.useEffect(x,P);let j,C;e[6]!==i||e[7]!==t||e[8]!==s||e[9]!==m||e[10]!==a||e[11]!==A?(j=()=>{A||(!m||!s)&&t(K(i,a,"schedule"),{replace:!0})},C=[m,s,A,t,a,i],e[6]=i,e[7]=t,e[8]=s,e[9]=m,e[10]=a,e[11]=A,e[12]=j,e[13]=C):(j=e[12],C=e[13]),v.useEffect(j,C);const[M,u]=v.useState(null);let Q;e:{if(!s){let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[14]=F):F=e[14],Q=F;break e}let g;e[15]!==l.ticketBundles?(g=Object.entries(l.ticketBundles),e[15]=l.ticketBundles,e[16]=g):g=e[16];let ne;e[17]!==c.ticketBundles||e[18]!==l.bundleAddons||e[19]!==s||e[20]!==g?(ne=g.map(F=>{var _e;const[se,Pe]=F,ie=(_e=s.ticketBundleTicketPrices)==null?void 0:_e.find(y=>y.ticketBundleId===parseInt(se)),ke=c.ticketBundles.find(y=>y.id===se);if(!(ie!=null&&ie.signedPrice)||!ke)return null;const Xe=ke.ticketBundleAddonSlots.map(y=>{var le,Le;if(y.applicableProducts.length===1){const De=(Le=(le=y.applicableProducts.at(0))==null?void 0:le.variants.at(0))==null?void 0:Le.id,Re=Pe*y.quantity;return!De||!Re?null:{ticketBundleAddonSlotId:parseInt(y.id),productVariantId:De,quantity:Re}}return null}).filter(Boolean),et=Object.entries(l.bundleAddons).filter(y=>{const[le]=y;return le.startsWith(`${se}-`)}).flatMap(Bt);return{ticketBundleId:parseInt(se),quantity:Pe,ticketQuantity:ke.ticketQuantity,ticketPriceSignature:ie.signedPrice,addons:[...Xe,...et]}}).filter(At),e[17]=c.ticketBundles,e[18]=l.bundleAddons,e[19]=s,e[20]=g,e[21]=ne):ne
1=e[21],Q=ne}const _=Q;let S;e[22]!==l.adults||e[23]!==l.children||e[24]!==l.ticketBundles?(S=l.children!==null&&l.children>0||l.adults!==null&&l.adults>0||Object.values(l.ticketBundles).some(Nt),e[22]=l.adults,e[23]=l.children,e[24]=l.ticketBundles,e[25]=S):S=e[25];const w=S;let L;e[26]!==t||e[27]!==V?(L=g=>{g.response&&(V(),t(`/book/${g.response.reservationRequest.token}?${rt.stringify({origin:"new-booking-flow"})}`))},e[26]=t,e[27]=V,e[28]=L):L=e[28];const Y=L;let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=g=>{u(g.message)},e[29]=D):D=e[29];const ze=D,fe=(s==null?void 0:s.id)??"",he=l.adults??0,xe=l.children??0,ge=(Ae=s==null?void 0:s.signedPriceAdultTierCurrent)==null?void 0:Ae.signature,ye=(Ne=s==null?void 0:s.signedPriceChildTierCurrent)==null?void 0:Ne.signature;let R;e[30]!==_?(R=_.length>0&&{ticketBundles:_},e[30]=_,e[31]=R):R=e[31];let q;e[32]!==fe||e[33]!==he||e[34]!==xe||e[35]!==ge||e[36]!==ye||e[37]!==R?(q={activityId:fe,adults:he,children:xe,adultPriceSignature:ge,childPriceSignature:ye,termsAndConditionsChecked:!1,emailSharingChecked:!1,flexibleTicket:!1,membershipAdded:!1,...R},e[32]=fe,e[33]=he,e[34]=xe,e[35]=ge,e[36]=ye,e[37]=R,e[38]=q):q=e[38];let U;e[39]!==Y||e[40]!==q?(U={variables:q,onCompleted:Y,onError:ze},e[39]=Y,e[40]=q,e[41]=U):U=e[41];const[be,Ke]=pt(at,U),{loading:We,data:Ge}=Ke;let Z;e[42]!==be||e[43]!==w||e[44]!==s||e[45]!==r?(Z=()=>{!s||!w||(u(null),r(qe.BOOKING_RESERVE_YOUR_TICKETS),be())},e[42]=be,e[43]=w,e[44]=s,e[45]=r,e[46]=Z):Z=e[46];const Me=Z,Te=We||!!Ge,$=s?Ce.fromISO(s.startsAt).setZone(s.location.timezone):null,Ye=$?n.jsxs(n.Fragment,{children:["The original time you selected is not available for this number of people. We've automatically adjusted your scheduled time to:",n.jsx("br",{}),n.jsx("strong",{className:"font-bold",children:$.toFormat("cccc, LLLL d 'at' h:mm a")}),n.jsx("br",{}),"If you'd like to select a different time, please go back to the previous page."]}):null;if(!m||!s||!$)return null;const ve=c.ticketBundles.length>0,Ue=s.ticketBundleTicketPrices??[],Ze=((Se=s.signedPriceChildTierCurrent)==null?void 0:Se.price)??void 0,He=((we=s.signedPriceAdultTierCurrent)==null?void 0:we.price)??void 0;let H;e[47]!==s.startsAt?(H=Ce.fromISO(s.startsAt),e[47]=s.startsAt,e[48]=H):H=e[48];const Je=H.weekday>=6;let J;e[49]!==E||e[50]!==i||e[51]!==t||e[52]!==a?(J=()=>{E(),t(K(i,a,"schedule"))},e[49]=E,e[50]=i,e[51]=t,e[52]=a,e[53]=J):J=e[53];let X;e[54]!==i||e[55]!==t||e[56]!==a?(X=()=>{u(null),t(K(i,a,"schedule"))},e[54]=i,e[55]=t,e[56]=a,e[57]=X):X=e[57];let ee;e[58]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>u(null),e[58]=ee):ee=e[58];let te;return e[59]!==i||e[60]!==t||e[61]!==a?(te=()=>t(K(i,a,"schedule")),e[59]=i,e[60]=t,e[61]=a,e[62]=te):te=e[62],n.jsxs("div",{className:"space-y-6",children:[f&&n.jsx(ft,{remainingTickets:f.remainingTickets,currentTickets:f.currentTickets,nextActivity:f.nextActivity,onProceed:b,onCancel:N,onStayAtLimit:pe,onGoBack:()=>{N(),t(K(i,a,"schedule"))}}),n.jsx(re,{state:me,onClose:E,message:Ye,onGoBack:J}),n.jsx(re,{state:M?"open":"closed",title:"Not Enough Tickets Left",message:M,confirmLabel:"Choose Another Time",cancelLabel:"Adjust Ticket Count",onClose:X,onGoBack:ee}),n.jsxs("div",{className:"bg-white rounded-lg shadow px-4 py-5 md:px-6 md:py-8 space-y-2",children:[n.jsxs("div",{className:"-mx-4 md:-mx-6 px-5 border-b border-gray-100 pb-4",children:[n.jsxs("p",{className:"text-sm sm:text-base font-bold text-blue-dark-300 mb-2 text-pretty",children:[$.toFormat("cccc, LLLL d")," at"," ",$.toFormat("h:mm a"),(Ie=s.location)!=null&&Ie.name?` · ${s.location.name}`:""]}),n.jsx("h2",{className:"text-xl font-bold mb-2 text-pretty",children:ve?"Select Number of People & Ticket Type":"Number of people"}),n.jsxs("p",{className:"text-lg text-gray-300 text-pretty",children:["All guests aged 2 and older need tickets,"," ",n.jsx("strong",{className:"font-bold",children:"including adults"}),". Children must be accompanied by an adult.",ve&&" Select the number of people per ticket type."]})]}),n.jsx(xt,{show:!0,childrenTitle:T.childrenTitle,childrenDescription:T.childrenDescription,childrenValue:l.children,adultsValue:l.adults,ticketBundlesValue:l.ticketBundles,bundleAddonsValue:l.bundleAddons,adultsTitle:T.adultsTitle,adultsDescription:T.adultsDescription,onChildrenChange:W,onAdultsChange:ce,color:ot,error:ue,clearError:B,maxChild:O,maxAdult:oe,onBundleQuantityChange:G,onBundleAddonQuantityChange:p,childDiscountTiers:T.childDiscountTiers,adultDiscountTiers:T.adultDiscountTiers,adultsEnabled:s.adultsEnabled,ticketBundles:c.ticketBundles,ticketBundlePrice
1s:Ue,childPrice:Ze,adultPrice:He,isWeekend:Je,onClearAllBundleAddons:de,activityTypeId:c.id,locationName:((Ee=s.location)==null?void 0:Ee.name)??void 0}),n.jsxs("p",{className:"text-sm sm:text-base text-gray-300 mt-8 text-pretty text-center",children:["Discount Code?"," ",n.jsx("strong",{className:"text-blue-dark-300",children:"Apply it at checkout"})," ","— before payment"]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx(Fe,{onClick:te,disabled:o,variant:"primary",customBackgroundColor:"#4777BF",size:"large",children:n.jsx("span",{className:"flex items-center justify-center min-w-[2.5rem]",children:o?n.jsx(Ve,{className:"h-6 w-6 animate-spin"}):"Back"})}),n.jsx(Fe,{onClick:Me,disabled:!w||Te,variant:"primary",size:"xlarge",full:!0,customBackgroundColor:"#E6E569",customTextColor:"#193479",children:n.jsx("span",{className:"flex items-center justify-center min-w-[5.5rem]",children:Te?n.jsx(Ve,{className:"h-6 w-6 animate-spin"}):"Add to Cart"})})]})]})};vt.displayName="TicketsRoute";function Bt(e){const[t,d]=e,a=t.split("-")[1];return d.map(i=>({ticketBundleAddonSlotId:parseInt(a),productVariantId:i.variantId,quantity:i.quantity}))}function At(e){return e!==null}function Nt(e){return e>0}export{vt as default,bn as meta};
2//# sourceMappingURL=_page._location.activities._slug.booking.tickets-B7TIJtQH.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.