PageSourceSearch

https://bants.manus.space/assets/Tickets-ByIzzMLg.js

js bants.manus.space collected 2026-10-03 05:00:15 UTC 13,739 bytes, 11 lines download raw bytes

1import{c as b,d as f,r as n,t as v,j as e,f as D,n as N,o as d,p as m,k as L,q as T}from"./index-C6jjXqoV.js";import{S as P,M as U,P as E}from"./search-DYFl5yFN.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const H=b("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const A=b("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);function K(){const{language:i}=f(),t=i==="zh-Hant",[a,p]=n.useState(""),[l,u]=n.useState(""),[r,h]=n.useState(null),{data:o,isFetching:g}=v.ticketing.retrieve.useQuery(r??{publicId:"disabled",email:"[email protected]"},{enabled:!!r});return e.jsxs("section",{"data-loc":"client/src/components/TicketRetrieval.tsx:15",className:"retrieval-panel",children:[e.jsxs("div",{"data-loc":"client/src/components/TicketRetrieval.tsx:16",children:[e.jsx(A,{"data-loc":"client/src/components/TicketRetrieval.tsx:16",className:"h-7 w-7 text-[#d7b86b]"}),e.jsx("h2",{"data-loc":"client/src/components/TicketRetrieval.tsx:16",className:"mt-5 font-display text-4xl text-white",children:t?"重新取得門票":"Retrieve your tickets"}),e.jsx("p",{"data-loc":"client/src/components/TicketRetrieval.tsx:16",className:"mt-3 max-w-lg text-sm leading-6 text-slate-400",children:t?"使用付款確認頁顯示的訂單編號及購票電郵,隨時再次開啟數碼門票。":"Use the order reference from your payment confirmation and the purchase email to reopen your digital tickets at any time."})]}),e.jsxs("form",{"data-loc":"client/src/components/TicketRetrieval.tsx:17",onSubmit:c=>{c.preventDefault(),h({publicId:a.trim().toUpperCase(),email:l.trim()})},className:"mt-7 grid gap-4 sm:grid-cols-[1fr_1fr_auto] sm:items-end",children:[e.jsxs("label",{"data-loc":"client/src/components/TicketRetrieval.tsx:18",className:"field-label",children:[e.jsx("span",{"data-loc":"client/src/components/TicketRetrieval.tsx:18",children:t?"訂單編號":"Order reference"}),e.jsx("input",{"data-loc":"client/src/components/TicketRetrieval.tsx:18",required:!0,minLength:8,maxLength:40,value:a,onChange:c=>p(c.target.value),placeholder:"ORD-…"})]}),e.jsxs("label",{"data-loc":"client/src/components/TicketRetrieval.tsx:19",className:"field-label",children:[e.jsx("span",{"data-loc":"client/src/components/TicketRetrieval.tsx:19",children:t?"購票電郵":"Purchase email"}),e.jsx("input",{"data-loc":"client/src/components/TicketRetrieval.tsx:19",required:!0,type:"email",maxLength:320,value:l,onChange:c=>u(c.target.value)})]}),e.jsxs("button",{"data-loc":"client/src/components/TicketRetrieval.tsx:20",type:"submit",className:"secondary-cta min-h-[3.25rem] justify-center",children:[e.jsx(P,{"data-loc":"client/src/components/TicketRetrieval.tsx:20",className:"h-4 w-4"}),t?"尋找":"Find"]})]}),r&&!g&&!o&&e.jsx("p",{"data-loc":"client/src/components/TicketRetrieval.tsx:22",className:"mt-5 text-sm text-[#e4c67d]",children:t?"找不到相符的已付款訂單。請核對資料。":"No matching paid order was found. Check both details."}),o&&e.jsx("div",{"data-loc":"client/src/components/TicketRetrieval.tsx:23",className:"mt-7 grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:o.tickets.map(c=>e.jsxs(D,{"data-loc":"client/src/components/TicketRetrieval.tsx:23",href:`/ticket/${c.ticketCode}`,className:"flex items-center gap-3 rounded-xl border border-white/10 bg-white/[0.025] p-4",children:[e.jsx(N,{"data-loc":"client/src/components/TicketRetrieval.tsx:23",className:"h-5 w-5 text-cyan-200"}),e.jsxs("span",{"data-loc":"client/src/components/TicketRetrieval.tsx:23",children:[e.jsx("strong",{"data-loc":"client/src/components/TicketRetrieval.tsx:23",className:"block text-sm text-white",children:c.ticketType==="adult"?"Adult":"Child U15"}),e.jsx("small",{"data-loc":"client/src/components/TicketRetrieval.tsx:23",className:"text-slate-500",children:c.ticketCode})]})]},c.ticketCode))})]})}const I={en:{eyebrow:"Secure your place",title:"Tickets",intro:"Choose your tickets, add buyer details and continue to secure Stripe Checkout. Your digital passes appear after verified payment.",adultDetail
11:"Standard event admission for one visitor.",childDetail:"Admission for one visitor under 15. Age may be checked at entry.",buyer:"Buyer details",name:"Full name",email:"Email address",phone:"Phone (optional)",promo:"Promo code (optional)",promoHint:"If you have a code, enter it here. You can also apply an eligible code in secure checkout.",summary:"Order summary",total:"Total",continue:"Continue to secure checkout",redirect:"Secure Stripe Checkout is opening in a new tab.",error:"Checkout could not be started. Please check your details and try again.",cancelled:"Checkout was cancelled. Your card was not charged.",secure:["Secure payment through Stripe","Promo codes supported","Digital QR tickets after payment"]},"zh-Hant":{eyebrow:"預留入場名額",title:"門票",intro:"選擇門票、填寫購票人資料,然後前往安全的 Stripe 結帳。付款經確認後,數碼門票會立即顯示。",adultDetail:"一位訪客的標準展會門票。",childDetail:"一位 15 歲以下訪客門票;入場時或需核實年齡。",buyer:"購票人資料",name:"姓名",email:"電郵地址",phone:"電話(選填)",promo:"優惠碼(選填)",promoHint:"如有優惠碼,請在此輸入。合資格優惠碼亦可於安全結帳頁使用。",summary:"訂單摘要",total:"總額",continue:"前往安全結帳",redirect:"正在新分頁開啟安全的 Stripe 結帳。",error:"未能開始結帳。請檢查資料後重試。",cancelled:"結帳已取消,你的信用卡不會被扣款。",secure:["透過 Stripe 安全付款","支援優惠碼","付款後取得數碼 QR 門票"]}};function M({value:i,onChange:t,label:a}){return e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:53",className:"quantity-control","aria-label":a,children:[e.jsx("button",{"data-loc":"client/src/pages/Tickets.tsx:53",type:"button",onClick:()=>t(Math.max(0,i-1)),"aria-label":`Remove one ${a}`,children:e.jsx(U,{"data-loc":"client/src/pages/Tickets.tsx:53",className:"h-4 w-4"})}),e.jsx("span",{"data-loc":"client/src/pages/Tickets.tsx:53","aria-live":"polite",children:i}),e.jsx("button",{"data-loc":"client/src/pages/Tickets.tsx:53",type:"button",onClick:()=>t(Math.min(12,i+1)),"aria-label":`Add one ${a}`,children:e.jsx(E,{"data-loc":"client/src/pages/Tickets.tsx:53",className:"h-4 w-4"})})]})}function z(){const{language:i}=f(),t=I[i],[a,p]=n.useState(1),[l,u]=n.useState(0),[r,h]=n.useState(""),[o,g]=n.useState(""),[c,w]=n.useState(""),[j,C]=n.useState(""),k=v.ticketing.createCheckout.useMutation(),y=a*d.adult+l*d.childU15,R=typeof window<"u"&&new URLSearchParams(window.location.search).get("cancelled")==="1",S=async s=>{if(s.preventDefault(),a+l<1)return T.error(i==="en"?"Choose at least one ticket.":"請選擇至少一張門票。");try{const x=await k.mutateAsync({buyerName:r,email:o,phone:c||void 0,promoCode:j||void 0,adultQuantity:a,childQuantity:l,language:i});T.success(t.redirect),window.open(x.checkoutUrl,"_blank","noopener,noreferrer")||window.location.assign(x.checkoutUrl)}catch(x){T.error(x instanceof Error?x.message:t.error)}};return e.jsx("section",{"data-loc":"client/src/pages/Tickets.tsx:83",className:"page-hero",children:e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:84",className:"container py-16 sm:py-24",children:[e.jsx("p",{"data-loc":"client/src/pages/Tickets.tsx:85",className:"eyebrow text-cyan-200",children:t.eyebrow}),e.jsx("h1",{"data-loc":"client/src/pages/Tickets.tsx:86",className:"mt-5 font-display text-7xl leading-[0.88] text-white sm:text-9xl",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/Tickets.tsx:87",className:"mt-6 max-w-2xl text-base leading-7 text-slate-300",children:t.intro}),R&&e.jsx("div",{"data-loc":"client/src/pages/Tickets.tsx:88",className:"mt-8 rounded-xl border border-[#d7b86b]/30 bg-[#d7b86b]/10 p-4 text-sm text-[#ead18d]",children:t.cancelled}),e.jsxs("form",{"data-loc":"client/src/pages/Tickets.tsx:90",onSubmit:S,className:"mt-12 grid gap-8 xl:grid-cols-[1.25fr_0.75fr]",children:[e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:91",className:"space-y-5",children:[[{label:m.adult,price:d.adult,detail:t.adultDetail,value:a,setValue:p},{label:m.childU15,price:d.childU15,detail:t.childDetail,value:l,setValue:u}].map(s=>e.jsxs("article",{"data-loc":"client/src/pages/Tickets.tsx:96",className:"ticket-tier",children:[e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:97",children:[e.jsx("p",{"data-loc":"client/src/pages/Tickets.tsx:97",className:"eyebrow text-cyan-200",children:"Admission"}),e.jsx("h2",{"data-loc":"client/src/pages/Tickets.tsx:97",className:"mt-3 font-display text-4xl text-white",children:s.label}),e.jsx("p",{"data-loc":"client/src/pages/Tickets.tsx:97",className:"mt-2 text-sm text-slate-400",children:s.detail})]}),e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:98",className:"flex items-center justify-between gap-5 sm:justify-end",children:[e.jsxs("p",{"data-loc":"client/src/pages/Tickets.tsx:98",className:"font-display text-4xl text-white",children:["HKD ",s.price]}),e.jsx(M,{"data-loc":"client/src/pages/Tickets.tsx:98",value:s.value,onChange:s.setValue,label:s.label})]})]},s.label)),e.jsxs("fieldset",{"data-loc":"client/src/pages/Tickets.tsx:102",className:"form-panel",children:[e.jsx("legend",{"data-loc":"client/src/pages/Tickets.tsx:103",className:"font-display text-4xl text-white",children:t.buyer}),e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:104",className:"mt-7 grid gap-5 sm:grid-cols-2",children:[e.jsxs("label",{"data-loc":"client/src/pages/Tickets.tsx:105",className:"field-label sm:col-span-2",children:[e.jsx("span",{"data-loc":"client/src/pages/Tickets.tsx:105",children:t.name}),e.jsx("input",{"data-loc":"client/src/pages/Tickets.tsx:105",required:!0,minLength:2,maxLength:160,value:r,onChange:s=>h(s.target.value),autoComplete:"name"})]}),e.jsxs("label",{"data-loc":"client/src/pages/Tickets.tsx:106",className:"field-label",children:[e.jsx("span",{"data-loc":"client/src/pages/Tickets.tsx:106",children:t.email}),e.jsx("input",{"data-loc":"client/src/pages/Tickets.tsx:106",required:!0,type:"email",maxLength:320,value:o,onChange:s=>g(s.target.value),autoComplete:"email"})]}),e.jsxs("label",{"data-loc":"client/src/pages/Tickets.tsx:107",className:"field-label",children:[e.jsx("span",{"data-loc":"client/src/pages/Tickets.tsx:107",children:t.phone}),e.jsx("input",{"data-loc":"client/src/pages/Tickets.tsx:107",maxLength:40,value:c,onChange:s=>w(s.target.value),autoComplete:"tel"})]}),e.jsxs("label",{"data-loc":"client/src/pages/Tickets.tsx:108",className:"field-label sm:col-span-2",children:[e.jsx("span",{"data-loc":"client/src/pages/Tickets.tsx:108",children:t.promo}),e.jsx("input",{"data-loc":"client/src/pages/Tickets.tsx:108",maxLength:48,value:j,onChange:s=>C(s.target.value.toUpperCase()),autoCapitalize:"characters"}),e.jsx("small",{"data-loc":"client/src/pages/Tickets.tsx:108",children:t.promoHint})]})]})]})]}),e.jsxs("aside",{"data-loc":"client/src/pages/Tickets.tsx:113",className:"order-summary",children:[e.jsx(N,{"data-loc":"client/src/pages/Tickets.tsx:114",className:"h-7 w-7 text-cyan-200"}),e.jsx("h2",{"data-loc":"client/src/pages/Tickets.tsx:115",className:"mt-5 font-display text-4xl text-white",children:t.summary}),e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:116",className:"mt-8 space-y-4 border-y border-white/10 py-6 text-sm",children:[a>0&&e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:117",className:"flex justify-between gap-4",children:[e.jsxs("span",{"data-loc":"client/src/pages/Tickets.tsx:117",className:"text-slate-300",children:[m.adult," × ",a]}),e.jsxs("span",{"data-loc":"client/src/pages/Tickets.tsx:117",children:["HKD ",a*d.adult]})]}),l>0&&e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:118",className:"flex justify-between gap-4",children:[e.jsxs("span",{"data-loc":"client/src/pages/Tickets.tsx:118",className:"text-slate-300",children:[m.childU15," × ",l]}),e.jsxs("span",{"data-loc":"client/src/pages/Tickets.tsx:118",children:["HKD ",l*d.childU15]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Tickets.tsx:120",className:"mt-6 flex items-end justify-between gap-4",children:[e.jsx("span",{"data-loc":"client/src/pages/Tickets.tsx:120",className:"eyebrow text-slate-400",children:t.total}),e.jsxs("strong",{"data-loc":"client/src/pages/Tickets.tsx:120",className:"font-display text-5xl font-normal text-white",children:["HKD ",y]})]}),e.jsxs("button",{"data-loc":"client/src/pages/Tickets.tsx:121",type:"submit",disabled:k.isPending||y===0,className:"ticket-cta mt-8 flex min-h-12 w-full justify-center disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(L,{"data-loc":"client/src/pages/Tickets.tsx:121",className:"h-4 w-4"}),k.isPending?"…":t.continue]}),e.jsx("ul",{"data-loc":"client/src/pages/Tickets.tsx:122",className:"mt-7 space-y-3",children:t.secure.map(s=>e.jsxs("li",{"data-loc":"client/src/pages/Tickets.tsx:123",className:"flex items-center gap-2 text-xs text-slate-400",children:[e.jsx(H,{"data-loc":"client/src/pages/Tickets.tsx:123",className:"h-4 w-4 text-cyan-200"}),s]},s))})]})]}),e.jsx(K,{"data-loc":"client/src/pages/Tickets.tsx:127"})]})})}export{z as default};

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.